Project_WL/Assets/Script/Mgr/MobControlMgrList.cs

30 lines
852 B
C#

using System.Collections;
public class MobControlMgrList : MonoBehaviourSingletonTemplate<MobControlMgrList>
{
IEnumerator Start()
{
var mobloads = GetComponentsInChildren<MobControlMgr>();
// 모든 mobloads가 로드 완료될 때까지 대기
while (true)
{
bool allLoaded = true;
for (int i = 0; i < mobloads.Length; i++)
{
if (!mobloads[i].Get_LoadComplete())
{
allLoaded = false;
break; // 하나라도 로드 안 됐으면 루프 종료
}
}
if (allLoaded) break; // 모든 로드 완료 시 while 루프 탈출
yield return null; // 다음 프레임까지 대기
}
if (LoadingUI.isIns) LoadingUI.Ins.End_Loading(0);
}
}