示例#1
0
        void TakeDamage(MapSystem.Tile _tile)
        {
            TileDamageEvent tileDamageEventInfo = new TileDamageEvent();


            tileDamageEventInfo.Description = "Actorr] " + gameObject.name + " has taken damage.";
            tileDamageEventInfo.tile_go     = gameObject;
            tileDamageEventInfo.FireEvent();
        }
示例#2
0
 void OnTileDamaged(TileDamageEvent tileDamage)
 {
     Debug.Log("I hear " + tileDamage.tile_go.name + " has taken damage - Report from the DamageListener");
 }
示例#3
0
 // Use this for initialization
 void Start()
 {
     PlayerDamageEvent.RegisterListener(OnPlayerDamaged);
     EnemyDamageEvent.RegisterListener(OnEnemyDamaged);
     TileDamageEvent.RegisterListener(OnTileDamaged);
 }
示例#4
0
 void OnDestroy()
 {
     PlayerDamageEvent.UnregisterListener(OnPlayerDamaged);
     EnemyDamageEvent.UnregisterListener(OnEnemyDamaged);
     TileDamageEvent.UnregisterListener(OnTileDamaged);
 }