コード例 #1
0
ファイル: TileLogic.cs プロジェクト: IndieRonin/Dark-Cave
        void TileAttack(MapSystem.Tile _tile)
        {
            TileAttackEvent tileAttackEventiInfo = new TileAttackEvent();

            tileAttackEventiInfo.Description = "Unit " + gameObject.name + " has just attacked";
            tileAttackEventiInfo.tile_go     = gameObject;
            tileAttackEventiInfo.FireEvent();
        }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     PlayerAttackEvent.RegisterListener(OnPlayerAttack);
     EnemyAttackEvent.RegisterListener(OnEnemyAttack);
     TileAttackEvent.RegisterListener(OnTileAttack);
 }
コード例 #3
0
 void OnTileAttack(TileAttackEvent tileAttack)
 {
     Debug.Log("I hear " + tileAttack.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 DamageListener");
 }
コード例 #4
0
 void OnDestroy()
 {
     PlayerAttackEvent.UnregisterListener(OnPlayerAttack);
     EnemyAttackEvent.UnregisterListener(OnEnemyAttack);
     TileAttackEvent.UnregisterListener(OnTileAttack);
 }