// Update is called once per frame void Update() { //Only count down timers when we're not moused over the console window if (!GUIUtils.MouseOverRect(consoleRect)) { consoleWindow.pauseAutoScroll = false; consoleWindow.CountDownTimers(); } else { consoleWindow.pauseAutoScroll = true; } //Mock up some triggers or events happening in game that would display messages if (Input.GetKeyDown(KeyCode.Space)) { consoleWindow.AddMessage(30, GUIUtils.MakeRandomString(UnityEngine.Random.Range(3, 15))); } if (Input.GetKeyDown(KeyCode.P)) { Vector3 mousePosition = Input.mousePosition; mousePosition.z = 15; //depth of objects into scene consoleWindow.AddMessage( new MessageWindow.LocationMessageItem(30, "Location event!", Camera.main.ScreenToWorldPoint(mousePosition), OnLocationClicked)); } }
// Update is called once per frame void Update() { if (!GUIUtils.MouseOverRect(entireChatArea)) { messageWindow.pauseAutoScroll = false; messageWindow.CountDownTimers(); } else { messageWindow.pauseAutoScroll = true; } }