private bool CheckGraphicDisaster(DisasterIcon disasterIcon) { bool hasFoundData = false; Disaster disaster = disasterIcon.GetDisaster(); if (disaster != null) { hasFoundData = true; disasterContent.textTitle.text = disaster.title; } imageToShow = false; return(hasFoundData); }
private void DisasterIcon_OnClick(DisasterIcon obj) { if (worldWindow.IsVideoShown()) { worldWindow.HideVideo(); } else { if (disasterContent.disasterIcon == obj) { worldWindow.ShowVideo(true); } else { worldWindow.ShowVideo(); } } }
private bool UIRaycasting() { bool hasHit = false; isBlocked = false; pointerEventData = new PointerEventData(eventSystem); pointerEventData.position = Input.mousePosition; List <RaycastResult> graphicResults = new List <RaycastResult>(); graphicRaycaster.Raycast(pointerEventData, graphicResults); EventSystem.current.RaycastAll(pointerEventData, graphicResults); foreach (RaycastResult rr in graphicResults) { if (rr.gameObject.CompareTag(blockingRaycastTag)) { isBlocked = true; return(hasHit); } PurchasableIcon purchasableIcon = rr.gameObject.GetComponentInChildren <PurchasableIcon>(); if (purchasableIcon != null) { hasHit = true; if (purchasableIcon.gameObject != currentGameObject) { currentGameObject = purchasableIcon.gameObject; if (CheckGraphicPolluter(purchasableIcon)) { HidePopupOtherThan(polluterContent); ShowPopup(polluterContent); } } } if (raycastDisaster) { DisasterIcon disasterIcon = rr.gameObject.GetComponentInChildren <DisasterIcon>(); if (disasterIcon != null) { hasHit = true; if (disasterIcon.gameObject != currentGameObject) { currentGameObject = disasterIcon.gameObject; if (CheckGraphicDisaster(disasterIcon)) { HidePopupOtherThan(disasterContent); ShowPopup(disasterContent); } } } } } return(hasHit); }