Esempio n. 1
0
    protected override State CreateStatesAndReturnInitial()
    {
        IdleState         initialState  = new IdleState(stateMachine);
        TurretAttackState attackState   = new TurretAttackState(stateMachine, CreateStats());
        TurretLocateState locatingState = new TurretLocateState(stateMachine);

        stateMachine.AddStates((typeof(IdleState), initialState), (typeof(LocatorState), locatingState)
                               , (typeof(AIAttackState), attackState));

        return(initialState);
    }
Esempio n. 2
0
    protected virtual void EnterTurretAttackState()
    {
        switch (attackState)
        {
        case TurretAttackState.Anticipation:
            ChangeAimingRedDotState(AimingRedDotState.Following);
            animator.SetTrigger("AnticipationTrigger");
            currentAnticipationTime = attackValues.maxAnticipationTime;
            restTime = maxRestTime + UnityEngine.Random.Range(-randomRangeRestTime, randomRangeRestTime);
            break;

        case TurretAttackState.Attack:
            attackState = TurretAttackState.Attack;
            ChangeAimingRedDotState(AimingRedDotState.NotVisible);
            animator.SetTrigger("AttackTrigger");
            break;

        case TurretAttackState.Rest:
            break;

        case TurretAttackState.NotAttacking:
            break;
        }
    }
Esempio n. 3
0
 protected void ChangingTurretAttackState(TurretAttackState _newState)
 {
     ExitTurretAttackState();
     attackState = _newState;
     EnterTurretAttackState();
 }