Exemplo n.º 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);
    }
    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);
    }
Exemplo n.º 3
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", playerDetectedStateData, this);
        chargeState         = new E1_ChargeState(this, stateMachine, "charge", chargeStateData, this);
        lookForPlayerState  = new E1_LookForPlayerState(this, stateMachine, "lookForPlayer", lookForPlayerStateData, this);
        miliAttackState     = new E1_MiliAttackState(this, stateMachine, "miliAttack", miliAttackPosition, miliAttackStateData, this);
        stunState           = new E1_StunState(this, stateMachine, "stun", stunStateData, this);
        deadState           = new E1_DeadState(this, stateMachine, "dead", deadStateData, this);

        stateMachine.initialize(moveState);
    }
Exemplo n.º 4
0
    public override void Start()
    {
        base.Start();

        currentHealth = maxHealth;

        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);
        damagedState        = new E1_DamagedState(this, StateMachine, "damaged", this);

        playerDetectedState.SetWeapon(rockThrow);

        StateMachine.Initialize(idleState);
    }