public void SetState_FollowPlayer() { turnipState = TurnipState.FOLLOWING_PLAYER; pathfinding.SetTarget(player, OnPlayerReached); anim.SetBool("Moving", true); gameObject.layer = LayerMask.NameToLayer("Turnips_FollowingPlayer"); }
public void SetTarget(Transform _target) { turnipState = TurnipState.GOING_TO; pathfinding.SetTarget(_target, SetState_FollowPlayer); anim.SetBool("Moving", true); gameObject.layer = LayerMask.NameToLayer("Turnips_GoingTo"); }
public void SetTargetPosition(Vector3 _targetPos) { turnipState = TurnipState.GOING_TO; pathfinding.SetTarget(_targetPos, OnTargetPositionReached); anim.SetBool("Moving", true); gameObject.layer = LayerMask.NameToLayer("Turnips_GoingTo"); }
void OnPlayerReached() { // Debug.Log("reachedPlayer"); turnipState = TurnipState.WAITING_FOR_PLAYER; anim.SetBool("Moving", false); }
void OnTargetPositionReached() { turnipState = TurnipState.IDLE; anim.SetBool("Moving", false); gameObject.layer = LayerMask.NameToLayer("Turnips_Idle"); }