public void Draw(EntitasPreferencesConfig config)
        {
            EditorGUI.BeginChangeCheck();
            {
                EntitasEditorLayout.BeginVerticalBox();
                {
                    EditorGUILayout.LabelField("Entitas", EditorStyles.boldLabel);

                    _scriptCallOptimization = (ScriptCallOptimization)EditorGUILayout
                                              .EnumPopup("Optimizations", _scriptCallOptimization);
                }
                EntitasEditorLayout.EndVertical();
            }
            var changed = EditorGUI.EndChangeCheck();

            if (changed)
            {
                if (_scriptCallOptimization == ScriptCallOptimization.Disabled)
                {
                    _scriptingDefineSymbols.RemoveDefineSymbol(ENTITAS_FAST_AND_UNSAFE);
                }
                else
                {
                    _scriptingDefineSymbols.AddDefineSymbol(ENTITAS_FAST_AND_UNSAFE);
                }
            }
        }
Ejemplo n.º 2
0
        protected override void drawContent(EntitasPreferencesConfig config)
        {
            EditorGUILayout.BeginHorizontal();
            {
                EditorGUILayout.LabelField("Optimizations");
                var buttonStyle = new GUIStyle(EditorStyles.miniButtonLeft);
                if (_scriptCallOptimization == ScriptCallOptimization.Disabled)
                {
                    buttonStyle.normal = buttonStyle.active;
                }
                if (GUILayout.Button("Disabled", buttonStyle))
                {
                    _scriptCallOptimization = ScriptCallOptimization.Disabled;
                    _scriptingDefineSymbols.RemoveDefineSymbol(ENTITAS_FAST_AND_UNSAFE);
                }

                buttonStyle = new GUIStyle(EditorStyles.miniButtonRight);
                if (_scriptCallOptimization == ScriptCallOptimization.FastAndUnsafe)
                {
                    buttonStyle.normal = buttonStyle.active;
                }
                if (GUILayout.Button("Fast And Unsafe", buttonStyle))
                {
                    _scriptCallOptimization = ScriptCallOptimization.FastAndUnsafe;
                    _scriptingDefineSymbols.AddDefineSymbol(ENTITAS_FAST_AND_UNSAFE);
                }
            }
            EditorGUILayout.EndHorizontal();
        }
Ejemplo n.º 3
0
 public void Initialize(EntitasPreferencesConfig config) {
     _scriptingDefineSymbols = new ScriptingDefineSymbols();
     _scriptCallOptimization = _scriptingDefineSymbols.buildTargetToDefSymbol.Values
                                     .All<string>(defs => defs.Contains(ENTITAS_FAST_AND_UNSAFE))
                                         ? ScriptCallOptimization.FastAndUnsafe
                                         : ScriptCallOptimization.Disabled;
 }
 public void Initialize(EntitasPreferencesConfig config)
 {
     _scriptingDefineSymbols = new ScriptingDefineSymbols();
     _scriptCallOptimization = _scriptingDefineSymbols.buildTargetToDefSymbol.Values
                               .All <string>(defs => defs.Contains(ENTITAS_FAST_AND_UNSAFE))
                                         ? ScriptCallOptimization.FastAndUnsafe
                                         : ScriptCallOptimization.Disabled;
 }
Ejemplo n.º 5
0
        public void Draw(EntitasPreferencesConfig config) {
            EditorGUI.BeginChangeCheck();
            {
                EditorGUILayout.BeginVertical(GUI.skin.box);
                {
                    EditorGUILayout.LabelField("Entitas", EditorStyles.boldLabel);

                    _scriptCallOptimization = (ScriptCallOptimization)EditorGUILayout
                        .EnumPopup("Script Call Optimization", _scriptCallOptimization);
                }
                EditorGUILayout.EndVertical();
            }
            var changed = EditorGUI.EndChangeCheck();

            if (changed) {
                if (_scriptCallOptimization == ScriptCallOptimization.Disabled) {
                    _scriptingDefineSymbols.RemoveDefineSymbol(ENTITAS_FAST_AND_UNSAFE);
                } else {
                    _scriptingDefineSymbols.AddDefineSymbol(ENTITAS_FAST_AND_UNSAFE);
                }
            }
        }