Example #1
0
        void PlayerHit()
        {
            PlayerHitEvent playerHitEventInfo = new PlayerHitEvent();

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