/// <summary> /// <para>Cuando hay un item en el toggle</para> /// </summary> /// <param name="defineItem"></param> /// <param name="eType"></param> private void OnGUIDefineItemToggle(GlobalDefine defineItem, COMPILER eType) // Cuando hay un item en el toggle { GUIStyle togStyle = EditorStyles.miniButtonMid; if (eType == COMPILER.END) { togStyle = EditorStyles.miniButtonRight; } string name = "Unity"; if (eType == COMPILER.CSHARP) { name = "C#"; } else if (eType == COMPILER.CSHARP_EDITOR) { name = "C# editor"; } bool isEnabled = defineItem.IsEnabled(eType); GUI.backgroundColor = isEnabled ? Color.cyan : Color.white; bool newValue = GUILayout.Toggle(isEnabled, name, togStyle, GUILayout.Width(BUTTON_WIDTH)); if (newValue == isEnabled) { return; } defineItem.SetEnable(eType, newValue); SetSelectedDefine(defineItem); }
/// <summary> /// <para>Carga los RSP</para> /// </summary> /// <param name="compilerType"></param> private void CargarRspFile(COMPILER compilerType) // Carga los RSP { string path = RspFilePath(compilerType); if (!File.Exists(path)) { return; } string rspOption = File.ReadAllText(path); MatchCollection defineMatchs = Regex.Matches(rspOption, PATRON); foreach (Match match in defineMatchs) { Group group = match.Groups[NOMBRE_GRUPO]; foreach (Capture cap in group.Captures) { GlobalDefine define = GetData(cap.Value); if (define != null) { define.SetEnable(compilerType, true); } } } }