forked from hunterzonewu/unity-decompiled
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMisc.cs
More file actions
35 lines (33 loc) · 967 Bytes
/
Misc.cs
File metadata and controls
35 lines (33 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// Decompiled with JetBrains decompiler
// Type: UnityEngine.UI.Misc
// Assembly: UnityEngine.UI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 2216A18B-AF52-44A5-85A0-A1CAA19C1090
// Assembly location: C:\Users\Blake\sandbox\unity\test-project\Library\UnityAssemblies\UnityEngine.UI.dll
namespace UnityEngine.UI
{
internal static class Misc
{
public static void Destroy(Object obj)
{
if (!(obj != (Object) null))
return;
if (Application.isPlaying)
{
if (obj is GameObject)
(obj as GameObject).transform.parent = (Transform) null;
Object.Destroy(obj);
}
else
Object.DestroyImmediate(obj);
}
public static void DestroyImmediate(Object obj)
{
if (!(obj != (Object) null))
return;
if (Application.isEditor)
Object.DestroyImmediate(obj);
else
Object.Destroy(obj);
}
}
}