Exemple #1
0
        void PlayerAttack()
        {
            PlayerAttackEvent playerAttackEventiInfo = new PlayerAttackEvent();

            playerAttackEventiInfo.Description = "Unit " + gameObject.name + " has just attacked";
            playerAttackEventiInfo.player_go   = gameObject;
            playerAttackEventiInfo.FireEvent();
        }
Exemple #2
0
 // Use this for initialization
 void Start()
 {
     PlayerAttackEvent.RegisterListener(OnPlayerAttack);
     EnemyAttackEvent.RegisterListener(OnEnemyAttack);
     TileAttackEvent.RegisterListener(OnTileAttack);
 }
Exemple #3
0
 void OnPlayerAttack(PlayerAttackEvent playerAttack)
 {
     Debug.Log("I hear " + playerAttack.player_go.name + " has taken damage, that is to bad, but at least we know the Event cb system is working fine now - Report from the DamageListener");
 }
Exemple #4
0
 void OnDestroy()
 {
     PlayerAttackEvent.UnregisterListener(OnPlayerAttack);
     EnemyAttackEvent.UnregisterListener(OnEnemyAttack);
     TileAttackEvent.UnregisterListener(OnTileAttack);
 }