using System.Collections.Generic; using BitStrap; using UnityEngine; public class EnviroSpawnManager : MonoBehaviour { public List enviroSpawnList = new List(); [Button] public void RegenerateAll() { if (enviroSpawnList.Count > 0) { for (int i = 0; i < enviroSpawnList.Count; i++) { enviroSpawnList[i].InstantiateNew(); } return; } EnviroSpawn_CS[] componentsInChildren = GetComponentsInChildren(); for (int j = 0; j < componentsInChildren.Length; j++) { componentsInChildren[j].InstantiateNew(); componentsInChildren[j].UpdateData(); componentsInChildren[j].UpdateData(); } } [Button] public void xxx() { } [Button] public void UpdateDataAll() { if (enviroSpawnList.Count > 0) { for (int i = 0; i < enviroSpawnList.Count; i++) { enviroSpawnList[i].UpdateData(); } return; } EnviroSpawn_CS[] componentsInChildren = GetComponentsInChildren(); for (int j = 0; j < componentsInChildren.Length; j++) { componentsInChildren[j].UpdateData(); } } }