asdf
This commit is contained in:
15
Assets/Scripts/ObjectRoot.cs
Normal file
15
Assets/Scripts/ObjectRoot.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class ObjectRoot : UnitySingleton<ObjectRoot>
|
||||
{
|
||||
public void ClearChildren(bool immediate = false)
|
||||
{
|
||||
DataManager.I.ResetModels();
|
||||
for (int i = transform.childCount - 1; i >= 0; i--)
|
||||
{
|
||||
var child = transform.GetChild(i).gameObject;
|
||||
|
||||
Destroy(child);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user