Пример #1
0
 private void Start()
 {
     goodTVs = new List <TV>();
     evilTVs = new List <TV>();
     // initialize goodTVs and evilTVs lists
     foreach (GameObject g in GameObject.FindGameObjectsWithTag("TV"))
     {
         TV tv = g.GetComponent <TV>();
         if (tv.Evil())
         {
             evilTVs.Add(tv);
             allTVs.Add(tv);
         }
         else
         {
             goodTVs.Add(tv);
             allTVs.Add(tv);
         }
     }
     TVsRemaining = goodTVs.Count;
 }