Exemplo n.º 1
0
 private void Update()
 {
     if (state == PersonState.WALK)
     {
         mover.Walk((walkGoal - transform.position).normalized);
         if (Vector3.Distance(transform.position, walkGoal) <= arrivalThreshold)
         {
             state     = PersonState.IDLE;
             idleTimer = 0;
         }
     }
     else
     {
         if (house == null)
         {
             CheckForTree();
             if (walkGoalSource == null)
             {
                 SetRandomWalkGoal();
             }
         }
         else
         {
             idleTimer += Time.deltaTime;
             if (idleTimer >= idleMaxTime)
             {
                 idleTimer = Random.Range(0f, idleMaxTime);
                 SetRandomWalkGoal();
             }
         }
     }
 }
Exemplo n.º 2
0
 private void WalkRight()
 {
     _personMover.Walk(Vector3.right);
 }