Exemplo n.º 1
0
        private void State_Quit(double now)
        {
            STATE = PlayerAState.Quit;

            //Entry Action
            _Clock = now;
            Send_TAR(double.MaxValue, "OVER");
        }
Exemplo n.º 2
0
        private void State_Wait(double now)
        {
            STATE = PlayerAState.Wait;

            //Entry Action
            _Clock = now;
            Send_TAR(_Clock + wa, "Quit", "OVER");
        }
Exemplo n.º 3
0
        private void State_Gameover(double now)
        {
            STATE = PlayerAState.Gameover;

            //Entry Action
            _Clock = now;
            Send_TAR(double.MaxValue, "OVER");
        }
Exemplo n.º 4
0
        private void State_Defense(double now)
        {
            STATE = PlayerAState.Defense;

            //Entry Action
            _Clock = now;
            Send_TAR(double.MaxValue, "BallB", "OutB", "Quit", "OVER");
        }
Exemplo n.º 5
0
        private void State_Attack(double now)
        {
            STATE = PlayerAState.Attack;

            //Entry Action
            Rally++;
            U      = r.NextDouble();
            _Clock = now;
            Send_TAR(_Clock + aa, "Quit", "OVER");
        }
Exemplo n.º 6
0
    /// <summary>
    /// Changes the player's attack state to target input player attack state type. IMPORTANT: Also calls the previous state's ExitState before switching.
    /// </summary>
    /// <typeparam name="TargetStateType">The intended attack state.</typeparam>
    public virtual void ChangeAttackState <TargetStateType>() where TargetStateType : PlayerAState
    {
        if (CurrentAttackState)
        {
            CurrentAttackState.ExitState();
            Destroy(CurrentAttackState);
        }

        _currentAttackState = gameObject.AddComponent <TargetStateType>();
    }
Exemplo n.º 7
0
 private void State_OVER(double now)
 {
     STATE = PlayerAState.OVER;
 }