52 lines
1.1 KiB
C#
52 lines
1.1 KiB
C#
using System.Collections.Generic;
|
|
using BitStrap;
|
|
using UnityEngine;
|
|
|
|
public class EnviroSpawnManager : MonoBehaviour
|
|
{
|
|
public List<EnviroSpawn_CS> enviroSpawnList = new List<EnviroSpawn_CS>();
|
|
|
|
[Button]
|
|
public void RegenerateAll()
|
|
{
|
|
if (enviroSpawnList.Count > 0)
|
|
{
|
|
for (int i = 0; i < enviroSpawnList.Count; i++)
|
|
{
|
|
enviroSpawnList[i].InstantiateNew();
|
|
}
|
|
return;
|
|
}
|
|
EnviroSpawn_CS[] componentsInChildren = GetComponentsInChildren<EnviroSpawn_CS>();
|
|
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<EnviroSpawn_CS>();
|
|
for (int j = 0; j < componentsInChildren.Length; j++)
|
|
{
|
|
componentsInChildren[j].UpdateData();
|
|
}
|
|
}
|
|
}
|