Game Development Reference
In-Depth Information
this.transform.LookAt
(player.transform.position);
12. If there is a decisionMgr class instance attached to the NPC, the
npcScript allows it to evaluate all of its conditions for potential dispatch:
if (decisionMgr != null)
decisionMgr.eval ();
13. Lastly, depending on the state of the showPath Boolean, we either enable
or disable the lineRenderer component for the spline curve:
this.GetComponent<LineRenderer>().enabled
= showPath;
Congratulations! You have just written the npcScript base framework for a non-
player character class. As you can see, the power of this choreography class is de-
rived from the FSM, and the work is delegated to the DecisionMgr and SplineM-
gr classes.
Search WWH ::




Custom Search