using UnityEditor; namespace Axibug.Editor { /// /// 游戏框架 Inspector 抽象类。 /// public abstract class GameInspector : UnityEditor.Editor { private bool m_IsCompiling = false; /// /// 绘制事件。 /// public override void OnInspectorGUI() { if (m_IsCompiling && !EditorApplication.isCompiling) { m_IsCompiling = false; OnCompileComplete(); } else if (!m_IsCompiling && EditorApplication.isCompiling) { m_IsCompiling = true; OnCompileStart(); } } /// /// 编译开始事件。 /// protected virtual void OnCompileStart() { } /// /// 编译完成事件。 /// protected virtual void OnCompileComplete() { } protected bool IsPrefabInHierarchy(UnityEngine.Object obj) { if (obj == null) { return false; } return PrefabUtility.GetPrefabAssetType(obj) != PrefabAssetType.Regular; } } }