Example #1
0
    /// <summary>
    /// Player 2
    /// </summary>

    //Exhaust Phase player 2
    IEnumerator P2_ExhaustState()
    {
        Debug.Log("P2_ExhaustState: Enter");
        while (state == State.P2_Exhaust)
        {
            CheckExhaustStatus(2);
            EventHandler_Gameplay.OnTurnBegin(this.gameObject, 2);
            yield return(null);
        }
        Debug.Log("P2_ExhaustState: Exit");
        NextState();
    }
Example #2
0
    private void Register()
    {
        //TODO: register to networked battle manager instead.
        BattleManager.instance.RegisterUnit(this);

        //Register all eventhandlers on start.
        //This is mostly an example of usage at the momment.
        EventHandler_Gameplay.OnUnitSpawn     += this.NewUnitCreated;
        EventHandler_Gameplay.OnUnitDestroyed += this.OnUnitDestroy;
        if (info.owningPlayer == 1)
        {
            EventHandler_Gameplay.OnPlayer1TurnBegin += this.OnTurnBegin;
        }
        else if (info.owningPlayer == 2)
        {
            EventHandler_Gameplay.OnPlayer2TurnBegin += this.OnTurnBegin;
        }
        //Trigger new unit created.
        EventHandler_Gameplay.NewUnitCreated(this.gameObject, this.info.owningPlayer);
    }
Example #3
0
 public void KillUnit()
 {
     //Trigger unit death
     EventHandler_Gameplay.OnUnitDead(this.gameObject, this.info.owningPlayer);
 }