public void ShowHoverInfo(Delegate.InformationElement hoverElement) { if (hoverElement.mouseOver) //If mouse is over que show info { StartCoroutine("FollowingMouse"); windowCollision.rectTransform.gameObject.SetActive(true); } else { StopCoroutine("FollowingMouse"); windowCollision.rectTransform.gameObject.SetActive(false); } windowCollision.rectTransform.GetComponentInChildren <TextMeshProUGUI>().SetText(hoverElement.textToShow); }
public void ChangeMouse(Delegate.InformationElement infoElement) { if (infoElement.mouseOver && PlayerController.Instance.CanInteract) { if (infoElement.component is WateringCan) { SetCursorImg(waterCanCursorTexture, CURSOR_STATE.WATERINGCAN); isOverWateringCan = true; } else if (infoElement.component is FertilizationEffect) { SetCursorImg(fertilizationCursorTexture, CURSOR_STATE.FERTILIZATIONMODE); isOverFertilizer = true; } else if (infoElement.component is Scissors) { SetCursorImg(scissorsCursorTexture, CURSOR_STATE.SCISSORS); isOverScissors = true; } else if (infoElement.component is TrashCan) { SetCursorImg(trashCanCursorTexture, CURSOR_STATE.TRASHCAN); isOverTrashCan = true; } } else if (!PlayerController.Instance.IsUsingWaterCan && !PlayerController.Instance.IsUsingFertilizer && !PlayerController.Instance.IsUsingScissors && !PlayerController.Instance.IsUsingTrashCan) { SetCursorImg(null, CURSOR_STATE.DEFAULT); isOverWateringCan = false; isOverFertilizer = false; isOverScissors = false; isOverTrashCan = false; } }