protected void OnEnable() { m_SearchClassFoldout = new PrefsValue <bool>("CreateAssetWindowm_SearchClassFoldout", false); m_SearchClass = new PrefsValue <string>("CreateAssetWindowm_m_SearchClass"); m_SearchResults = new List <string>(); m_AssemblyName = new PrefsValue <string>("CreateAssetWindow_AssemblyName", "Assembly-CSharp"); m_AssemblyNameFilter = new PrefsValue <string>("CreateAssetWindow_AssemblyNameFilter"); m_ClassName = new PrefsValue <string>("CreateAssetWindow_ClassName"); m_ClassNameFilter = new PrefsValue <string>("CreateAssetWindow_ClassNameFilter"); m_ClassNameBaseTypeFilter = new PrefsValue <string>("CreateAssetWindow_ClassNameBaseTypeFilter", "UnityEngine.ScriptableObject"); m_AssetDirection = new PrefsValue <string>("CreateAssetWindow_AssetDirection"); m_AssetFile = new PrefsValue <string>("CreateAssetWindow_AssetFile"); m_AssetCover = new PrefsValue <bool>("CreateAssetWindow_AssetCover"); Assembly[] assemblys = AppDomain.CurrentDomain.GetAssemblies(); m_AssemblyNames = new string[assemblys.Length]; for (int iAssembly = 0; iAssembly < assemblys.Length; iAssembly++) { m_AssemblyNames[iAssembly] = assemblys[iAssembly].GetName().Name; } m_ClassNames = new List <string>(); m_StringCahce = new List <string>(); }
public ShaderToolsSettingProvider(string path, SettingsScope scopes, IEnumerable <string> keywords = null) : base(path, scopes, keywords) { m_PreprocessShadersFoldout = new PrefsValue <bool>("FolderLinkSettingProvider m_PreprocessShadersFoldout"); m_PreprocessShadersForGUIs = new List <PreprocessShadersForGUI>(); LoadPreprocessShaders(); }
public ScriptingDefineSymbolSettingProvider(string path, SettingsScope scopes, IEnumerable <string> keywords = null) : base(path, scopes, keywords) { m_DefineGroupFoldout = new PrefsValue <bool>("ScriptingDefineSymbolSettingProvider m_DefineGroupFoldout"); m_OtherFoldout = new PrefsValue <bool>("ScriptingDefineSymbolSettingProvider m_OtherFoldout"); m_DefineGroups = new List <DefineGroup>(); DefineGroup gfDebugGroup = new DefineGroup("GF 调试"); m_DefineGroups.Add(gfDebugGroup); gfDebugGroup.Defines.Add(new DefineItem("Debug", "GF_DEBUG")); DefineGroup gfEditorLogGroup = new DefineGroup("GF Log(编辑器)"); m_DefineGroups.Add(gfEditorLogGroup); gfEditorLogGroup.Defines.Add(new DefineItem("Verbose", MDebug.LOG_VERBOSE_EDITOR_CONDITIONAL)); gfEditorLogGroup.Defines.Add(new DefineItem("Log", MDebug.LOG_EDITOR_CONDITIONAL)); gfEditorLogGroup.Defines.Add(new DefineItem("Warning", MDebug.LOG_WARNING_EDITOR_CONDITIONAL)); gfEditorLogGroup.Defines.Add(new DefineItem("Error", MDebug.LOG_ERROR_EDITOR_CONDITIONAL)); gfEditorLogGroup.Defines.Add(new DefineItem("Assert", MDebug.LOG_ASSERT_EDITOR_CONDITIONAL)); DefineGroup gfBuiltLogGroup = new DefineGroup("GF Log(打包后)"); m_DefineGroups.Add(gfBuiltLogGroup); gfBuiltLogGroup.Defines.Add(new DefineItem("Verbose", MDebug.LOG_VERBOSE_BUILT_CONDITIONAL)); gfBuiltLogGroup.Defines.Add(new DefineItem("Log", MDebug.LOG_BUILT_CONDITIONAL)); gfBuiltLogGroup.Defines.Add(new DefineItem("Warning", MDebug.LOG_WARNING_BUILT_CONDITIONAL)); gfBuiltLogGroup.Defines.Add(new DefineItem("Error", MDebug.LOG_ERROR_BUILT_CONDITIONAL)); gfBuiltLogGroup.Defines.Add(new DefineItem("Assert", MDebug.LOG_ASSERT_BUILT_CONDITIONAL)); RefreshDefine(); }
public TextEditor(string name) { Foldout = new PrefsValue <bool>($"OpenAssetSetting {name} Foldout", false); ChangeSetting = new PrefsValue <bool>($"OpenAssetSetting {name} ChangeSetting", false); Path = new PrefsValue <string>($"OpenAssetSetting {name} Path", string.Empty); Arguments = new PrefsValue <string>($"OpenAssetSetting {name} Arguments", string.Empty); }
static OpenAssetSetting() { s_EnableCustomTextEditor = new PrefsValue <bool>("OpenAssetSetting s_EnableCustomTextEditor", false); s_LuaEditor = new TextEditor("Lua"); s_CSharpEditor = new TextEditor("CSharp"); s_DefaultEditor = new TextEditor("Default"); }
public ShaderTab() : base() { m_GlobalKeywords = new List <KeywordItem>(); m_AutoRefreshKeyword = new PrefsValue <bool>("ShaderTab m_AutoRefreshKeyword"); m_OnlyDisplayEnabledKeyword = new PrefsValue <bool>("ShaderTab m_OnlyDisplayEnabledKeyword"); }
public Tab(string tabName, Action <IGUIDrawer> doGUIAction, bool onlyRuntime) { TabName = tabName; DoGUIAction = doGUIAction; OnlyRuntime = onlyRuntime; Foldout = new PrefsValue <bool>("EditorDebugPanel Tab Foldout " + tabName); }
private LogItems() { m_LogItems = new BetterQueue <LogItem>(MAX_LOG_COUNT + 1); _Clear(); m_ShowTimestamp = new PrefsValue <bool>("LogItems_m_ShowTimestamp", false); m_ShowFrameCount = new PrefsValue <bool>("LogItems_m_ShowFrameCount", false); m_ShowLogId = new PrefsValue <bool>("LogItems_m_ShowLogId", false); }
protected void OnEnable() { m_WindowId = 0; while (true) { bool has = false; for (int iConsole = 0; iConsole < ms_LogConsoleWindows.Count; iConsole++) { if (ms_LogConsoleWindows[iConsole].GetWindowId() == m_WindowId) { has = true; break; } } if (!has) { break; } m_WindowId++; } ms_LogConsoleWindows.Add(this); LogItems.GetInstance(); titleContent.text = "Console " + m_WindowId; m_SplitterState = UnityEditorReflectionUtility.SplitterGUILayout.CreateSplitterState(new float[] { 70, 30 }, new int[] { 32, 32 }, null); m_LogItemHashs = new HashSet <string>(); m_LogTagFilters = new HashSet <string>(); m_LogTagFilters = new HashSet <string>(); m_FilteredLogIds = new List <int>(); m_SelectedLogId = NOT_SET_LOGITEM_ID; m_LastSelectedLogId = NOT_SET_LOGITEM_ID; m_Collapse = new PrefsValue <bool>("LogConsoleWindow_m_Collapse" + m_WindowId, false); m_LogTypeFlagFilter = new PrefsValue <int>("LogConsoleWindow_m_LogTypeFlagFilter" + m_WindowId, int.MaxValue); m_LogTagFilter = new PrefsValue <string>("LogConsoleWindow_m_LogTagFilter" + m_WindowId, string.Empty); m_FocusLastLog = new PrefsValue <bool>("LogConsoleWindow_m_FocusLastLog" + m_WindowId, false); m_LogTextFilter = new PrefsValue <string>("LogConsoleWindow_m_LogTextFilter" + m_WindowId, string.Empty); m_FilterModified = true; m_LastFilterLogId = 0; CaculateLogTags(); m_TextWithHyperlinks = new System.Text.StringBuilder(); UnityEditorReflectionUtility.EditorGUI.Remove_HyperLinkClicked(OnHyperLinkClicked); UnityEditorReflectionUtility.EditorGUI.Add_HyperLinkClicked(OnHyperLinkClicked); }
public FolderLinkSettingProvider(string path, SettingsScope scopes, IEnumerable <string> keywords = null) : base(path, scopes, keywords) { m_SettingFoldout = new PrefsValue <bool>("FolderLinkSettingProvider m_SettingFoldout"); m_LinkFoldout = new PrefsValue <bool>("FolderLinkSettingProvider m_LinkFoldout"); m_ItemsForGUI = ScriptableObject.CreateInstance <ItemsForGUI>(); m_ItemsForGUI.Items = FolderLinkSetting.GetInstance().Items.ToList(); m_SO_Items = new SerializedObject(m_ItemsForGUI); m_SP_Items = m_SO_Items.FindProperty("Items"); m_Items = new List <Item>(); RegenerateItems(); }
protected void OnEnable() { m_EditStyle = new PrefsValue <bool>("EditorDebugPanel m_EditStyle"); m_Tabs = new List <Tab>(); RegistGUI("Debug Panel", DoGUI_DebugPanel, false); EditorApplication.playModeStateChanged += OnPlayModeStateChanged; if (DebugPanelInstance._ms_Instance == null || !DebugPanelInstance._ms_Instance.Equals(this)) { DebugPanelInstance._ms_Instance = this; DebugPanelInstance.RegistStartupTabs(); } }
public EditorGUIDrawer() { m_NormalTextColor = new PrefsValue <Color>("EditorGUIDrawer m_NormalTextColor", new Color(172.0f / 255.0f, 172.0f / 255.0f, 172.0f / 255.0f, 255.0f / 255.0f)); m_ImportantTextColor = new PrefsValue <Color>("EditorGUIDrawer m_ImportantTextColor", Color.green); m_WarningTextColor = new PrefsValue <Color>("EditorGUIDrawer m_WarningTextColor", Color.red); m_LabelStyle = new GUIStyle(GUI.skin.label); m_ImportantLabelStyle = new GUIStyle(GUI.skin.label); m_WarningLabelStyle = new GUIStyle(GUI.skin.label); m_BoxStyle = new GUIStyle(GUI.skin.box); m_BoxStyle.alignment = TextAnchor.MiddleLeft; m_ImportantBoxStyle = new GUIStyle(GUI.skin.box); m_ImportantBoxStyle.alignment = TextAnchor.MiddleLeft; m_WarningBoxStyle = new GUIStyle(GUI.skin.box); m_WarningBoxStyle.alignment = TextAnchor.MiddleLeft; UpdateGUIStyle(); }
private void PopupItem(string label, ref PrefsValue <string> value, string[] strs, ref PrefsValue <string> filter) { filter.Set(EditorGUILayout.TextField("筛选", filter.Get())); if (!string.IsNullOrEmpty(filter)) { m_StringCahce.Clear(); for (int i = 0; i < strs.Length; i++) { if (strs[i].ToLower().Contains(filter.Get().ToLower())) { m_StringCahce.Add(strs[i]); } } strs = m_StringCahce.ToArray(); } if (strs.Length < 1) { value.Set(""); } else { int selectIdx = 0; if (value.Get() == null || value.Get().Length < 1 || Array.IndexOf(strs, value.Get()) < 0) { selectIdx = EditorGUILayout.Popup(label, 0, strs); } else { selectIdx = EditorGUILayout.Popup(label, Array.IndexOf <string>(strs, value.Get()), strs); } if (selectIdx >= strs.Length) { selectIdx = 0; } value.Set(strs[selectIdx]); } }
public DefineGroup(string name) { Name = name; Foldout = new PrefsValue <bool>("ScriptingDefineSymbolSettingProvider DefineGroup " + name); }