private static void OnEditorUpdate() { // Repaint previous hover window if mouse is no longer hovering over it. if (HoverWindow != EditorWindow.mouseOverWindow && HoverWindow != null) { HoverWindow.Repaint(); HoverWindow = null; } // Disable hover tip if it has been 1 second since it was ready to hide. if (HoverTipStage == HoverTipState.ReadyToHide) { if (EditorApplication.timeSinceStartup - ReadyToHideTime > 1.0) { HoverTipStage = HoverTipState.NotShown; } } // Note: This will only occur for Windows! if (s_QueueDropDownWindow != null) { s_QueueDropDownWindow.SendEvent(s_QueueDropDownEvent); s_QueueDropDownWindow = null; s_QueueDropDownEvent = null; } }
private HoverWindow hoverWindow;//the window tht will pop up msg private void Start() { if (hoverWindow == null) { hoverWindow = FindObjectOfType <HoverWindow>(); } }
/// < /// summary> /// For unity eventTrigger /// /// </summary> private void PublicSpawnHelp() { if (hoverWindowMed == null) { hoverWindow = FindObjectOfType <HoverWindow>(); hoverWindowMed = FindObjectOfType <HoverWindowMed>(); } if (hoverWindowMed == null) { return; } if (Category == Ca.Structure || Category == Ca.Shore || Category == Ca.Way || //Category == Ca.Spawn || HType == H.BuyRegion) { hoverWindow.ShowMsg(HType.ToString()); } else if (HType == H.Person) { hoverWindow.ShowExplicitThis(Name); } //Construction Sign //bz if more than 6 he know how to build already else if (transform.name == "Construction" && BuildingPot.Control.Registro.AllBuilding.Count < 10) { hoverWindowMed.Show(MousePositionTowardsScreenCenter(), transform.name); } //Demolition Sign else if (transform.name == "Demolition") { hoverWindowMed.Show(MousePositionTowardsScreenCenter(), transform.name); } }
// Update is called once per frame private void Update() { if (hoverWindow == null) { if (Time.time % 2 == 0) { hoverWindow = FindObjectOfType <HoverWindow>(); } return; } //will redo Rect. Spawning hover with this so it can Scroll with mouse when on Main Inventories if (Input.GetAxis("Mouse ScrollWheel") != 0 && ScrollViewShowInventory.IsMouseOnMe) { myRect = GetRectFromBoxCollider2D(); } //if got in my area if (myRect.Contains(Input.mousePosition)) { SpawnHelp(); } //ig got out else if (!myRect.Contains(Input.mousePosition) && MyMsg() == hoverWindow.Message()) { DestroyHelp(); } }
void Start() { if (hoverWindowMed == null) { hoverWindow = FindObjectOfType <HoverWindow>(); hoverWindowMed = FindObjectOfType <HoverWindowMed>(); } }
private void InitObjects() { //for this to work only one gameObj can have the HoverWindow attached if (hoverWindow == null) { hoverWindow = FindObjectOfType <HoverWindow>(); } screenRect = DefineScreenRect(); }
// Update is called once per frame private void Update() { if (hoverWindow == null) { if (Time.time % 2 == 0) { hoverWindow = FindObjectOfType <HoverWindow>(); } return; } }
void InitObjects() { //for this to work only one gameObj can have the HoverWindow attached if (hoverWindow == null) { hoverWindow = FindObjectOfType <HoverWindow>(); } myRect = GetRectFromBoxCollider2D(); screenRect = DefineScreenRect(); }