少年修仙传客户端基础资源
dabaoji
2023-11-13 0a23e1b83f8fda8ab9f9e32fe71c26c431faf63a
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
using UnityEngine;
using UnityEditor;
using qtools.qhierarchy.pdata;
 
namespace qtools.qhierarchy.phelper
{
    [CustomEditor(typeof(QObjectList))]
    public class QObjectListInspector : Editor
    {
        public override void OnInspectorGUI()
        {
            EditorGUILayout.HelpBox("\nThis is an auto created GameObject that managed by QHierarchy.\n\n" + 
                                    "It stores references to some GameObjects in the current scene. This object will not be included in the application build.\n\n" + 
                                    "You can safely remove it, but lock / unlock / visible / etc. states will be reset. Delete this object if you want to remove the QHierarchy.\n\n" +
                                    "This object can be hidden if you uncheck \"Show QHierarchy GameObject\" in the settings of the QHierarchy.\n"
                                    , MessageType.Info, true);
 
            if (QSettings.getInstance().get<bool>(QSetting.ShowObjectListContent))
            {
                if (GUI.Button(EditorGUILayout.GetControlRect(GUILayout.ExpandWidth(true), GUILayout.Height(20)), "Hide content"))
                {
                    QSettings.getInstance().set(QSetting.ShowObjectListContent, false);
                }
                base.OnInspectorGUI();
            }
            else
            {
                if (GUI.Button(EditorGUILayout.GetControlRect(GUILayout.ExpandWidth(true), GUILayout.Height(20)), "Show content"))
                {
                    QSettings.getInstance().set(QSetting.ShowObjectListContent, true);
                }
            }
        }
    }
}