using System.Collections; using System.Collections.Generic; using UnityEngine; public class Traps : MonoBehaviour { public List ConveyorBelts = new List(); public List CrushingBoulders = new List(); public List CubesWithCrystals = new List(); public List FloatingOnWater = new List(); public List InGroundTraps = new List(); public List ShootingCannons = new List(); private void Start() { ConveyorBelts.AddRange(GameObject.FindObjectsOfType()); CrushingBoulders.AddRange(GameObject.FindObjectsOfType()); CubesWithCrystals.AddRange(GameObject.FindObjectsOfType()); FloatingOnWater.AddRange(GameObject.FindObjectsOfType()); InGroundTraps.AddRange(GameObject.FindObjectsOfType()); ShootingCannons.AddRange(GameObject.FindObjectsOfType()); } public void environmentTurn() { if (ConveyorBelts.Count > 0) { foreach(ConveyorBelt belt in ConveyorBelts) { belt.Animate(); } } if (CrushingBoulders.Count > 0) { foreach (CrushingBoulder boulder in CrushingBoulders) { boulder.Animate(); } } if (ShootingCannons.Count > 0) { foreach (ShootingCannon cannon in ShootingCannons) { cannon.Animate(); } } } public void environmentRound() { if (CubesWithCrystals.Count > 0) { foreach (CubeWithCrystals crystal in CubesWithCrystals) { crystal.Animate(); } } if (FloatingOnWater.Count > 0) { foreach (FloatingOnWater water in FloatingOnWater) { water.Animate(); } } if (InGroundTraps.Count > 0) { foreach (InGroundTrap ground in InGroundTraps) { ground.Animate(); } } } }