Example #1
0
    public override void Start()
    {
        base.Start();

        moveState           = new E1_MoveState(this, stateMachine, "move", moveStateData, this);
        idleState           = new E1_IdleState(this, stateMachine, "idle", idleStateData, this);
        playerDetectedState = new E1_PlayerDetectedState(this, stateMachine, "playerDetected", playerDetectedData, this);
        chargeState         = new E1_ChargeState(this, stateMachine, "charge", chargeStateData, this);
        lookForPlayerState  = new E1_LookForPlayerState(this, stateMachine, "lookForPlayer", lookForPlayerStateData, this);
        meleeAttackState    = new E1_MeleeAttackState(this, stateMachine, "meleeAttack", meleeAttackPosition, meleeAttackStateData, this);

        stateMachine.Initialize(moveState);
    }
Example #2
0
    protected override void Start()
    {
        base.Start();
        idleState          = new E1_IdleState(stateMachine, this, "idle", idleStateData, this);
        walkState          = new E1_WalkState(stateMachine, this, "walk", walkStateData, this);
        chargeState        = new E1_ChargeState(stateMachine, this, "charge", chargetStateData, this);
        detectPlayerState  = new E1_DetectPlayerState(stateMachine, this, "detectPlayer", detectPlayerStateData, this);
        lookForPlayerState = new E1_LookForPlayerState(stateMachine, this, "lookForPlayer", lookForPlayerStateData, this);
        meleeAttackState   = new E1_MeleeAttackState(stateMachine, this, "meleeAttack", meleeAttackStateData, hitBoxPoint, this);
        stunState          = new E1_StunState(stateMachine, this, "stun", stunStateData, this);
        deadState          = new E1_DeadState(stateMachine, this, "dead", deadStateData, this);

        stateMachine.Initialize(walkState);
    }
    protected override void Awake()
    {
        base.Awake();

        enemyIdleState           = new E1_IdleState(this, enemyData, "idle", this);
        enemyMoveState           = new E1_MoveState(this, enemyData, "move", this);
        enemyPlayerDetectedState = new E1_PlayerDetectedState(this, enemyData, "playerDetected", this);
        enemyChargeState         = new E1_ChargeState(this, enemyData, "charge", this);
        enemyLookForPlayerState  = new E1_LookForPlayerState(this, enemyData, "lookForPlayer", this);
        enemyMelleAttackState    = new E1_MeleeAttackState(this, enemyData, "shortAction", this, meleeAttack);
        enemyStunState           = new E1_StunState(this, enemyData, "stun", this);
        enemyAttackedState       = new E1_AttackedState(this, enemyData, "attacked", this);
        enemyDeathState          = new E1_DeathState(this, enemyData, "die", this);
    }