﻿using UnityEngine;

namespace Entitas.Unity.VisualDebugging {
    
    public static class GameObjectDestroyExtension {

        public static void DestroyGameObject(this GameObject gameObject) {

            #if (UNITY_EDITOR)

            if (Application.isPlaying) {
                Object.Destroy(gameObject);
            } else {
                Object.DestroyImmediate(gameObject);
            }

            #else

        Destroy(gameObject);

            #endif
        }
    }
}

﻿using UnityEngine;

namespace Entitas.Unity.VisualDebugging {
    
    public static class GameObjectDestroyExtension {

        public static void DestroyGameObject(this GameObject gameObject) {

            #if (UNITY_EDITOR)

            if (Application.isPlaying) {
                Object.Destroy(gameObject);
            } else {
                Object.DestroyImmediate(gameObject);
            }

            #else

            Object.Destroy(gameObject);

            #endif
        }
    }
}

Fix Destroy compile time error
Fix Destroy compile time error

Project refused to build post upgrade to 0.30.0.

Error:
error CS0103: The name `Destroy' does not exist in the current context