示例#1
0
 void OnEnable()
 {
     if (infoDisplay != null)
     {
         infoDisplay.DisplayScore(PlayerController.PlayerScore);
     }
 }
示例#2
0
    // FixedUpdate is called once per physics frame
    void FixedUpdate()
    {
        foreach (var entry in activeEnemies)
        {
            GameObject enemy = entry.Key;
            if (!enemy.activeSelf)
            {
                int points = (int)entry.Value;
                PlayerController.PlayerScore += points;
                infoDisplay.DisplayScore(PlayerController.PlayerScore);

                activeEnemies.Remove(enemy);
                Destroy(enemy.gameObject);
            }
        }

        if (activeEnemies.Count == 0)
        {
            StartNextWave();
        }
    }