Cesium for Unity 1.15.2
Loading...
Searching...
No Matches
UnityLifetime.cs
Go to the documentation of this file.
1using UnityEngine;
2
3#if UNITY_EDITOR
4using UnityEditor;
5#endif
6
7namespace CesiumForUnity
8{
9 internal static class UnityLifetime
10 {
11 public static void Destroy(Object o)
12 {
13#if UNITY_EDITOR
14 // In the Editor, we must use DestroyImmediate because Destroy won't
15 // actually destroy the object.
16 if (!EditorApplication.isPlaying)
17 {
18 Object.DestroyImmediate(o);
19 return;
20 }
21#endif
22
23 Object.Destroy(o);
24 }
25 }
26
27}