三国卡牌客户端基础资源仓库
hch
2025-06-24 7f957ecb475adb30eb692884d22412b765fa1a7d
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
using UnityEngine;
using UnityEditor;
 
[CustomEditor(typeof(UIBase), true)]
public class UIBaseInspector : Editor
{
    SerializedProperty uiLayer;
    SerializedProperty uiName;
    SerializedProperty isMainUI;
    SerializedProperty supportParentChildRelation;
    SerializedProperty isPersistent;
    SerializedProperty maxIdleRounds;
 
    // 动画相关
    SerializedProperty openAnimationType;
    SerializedProperty closeAnimationType;
    SerializedProperty animeRoot;
    SerializedProperty animeDuration;
    SerializedProperty scaleOverInOutCurve;
    SerializedProperty animationEase;
 
    SerializedProperty openMask;
    SerializedProperty clickEmptySpaceClose;
 
    void OnEnable()
    {
        uiLayer = serializedObject.FindProperty("uiLayer");
        uiName = serializedObject.FindProperty("uiName");
        isMainUI = serializedObject.FindProperty("isMainUI");
        supportParentChildRelation = serializedObject.FindProperty("supportParentChildRelation");
        isPersistent = serializedObject.FindProperty("isPersistent");
        maxIdleRounds = serializedObject.FindProperty("maxIdleRounds");
 
        openAnimationType = serializedObject.FindProperty("openAnimationType");
        closeAnimationType = serializedObject.FindProperty("closeAnimationType");
        animeRoot = serializedObject.FindProperty("_rectTransform");
        animeDuration = serializedObject.FindProperty("animeDuration");
        scaleOverInOutCurve = serializedObject.FindProperty("scaleOverInOutCurve");
        animationEase = serializedObject.FindProperty("animationEase");
 
        openMask = serializedObject.FindProperty("openMask");
        clickEmptySpaceClose = serializedObject.FindProperty("clickEmptySpaceClose");
    }
 
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        // serializedObject.Update();
 
        // EditorGUILayout.PropertyField(uiLayer);
        // EditorGUILayout.PropertyField(uiName);
        // EditorGUILayout.PropertyField(isMainUI);
        // EditorGUILayout.PropertyField(supportParentChildRelation);
 
        // EditorGUILayout.Space();
        // EditorGUILayout.LabelField("持久化设置", EditorStyles.boldLabel);
        // EditorGUILayout.PropertyField(isPersistent);
        // if (isPersistent.boolValue)
        // {
        //     EditorGUI.indentLevel++;
        //     EditorGUILayout.PropertyField(maxIdleRounds);
        //     EditorGUI.indentLevel--;
        // }
 
        // EditorGUILayout.Space();
        // EditorGUILayout.LabelField("动画设置", EditorStyles.boldLabel);
        // EditorGUILayout.PropertyField(openAnimationType);
        // EditorGUILayout.PropertyField(closeAnimationType);
        // EditorGUILayout.PropertyField(animeRoot, new GUIContent("animeRoot (动画根节点)"));
        // if (openAnimationType.enumValueIndex != 0 || closeAnimationType.enumValueIndex != 0)
        // {
        //     EditorGUI.indentLevel++;
        //     EditorGUILayout.PropertyField(animeDuration);
        //     if ((UIAnimationType)openAnimationType.enumValueIndex == UIAnimationType.ScaleOverInOut)
        //     {
        //         EditorGUILayout.PropertyField(scaleOverInOutCurve);
        //     }
        //     EditorGUILayout.PropertyField(animationEase);
        //     EditorGUI.indentLevel--;
        // }
        // // 动画生效提示
        // if ((openAnimationType.enumValueIndex != 0 || closeAnimationType.enumValueIndex != 0) && animeRoot.objectReferenceValue == null)
        // {
        //     EditorGUILayout.HelpBox("如需动画生效,必须指定 animeRoot(动画根节点)!", MessageType.Warning);
        // }
 
        // EditorGUILayout.Space();
        // EditorGUILayout.LabelField("遮罩设置", EditorStyles.boldLabel);
 
        // EditorGUILayout.BeginHorizontal();
 
        // EditorGUILayout.PropertyField(openMask);
        // EditorGUILayout.PropertyField(clickEmptySpaceClose);
        // EditorGUI.BeginChangeCheck();
        // openMask.boolValue = GUILayout.Toggle(openMask.boolValue, "开启遮罩", EditorStyles.miniButtonLeft);
        // clickEmptySpaceClose.boolValue = GUILayout.Toggle(clickEmptySpaceClose.boolValue, "点击空白关闭", EditorStyles.miniButtonRight);
        // if (EditorGUI.EndChangeCheck())
        // {
        //     if (tempOpenMask && tempClickEmptyClose)
        //     {
        //         if (openMask.boolValue != tempOpenMask)
        //         {
        //             clickEmptySpaceClose.boolValue = false;
        //             openMask.boolValue = true;
        //         }
        //         else
        //         {
        //             openMask.boolValue = false;
        //             clickEmptySpaceClose.boolValue = true;
        //         }
        //     }
        //     else
        //     {
        //         openMask.boolValue = tempOpenMask;
        //         clickEmptySpaceClose.boolValue = tempClickEmptyClose;
        //     }
        // }
        // EditorGUILayout.EndHorizontal();
 
        // serializedObject.ApplyModifiedProperties();
    }
}