Exemplo n.º 1
0
        void EnemyHit()
        {
            EnemyHitEvent enemyHitEventInfo = new EnemyHitEvent();

            enemyHitEventInfo.Description = "Actor " + gameObject.name + " has hit something";
            enemyHitEventInfo.enemy_go    = gameObject;
            enemyHitEventInfo.FireEvent();
        }
Exemplo n.º 2
0
 // Use this for initialization
 void Start()
 {
     PlayerHitEvent.RegisterListener(OnPlayerHit);
     EnemyHitEvent.RegisterListener(OnEnemyHit);
     TileHitEvent.RegisterListener(OnTileHit);
 }
Exemplo n.º 3
0
 void OnEnemyHit(EnemyHitEvent enemyHit)
 {
     Debug.Log("I hear " + enemyHit.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 HitListener");
 }
Exemplo n.º 4
0
 void OnDestroy()
 {
     PlayerHitEvent.UnregisterListener(OnPlayerHit);
     EnemyHitEvent.UnregisterListener(OnEnemyHit);
     TileHitEvent.UnregisterListener(OnTileHit);
 }