void Start()
    {
        m_StateSpawn = new AimedStateSpawn(this);
        m_StateCreateMuzzle = new AimedStateCreateMuzzle(this);
        m_StateAttack = new AimedStateAttack(this);
        m_StateRetreat = new AimedStateRetreat(this);
        m_StateDeleteEntity = new AimedStateDeleteEntity(this);

        Aimed = GameObject.Find("Aimed");
        enemyProp = Aimed.GetComponent<EnemyProperties>();

        ChangeState(eAimedState.Spawn);
    }
    public void ChangeState(eAimedState _newState)
    {
        switch (_newState)
        {
            case eAimedState.Spawn: m_CurrentState = m_StateSpawn; break;
            case eAimedState.CreateMuzzle: m_CurrentState = m_StateCreateMuzzle; break;
            case eAimedState.Attack: m_CurrentState = m_StateAttack; break;
            case eAimedState.Retreat: m_CurrentState = m_StateRetreat; break;
            case eAimedState.DeleteEntity: m_CurrentState = m_StateDeleteEntity; break;
        }

        m_CurrentState.Enter();
    }
Beispiel #3
0
    void Start()
    {
        m_StateSpawn        = new AimedStateSpawn(this);
        m_StateCreateMuzzle = new AimedStateCreateMuzzle(this);
        m_StateAttack       = new AimedStateAttack(this);
        m_StateRetreat      = new AimedStateRetreat(this);
        m_StateDeleteEntity = new AimedStateDeleteEntity(this);


        Aimed     = GameObject.Find("Aimed");
        enemyProp = Aimed.GetComponent <EnemyProperties>();

        ChangeState(eAimedState.Spawn);
    }
Beispiel #4
0
    public void ChangeState(eAimedState _newState)
    {
        switch (_newState)
        {
        case eAimedState.Spawn: m_CurrentState = m_StateSpawn; break;

        case eAimedState.CreateMuzzle: m_CurrentState = m_StateCreateMuzzle; break;

        case eAimedState.Attack: m_CurrentState = m_StateAttack; break;

        case eAimedState.Retreat: m_CurrentState = m_StateRetreat; break;

        case eAimedState.DeleteEntity: m_CurrentState = m_StateDeleteEntity; break;
        }

        m_CurrentState.Enter();
    }