private void Title() { var versionAsset = Resources.Load <TextAsset>("VERSION"); EditorWindowUtils.TitleTexture(_bannerImage); if (versionAsset == null) { return; } if (centeredStyle == null) { centeredStyle = new GUIStyle(GUI.skin.label) { alignment = TextAnchor.MiddleCenter, fontSize = 16 }; } EditorWindowUtils.Space(5); EditorWindowUtils.Label(String.Format("Version: {0}", versionAsset.text), centeredStyle); if (pageNames == null) //use case: About Window is open while entering Play { Open(); } EditorWindowUtils.BeginHorizontalCenter(); EditorWindowUtils.Button(() => { GetWindow <LeiaRecommendedSettings>(true); }, "Leia Recommended Settings"); EditorWindowUtils.EndHorizontalCenter(); EditorWindowUtils.Space(10); _page = (Page)GUILayout.Toolbar((int)_page, pageNames); EditorWindowUtils.HorizontalLine(); EditorWindowUtils.Space(5); }
public void Display() { if (HorizontalLine) { EditorWindowUtils.HorizontalLine(); } EditorWindowUtils.BeginHorizontal(); EditorWindowUtils.Label(Title, Tooltip, true); EditorWindowUtils.FlexibleSpace(); EditorWindowUtils.Button(ButtonAction, ButtonLabel); EditorWindowUtils.EndHorizontal(); EditorWindowUtils.Space(5); GUILayout.Label(Decsription, EditorStyles.wordWrappedLabel); EditorWindowUtils.Space(5); }
static void EnumLogLevel(BuildTargetGroup grp) { EditorWindowUtils.Label(string.Format("{0} log level", grp), true); var defines = CompileDefineUtil.GetCompileDefinesWithPrefix(prefix, grp); LogLevel finalValue = LogLevel.Warning; foreach (var def in defines) { var enumValue = def.Substring(prefix.Length); finalValue = (LogLevel)System.Enum.Parse(typeof(LogLevel), enumValue, true); } var logLevel = (LogLevel)EditorWindowUtils.EnumPopup("Log Level", finalValue, GUILayout.Width(300)); if (logLevel != finalValue) { foreach (var def in defines) { CompileDefineUtil.RemoveCompileDefine(def, new[] { grp }); } CompileDefineUtil.AddCompileDefine(grp, string.Format("{0}{1}", prefix, logLevel).ToUpper(CultureInfo.InvariantCulture)); } }