// using TyphoonGUIStyle; // using UnityEditor; // using UnityEngine; // // namespace TyphoonPool // { // [CustomEditor(typeof(PoolObject), true)] // public class PoolObjectInspector : Editor // { // private const float INFO_TITLE_WIDTH = 120; // private PoolObject Target => target as PoolObject; // // private static GUIStyle _styleStatusOn = null; // // private static GUIStyle StyleStatusOn // { // get // { // if (_styleStatusOn == null) // { // _styleStatusOn = new GUIStyle(Styles.TitleBar); // _styleStatusOn.normal.textColor = // EditorGUIUtility.isProSkin ? Color.green : new Color(0f, 0.8f, 0f, 1f); // } // // return _styleStatusOn; // } // } // // public override void OnInspectorGUI() // { // if (EditorApplication.isPlaying) // { // if (!Target.IsValid) // { // GUILayout.Label(new GUIContent($"池对象未生效,未分配ID", Styles.IconInfo), Styles.HelpBox); // } // else // { // //绘制池对象信息 // GUILayout.BeginHorizontal(); // GUILayout.Label($"Object ID", Styles.TitleBar, GUILayout.Width(INFO_TITLE_WIDTH)); // GUILayout.TextArea(Target.ObjectID.ToString(), Styles.TitleBar); // GUILayout.EndHorizontal(); // GUILayout.BeginHorizontal(); // GUILayout.Label($"状态", Styles.TitleBar, GUILayout.Width(INFO_TITLE_WIDTH)); // var style = Target.IsBusy ? StyleStatusOn : Styles.TitleBar; // GUILayout.TextArea(Target.IsBusy ? "使用中" : "空闲", style); // GUILayout.EndHorizontal(); // GUILayout.BeginHorizontal(); // GUILayout.Label($"关联池", Styles.TitleBar, GUILayout.Width(INFO_TITLE_WIDTH)); // var pool = PoolManager.GetPool(Target.PoolID); // GUILayout.Label("", Styles.TitleBar); // var last = GUILayoutUtility.GetLastRect(); // EditorGUI.ObjectField(last, pool, typeof(Object)); // GUILayout.EndHorizontal(); // } // // // GUILayout.Space(5); // } // // base.OnInspectorGUI(); // Repaint(); // } // } // }