コード例 #1
0
 private void CreateResetButton()
 {
     if (GUILayout.Button("Reset"))
     {
         DefineSymbolEditor.Initialize();
     }
 }
コード例 #2
0
 private void CreateSaveButton()
 {
     if (GUILayout.Button("Save"))
     {
         DefineSymbolEditor.Save();
     }
 }
コード例 #3
0
        private void CreateScriptingDefineSymbols()
        {
            GUILayout.Space(20);

            EditorGUILayout.LabelField("Current Scripting Define Symbols");
            EditorGUILayout.HelpBox(PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup), MessageType.None);

            GUILayout.Space(20);

            EditorGUILayout.LabelField("New Scripting Define Symbols");
            EditorGUILayout.HelpBox(DefineSymbolEditor.GetResult(), MessageType.None);
        }
コード例 #4
0
        private void CreateSymbolMenuParts(DefineSymbol symbol, int symbolIndex)
        {
            EditorGUILayout.BeginVertical(symbol.Enable ? GUI.skin.button : GUI.skin.textField);
            {
                EditorGUI.BeginChangeCheck();

                var isEnabled = symbol.Enable;

                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUI.BeginChangeCheck();
                    EditorGUILayout.LabelField("Enabled", GUILayout.Width(80));
                    isEnabled = EditorGUILayout.Toggle(isEnabled, GUILayout.Width(15));

                    if (symbolIndex < DefineSymbolEditor.DefineSymbols.Count)
                    {
                        GUILayout.FlexibleSpace();
                        if (GUILayout.Button("X", GUILayout.Width(20), GUILayout.Height(14)))
                        {
                            DefineSymbolEditor.Delete(symbolIndex);
                            return;
                        }
                    }
                }
                EditorGUILayout.EndHorizontal();

                var key = symbol.Key;
                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUILayout.LabelField("Key", GUILayout.Width(80));
                    key = GUILayout.TextField(key);
                }
                EditorGUILayout.EndHorizontal();

                var description = symbol.Description;
                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUILayout.LabelField("Description", GUILayout.Width(80));
                    description = GUILayout.TextField(description);
                }
                EditorGUILayout.EndHorizontal();

                if (EditorGUI.EndChangeCheck())
                {
                    DefineSymbolEditor.UpdateDefineSymbol(symbolIndex, key, description, isEnabled);
                }
            }
            EditorGUILayout.EndVertical();
        }
コード例 #5
0
 private void OnFocus()
 {
     DefineSymbolEditor.Initialize();
 }