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(); } } } }
private void WalkRight() { _personMover.Walk(Vector3.right); }