Example #1
0
 public static void UndefineScriptingSymbols(BuildTargetGroup target, params string[] symbols)
 {
     foreach (var sym in symbols)
     {
         if (string.IsNullOrEmpty(sym))
         {
             continue;
         }
         XEditorUtility.SetScriptingSymbol(target, sym, false);
     }
 }
        void OnGUI()
        {
            EditorGUILayout.Separator();
            var target = (BuildTargetGroup)EditorGUILayout.EnumPopup("Build Target :", this.mBuildTarget);

            if (target != this.mBuildTarget)
            {
                EditorPrefs.SetInt("ProjectX.ScriptSymbols.BuildTarget", (int)target);
                this.mBuildTarget = target;
            }

            EditorGUILayout.Separator();
            this.mScrollViewForSymbols = EditorGUILayout.BeginScrollView(this.mScrollViewForSymbols);
            foreach (var symbol in XEditorUtility.GetScriptingSymbol(this.mBuildTarget))
            {
                EditorGUILayout.BeginHorizontal();
                GUILayout.TextField(symbol);
                if (GUILayout.Button("X", GUILayout.Width(30)))
                {
                    XEditorUtility.SetScriptingSymbol(this.mBuildTarget, symbol, false);
                }
                EditorGUILayout.EndHorizontal();
            }

            EditorGUILayout.BeginHorizontal();
            this.mNewSymbol = GUILayout.TextField(this.mNewSymbol);
            if (GUILayout.Button("+", GUILayout.Width(30)))
            {
                string symbol = this.mNewSymbol.Trim().ToUpper();
                if (symbol.Length > 0)
                {
                    XEditorUtility.SetScriptingSymbol(this.mBuildTarget, symbol, true);
                    this.mNewSymbol = "";
                }
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.EndScrollView();

            EditorGUILayout.Separator();
        }