Exemple #1
0
    protected override void Awake()
    {
        base.Awake();

        enemyIdleState           = new E2_IdleState(this, enemyData, "idle", this);
        enemyMoveState           = new E2_MoveState(this, enemyData, "move", this);
        enemyPlayerDetectedState = new E2_PlayerDetectedState(this, enemyData, "playerDetected", this);
        enemyMeleeAttackState    = new E2_MeleeAttackState(this, enemyData, "meleeAttack", this, meleeAttack);
        enemyLookForPlayerState  = new E2_LookForPlayerState(this, enemyData, "lookForPlayer", this);
        enemyRangeAttackState    = new E2_RangeAttackState(this, enemyData, "rangeAttack", this);
        enemyAttackedState       = new E2_AttackedState(this, enemyData, "attacked", this);
        enemyDeathState          = new E2_DeathState(this, enemyData, "die", this);
        enemyDodgeState          = new E2_DodgeState(this, enemyData, "dodge", this);
    }
Exemple #2
0
    public override void Start()
    {
        base.Start();

        moveState           = new E2_MoveState(this, stateMachine, "move", moveStateData, this);
        IdleState           = new E2_IdleState(this, stateMachine, "idle", IdleStateData, this);
        playerDetectedState = new E2_PlayerDetectedState(this, stateMachine, "playerDetected", playerDetectedStateData, this);
        meleeAttackState    = new E2_MeleeAttackState(this, stateMachine, "meleeAttack", meleeAttackPosition, meleeAttackStateData, this);
        lookForPlayerState  = new E2_LookForPlayerState(this, stateMachine, "lookForPlayer", lookForPlayerStateData, this);
        stunState           = new E2_StunState(this, stateMachine, "stun", stunStateData, this);
        deathState          = new E2_DeathState(this, stateMachine, "dead", deathStateData, this);
        dodgeState          = new E2_DodgeState(this, stateMachine, "dodge", dodgeStateData, this);
        rangedAttackState   = new E2_RangedAttackState(this, stateMachine, "rangedAttack", rangedAttackPosition, rangedAttackStateData, this);

        stateMachine.Initialize(moveState);
    }