//---------------------------------------------------------- // Unity callbacks //---------------------------------------------------------- void Awake() { mInstance = this; awakeFrame = Time.frameCount; chatHistoryBuffer = 40; outerBuffer = 50; chatPanelPosX = Screen.width - chatPanelWidth - outerBuffer; chatPanelPosY = Screen.height - chatPanelHeight - outerBuffer; userListPanelWidth = chatPanelWidth * 3 / 10; chatWindowRect = new Rect(chatPanelPosX, chatPanelPosY, chatPanelWidth, chatPanelHeight); teleGui = this.gameObject.AddComponent <TeleportGUI>(); consoleGui = this.gameObject.AddComponent <ConsoleGUI>(); customizeAvatarGui = this.gameObject.AddComponent <CustomizeAvatarGUI>(); userListMgr = this.gameObject.AddComponent <HTMLUserListManager>(); replayGUI = this.gameObject.AddComponent <ReplayGUI>(); devGUI = this.gameObject.AddComponent <DevGUI>(); DevGUIEnabled = false; // Load dynamic console input TextField textures. consoleBGStretchable = Resources.Load("Textures/UnityNativeGUI/TextWindow_Middle") as Texture2D; consoleBGEndCap = Resources.Load("Textures/UnityNativeGUI/TextWindow_EndCap") as Texture2D; // Load presenter tool textures presentToolResizeButton = new VirCustomButton(Resources.Load("Textures/UnityNativeGUI/PresentTool_Resize") as Texture2D, 0, 0, 1.2f, "Resize"); presentToolCloseButton = new VirCustomButton(Resources.Load("Textures/UnityNativeGUI/Button_ChatMin_Active") as Texture2D, 0, 0, 1.2f, "Minimize"); consoleBackgroundTex = Resources.Load("Textures/UnityNativeGUI/ConsoleBackground") as Texture2D; // Set up viewport buttons productViewportResizeButton = new VirCustomButton(Resources.Load("Textures/UnityNativeGUI/PresentTool_Resize") as Texture2D, 0, 0, 1.2f, "Resize"); productViewportCloseButton = new VirCustomButton(Resources.Load("Textures/UnityNativeGUI/Button_ChatMin_Active") as Texture2D, 0, 0, 1.2f, "Minimize"); // Presenter tool defaults to off. allowPresenterTool = false; // Resize viewport if necessary if (!Screen.fullScreen && Screen.height >= (Screen.currentResolution.height - 40)) { Screen.SetResolution((int)(0.85 * Screen.width), (int)(0.85 * Screen.height), Screen.fullScreen); } // Omnibox obTLCorner = Resources.Load("Textures/UnityNativeGUI/omnibox/top_left_corner") as Texture2D; obTEdge = Resources.Load("Textures/UnityNativeGUI/omnibox/top_edge") as Texture2D; obLEdge = Resources.Load("Textures/UnityNativeGUI/omnibox/left_edge") as Texture2D; obFill = Resources.Load("Textures/UnityNativeGUI/omnibox/fill") as Texture2D; // Fadeout texture whiteTex = Resources.Load("Textures/white") as Texture2D; // Turn off all native gui for assembly if (GameManager.Inst.ServerConfig == "Assembly" || GameManager.Inst.ServerConfig == "MDONS") { GameGUI.Inst.Visible = false; } }
void Start() { Inst = this; DontDestroyOnLoad(this); timeleft = updateInterval; }
static void LogChanged() { bool HasLogs = (TimedLogs.Count != 0 || NamedLogs.Count != 0 || CriticalErrors.Count != 0 || GizmoInstances.Count != 0); if (Instance == null) { if (HasLogs) { var go = new GameObject("[DevLogScreen]"); Instance = go.AddComponent <DevGUI>(); } } else { if (!HasLogs) { GameObject.Destroy(Instance.gameObject); Instance = null; } } }