ball testing

This commit is contained in:
2024-10-13 16:13:44 +05:30
parent 7822aec907
commit a9f605b732
39 changed files with 28126 additions and 576 deletions

View File

@@ -0,0 +1,36 @@
using UnityEngine;
public static class CustomExtensions{
public static void PurgeChildren(this Transform parent){
foreach(Transform child in parent.GetComponentsInChildren<Transform>()){
if(child == parent){continue;}
SmartDestroy(child.gameObject);
}
}
public static void PurgeChildrenEdit(this Transform parent){
for (int i = parent.transform.childCount; i > 0; --i)
GameObject.DestroyImmediate(parent.GetChild(0).gameObject);
}
public static void SmartDestroy(UnityEngine.Object obj)
{
if (obj == null)
{
return;
}
#if UNITY_EDITOR
if (!Application.isPlaying)
{
GameObject.DestroyImmediate(obj);
}
else
#endif
{
GameObject.Destroy(obj);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 677d3c8524a47b1498d6d5d4013fbc43
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: