Exemplo n.º 1
0
 public void SetState_FollowPlayer()
 {
     turnipState = TurnipState.FOLLOWING_PLAYER;
     pathfinding.SetTarget(player, OnPlayerReached);
     anim.SetBool("Moving", true);
     gameObject.layer = LayerMask.NameToLayer("Turnips_FollowingPlayer");
 }
Exemplo n.º 2
0
    public void SetTarget(Transform _target)
    {
        turnipState = TurnipState.GOING_TO;
        pathfinding.SetTarget(_target, SetState_FollowPlayer);

        anim.SetBool("Moving", true);
        gameObject.layer = LayerMask.NameToLayer("Turnips_GoingTo");
    }
Exemplo n.º 3
0
    public void SetTargetPosition(Vector3 _targetPos)
    {
        turnipState = TurnipState.GOING_TO;
        pathfinding.SetTarget(_targetPos, OnTargetPositionReached);

        anim.SetBool("Moving", true);
        gameObject.layer = LayerMask.NameToLayer("Turnips_GoingTo");
    }
Exemplo n.º 4
0
 void OnPlayerReached()
 {
     // Debug.Log("reachedPlayer");
     turnipState = TurnipState.WAITING_FOR_PLAYER;
     anim.SetBool("Moving", false);
 }
Exemplo n.º 5
0
 void OnTargetPositionReached()
 {
     turnipState = TurnipState.IDLE;
     anim.SetBool("Moving", false);
     gameObject.layer = LayerMask.NameToLayer("Turnips_Idle");
 }