Exemplo n.º 1
0
    public static State_Player_UseSkill Instantiate()
    {
        if (instance == null)
        {
            instance = new State_Player_UseSkill();
        }

        return(instance);
    }
Exemplo n.º 2
0
 public override void Execute(PlayerManager obj)
 {
     // If the player dies
     if (obj.IsDead())
     {
         obj.GetFSM().ChangeState(State_Player_Die.Instantiate());
     }
     // The loop function during the move state
     obj.Move();
     // If there is no input detected, change to idle state
     if (Input.GetAxisRaw("Horizontal") == 0 || Input.GetAxisRaw("Vertical") == 0)
     {
         obj.GetFSM().ChangeState(State_Player_Idle.Instantiate());
     }
     // Cannot shoot if in the World Scene
     if (!obj.InWorld)
     {
         if (Input.GetButton("Fire1"))
         {
             obj.GetFSM().ChangeState(State_Player_UseSkill.Instantiate());
         }
     }
 }
Exemplo n.º 3
0
 public override void Execute(PlayerManager obj)
 {
     // If the player dies
     if (obj.IsDead())
     {
         obj.GetFSM().ChangeState(State_Player_Die.Instantiate());
     }
     // The loop function during the idle
     obj.Idle();
     // If there is any input, change to the move idle
     if (Input.GetAxisRaw("Horizontal") != 0 || Input.GetAxisRaw("Vertical") != 0)
     {
         obj.GetFSM().ChangeState(State_Player_Move.Instantiate());
     }
     // If the player is in the worldscene, it cannnot shoot.
     if (!obj.InWorld)
     {
         if (Input.GetButton("Fire1"))
         {
             obj.GetFSM().ChangeState(State_Player_UseSkill.Instantiate());
         }
     }
 }