//---------------------------------------------------------- // 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() { mainGUI = GetComponent <ReplayGUI>(); }
public override void OptionsPane(Rect layoutRect) { if (mainGUI == null) { mainGUI = GetComponent<ReplayGUI>(); } GUILayout.BeginArea(layoutRect); scrollPos = GUILayout.BeginScrollView(scrollPos); GUILayout.BeginVertical(); GUILayout.Label("Action Filtering"); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); int removeDex = -1; for (int i = 0; i < skipActionTypes.Count; i++) { GUILayout.BeginHorizontal(); if (GUILayout.Button("-", GUILayout.Width(charButtonWidth), GUILayout.Height(mainGUI.standardButtonHeight))) { removeDex = i; } skipActionTypes[i] = GUILayout.TextField(skipActionTypes[i],GUILayout.Width(mainGUI.standardButtonWidth*2),GUILayout.Height(mainGUI.standardButtonHeight)); GUILayout.EndHorizontal(); } if(removeDex >= 0) { skipActionTypes.RemoveAt(removeDex); } GUILayout.Space(mainGUI.standardButtonHeight/2); GUILayout.BeginHorizontal(); if(GUILayout.Button("+", GUILayout.Width(charButtonWidth), GUILayout.Height(mainGUI.standardButtonHeight))) { AddSkipActionType(NEW_TYPE); } bool bak = GUI.enabled; GUI.enabled = false; GUILayout.TextField(NEW_TYPE, GUILayout.Width(mainGUI.standardButtonWidth * 3), GUILayout.Height(mainGUI.standardButtonHeight)); GUI.enabled = bak; GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(mainGUI.standardButtonWidth / 2); GUILayout.BeginVertical(); if (seeActionTypes.Count == 0) { GUILayout.Label("No Actions Seen Yet.", GUILayout.Width(mainGUI.standardButtonWidth * 3), GUILayout.Height(mainGUI.standardButtonHeight)); } else { foreach (string s in seeActionTypes.Keys) { GUILayout.BeginHorizontal(); if (GUILayout.Button("<", GUILayout.Width(charButtonWidth), GUILayout.Height(mainGUI.standardButtonHeight))) { AddSkipActionType(s); } GUILayout.Label(s + " : "+seeActionTypes[s], GUILayout.Width(mainGUI.standardButtonWidth *3), GUILayout.Height(mainGUI.standardButtonHeight)); GUILayout.EndHorizontal(); } } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.EndScrollView(); GUILayout.EndArea(); }
void Start() { mainGUI = GetComponent<ReplayGUI>(); }
void Start() { mainGUI = GetComponent<ReplayGUI>(); calculator = GetComponent<Calculator>(); }
public override void OptionsPane(Rect layoutRect) { if (mainGUI == null) { mainGUI = GetComponent <ReplayGUI>(); } GUILayout.BeginArea(layoutRect); scrollPos = GUILayout.BeginScrollView(scrollPos); GUILayout.BeginVertical(); GUILayout.Label("Action Filtering"); GUILayout.BeginHorizontal(); GUILayout.BeginVertical(); int removeDex = -1; for (int i = 0; i < skipActionTypes.Count; i++) { GUILayout.BeginHorizontal(); if (GUILayout.Button("-", GUILayout.Width(charButtonWidth), GUILayout.Height(mainGUI.standardButtonHeight))) { removeDex = i; } skipActionTypes[i] = GUILayout.TextField(skipActionTypes[i], GUILayout.Width(mainGUI.standardButtonWidth * 2), GUILayout.Height(mainGUI.standardButtonHeight)); GUILayout.EndHorizontal(); } if (removeDex >= 0) { skipActionTypes.RemoveAt(removeDex); } GUILayout.Space(mainGUI.standardButtonHeight / 2); GUILayout.BeginHorizontal(); if (GUILayout.Button("+", GUILayout.Width(charButtonWidth), GUILayout.Height(mainGUI.standardButtonHeight))) { AddSkipActionType(NEW_TYPE); } bool bak = GUI.enabled; GUI.enabled = false; GUILayout.TextField(NEW_TYPE, GUILayout.Width(mainGUI.standardButtonWidth * 3), GUILayout.Height(mainGUI.standardButtonHeight)); GUI.enabled = bak; GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.Space(mainGUI.standardButtonWidth / 2); GUILayout.BeginVertical(); if (seeActionTypes.Count == 0) { GUILayout.Label("No Actions Seen Yet.", GUILayout.Width(mainGUI.standardButtonWidth * 3), GUILayout.Height(mainGUI.standardButtonHeight)); } else { foreach (string s in seeActionTypes.Keys) { GUILayout.BeginHorizontal(); if (GUILayout.Button("<", GUILayout.Width(charButtonWidth), GUILayout.Height(mainGUI.standardButtonHeight))) { AddSkipActionType(s); } GUILayout.Label(s + " : " + seeActionTypes[s], GUILayout.Width(mainGUI.standardButtonWidth * 3), GUILayout.Height(mainGUI.standardButtonHeight)); GUILayout.EndHorizontal(); } } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUILayout.EndScrollView(); GUILayout.EndArea(); }
void Start() { mainGUI = GetComponent <ReplayGUI>(); calculator = GetComponent <Calculator>(); }