Ejemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        allStatus = new List <StatusBase>();
        allStatus.Add(new PlayerIdle(gameObject));
        enemy  = GameObject.Find("Enemy");
        target = GameObject.Find("Target");

        playerStatus = new PlayerIdle(gameObject);
        playerStatus.OnStart();
    }
Ejemplo n.º 2
0
    private void ChangeStatus(EPlayerState ePlayerState, KeyCode keyCode = KeyCode.JoystickButton9)
    {
        if (ePlayerState != playerStatus.PlayerState)
        {
            playerStatus.OnExit();

            switch (ePlayerState)
            {
            case EPlayerState.Idle:
                playerStatus = new PlayerIdle(gameObject);
                break;

            case EPlayerState.Run:
                playerStatus = new PlayerRun(gameObject);
                break;

            case EPlayerState.Atk:
                playerStatus = new PlayerAttack(gameObject, keyCode);
                break;

            case EPlayerState.Hit:

                break;

            case EPlayerState.Die:

                break;

            case EPlayerState.Jump:
                playerStatus = new PlayerJamp(gameObject);
                break;

            default:
                break;
            }
            playerStatus.OnStart();
        }
    }