Beispiel #1
0
        void TileHit(MapSystem.Tile _tile)
        {
            TileHitEvent tileHitEventInfo = new TileHitEvent();

            tileHitEventInfo.Description = "Actor " + gameObject.name + " has hit something";
            tileHitEventInfo.tile_go     = gameObject;
            tileHitEventInfo.FireEvent();
        }
Beispiel #2
0
 // Use this for initialization
 void Start()
 {
     PlayerHitEvent.RegisterListener(OnPlayerHit);
     EnemyHitEvent.RegisterListener(OnEnemyHit);
     TileHitEvent.RegisterListener(OnTileHit);
 }
Beispiel #3
0
 void OnTileHit(TileHitEvent tileHit)
 {
     Debug.Log("I hear " + tileHit.tile_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");
 }
Beispiel #4
0
 void OnDestroy()
 {
     PlayerHitEvent.UnregisterListener(OnPlayerHit);
     EnemyHitEvent.UnregisterListener(OnEnemyHit);
     TileHitEvent.UnregisterListener(OnTileHit);
 }