Exemple #1
0
 // Use this for initialization
 void Start()
 {
     WanderLastTime = Time.time;
     MyMovement = gameObject.GetComponent<Movement> ();
     if (MyMovement == null)
         MyMovement = gameObject.AddComponent<Movement> ();
     WanderInitialPosition = transform.position;
 }
Exemple #2
0
 // Use this for initialization
 void Awake()
 {
     MyMovement = gameObject.GetComponent<Movement> ();
     MyMovement.OnReachTarget.AddListener (OnReachTarget);
     if (PathPoints.Count > 0) {
         MyMovement.MoveToPosition (PathPoints [PathIndex].transform.position);
     }
 }