//must be called OnGUIStart callback function public void OnGUIStart() { tab_menu.position = new Vector2(10, upper_border_margin + 10); tab_menu.tab_height = 40; tab_menu.tab_width = 150; tab_menu.spacing = 2; tab_menu.font_size = 25; tab_menu.draw_background = true; tab_menu.SetAlignment(TabMenu.TabMenuAlignment.VerticalDown); tab_menu.OnGUIStart(); ReCalculateRect(); LabelStyle = new GUIStyle(GUI.skin.label); LabelStyle.fontSize = 20; LabelStyle.fontStyle = FontStyle.Bold; LabelStyle.alignment = TextAnchor.MiddleLeft; LabelStyle.richText = true; WindowStyle = new GUIStyle(GUI.skin.window); WindowStyle.fontSize = 20; WindowStyle.fontStyle = FontStyle.BoldAndItalic; WindowStyle.alignment = TextAnchor.UpperCenter; WindowStyle.richText = true; ButtonStyle = new GUIStyle(GUI.skin.button); ButtonStyle.fontSize = 20; ButtonStyle.fontStyle = FontStyle.Bold; ButtonStyle.alignment = TextAnchor.MiddleLeft; default_alpha_value = GUI.color.a; }
private static void Initialize() { active_consoles = new refList <DebugConsole>(); tab_menu = new TabMenu(new string[5] { "InteractOff", "HalfAlpha", "GamePlay", "Input", "Misc" }, new string[5] { "InteractOn", "FullAlpha", "GamePlay", "Input", "Misc" }, TabCallback); tab_menu.position = new Vector2(180 + 10, Screen.height - 10); tab_menu.tab_height = 40; tab_menu.tab_width = 150; tab_menu.spacing = 2; tab_menu.font_size = 25; tab_menu.draw_background = false; tab_menu.SetAlignment(TabMenu.TabMenuAlignment.HorizontalRight); log_system_button_rect = new Rect(30, Screen.height - 50, 150, 40); DebugConsole.Size = new Vector2(400, 600); consoles = new DebugConsole[3]; consoles[0] = new DebugConsole("GamePlay"); consoles[1] = new DebugConsole("Input"); consoles[2] = new DebugConsole("Misc"); consoles[0].OnClose = delegate { consoles[0].IsActive = false; active_consoles.Remove(consoles[0], Comparer); RealignConsoles(); }; consoles[1].OnClose = delegate { consoles[1].IsActive = false; active_consoles.Remove(consoles[1], Comparer); RealignConsoles(); }; consoles[2].OnClose = delegate { consoles[2].IsActive = false; active_consoles.Remove(consoles[2], Comparer); RealignConsoles(); }; consoles[0].position.y = 20; consoles[1].position.y = 20; consoles[2].position.y = 20; isInitialized = true; }