Beispiel #1
0
 private void EventHandlerEnemyDeath_OnEventPublished(EnemyDeathData data)
 {
     if (text.text == "")
     {
         ShowText(data);
     }
     else
     {
         textBuffer.Add(data);
     }
 }
Beispiel #2
0
 private void EventHandlerEnemyDeath_OnEventPublished(EnemyDeathData data)
 {
     --numbOfEnemies;
     if (numbOfEnemies <= 1 && gameIsFinish == false)
     {
         gameIsFinish = true;
         string winnerName = null;
         for (int i = 0; i < enemyObjects.Length; ++i)
         {
             if (enemyObjects[i] != null)
             {
                 string enemyName = enemyObjects[i].name;
                 if (enemyName != data.name)
                 {
                     winnerName = enemyName;
                     break;
                 }
             }
         }
         eventHandlerVictory.Publish(new VictoryData(winnerName));
     }
 }
Beispiel #3
0
 private void ShowText(EnemyDeathData data)
 {
     text.text = data.killerName + " killed " + data.name + ".";
     StartCoroutine("ClearText");
 }