Пример #1
0
        void EnemyAttack()
        {
            EnemyAttackEvent enemyAttackEventiInfo = new EnemyAttackEvent();

            enemyAttackEventiInfo.Description = "Unit " + gameObject.name + " has just attacked";
            enemyAttackEventiInfo.enemy_go    = gameObject;
            enemyAttackEventiInfo.FireEvent();
        }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     PlayerAttackEvent.RegisterListener(OnPlayerAttack);
     EnemyAttackEvent.RegisterListener(OnEnemyAttack);
     TileAttackEvent.RegisterListener(OnTileAttack);
 }
Пример #3
0
 void OnEnemyAttack(EnemyAttackEvent enemyAttack)
 {
     Debug.Log("I hear " + enemyAttack.enemy_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");
 }
Пример #4
0
 void OnDestroy()
 {
     PlayerAttackEvent.UnregisterListener(OnPlayerAttack);
     EnemyAttackEvent.UnregisterListener(OnEnemyAttack);
     TileAttackEvent.UnregisterListener(OnTileAttack);
 }