Beispiel #1
0
 /// <summary>
 /// Makes all active gameobjects inactive.
 /// </summary>
 public void ClearLists()
 {
     for (int i = 0; i < ActiveProjectileList.Count(); i++)
     {
         RemoveActive.Add(ActiveProjectileList[i]);
     }
     for (int i = 0; i < ActiveClutterList.Count(); i++)
     {
         RemoveActive.Add(ActiveClutterList[i]);
     }
     for (int i = 0; i < ActiveEnvironmentList.Count(); i++)
     {
         RemoveActive.Add(ActiveEnvironmentList[i]);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Moves gameObjects from RemoveActive lists to inactive lists
        /// </summary>
        public void RemoveFromActive()
        {
            for (int i = 0; i < RemoveActive.Count(); i++)
            {
                GameObject go = RemoveActive[i];

                if (go.GetComponent <Clutter>() != null)
                {
                    InactiveClutterList.Add(go);
                    ActiveClutterList.Remove(go);
                }
                if (go.GetComponent <Projectile>() != null)
                {
                    InactiveProjectileList.Add(go);
                    ActiveProjectileList.Remove(go);
                }
                if (go.GetComponent <Environment>() != null)
                {
                    InactiveEnvironmentList.Add(go);
                    ActiveEnvironmentList.Remove(go);
                }
            }
            RemoveActive.Clear();
        }