bool UIHitOrNot() { if (RectTransformUtility.RectangleContainsScreenPoint(EnemyTargetFrame.GetComponent <RectTransform> (), Input.mousePosition, null)) { return(false); } else if (RectTransformUtility.RectangleContainsScreenPoint(FriendlyTargetFrame.GetComponent <RectTransform> (), Input.mousePosition, null)) { return(false); } else if (RectTransformUtility.RectangleContainsScreenPoint(ActionBars.GetComponent <RectTransform> (), Input.mousePosition, null)) { return(false); } else if (RectTransformUtility.RectangleContainsScreenPoint(PlayerTargetFrame.GetComponent <RectTransform> (), Input.mousePosition, null)) { Target = Player; UpdateTargetInfo("Player"); EnemyTargetFrame.SetActive(false); FriendlyTargetFrame.SetActive(true); return(false); } else { return(true); } }
public void SelectBar(ActionBars bar) { MainBar.SetActive(false); RoomBar.SetActive(false); SpellBar.SetActive(false); BackButton.SetActive(true); SettingButton.SetActive(true); switch (bar) { case ActionBars.MainBar: MainBar.SetActive(true); BackButton.SetActive(false); break; case ActionBars.RoomBar: RoomBar.SetActive(true); break; case ActionBars.SpellBar: SpellBar.SetActive(true); break; } }