modify
This commit is contained in:
parent
3127057602
commit
e557479cc1
@ -5,6 +5,20 @@ namespace UnityEngine
|
||||
{
|
||||
public static class UnityEngageGameObjectExtension
|
||||
{
|
||||
public static void SafeDestroySelf(
|
||||
this Object obj)
|
||||
{
|
||||
if (obj == null) return;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying)
|
||||
Object.DestroyImmediate(obj);
|
||||
else
|
||||
Object.Destroy(obj);
|
||||
#else
|
||||
Object.Destroy(obj);
|
||||
#endif
|
||||
}
|
||||
private static readonly List<Transform> s_CachedTransforms = new List<Transform>();
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user