public void OnHover(RectTransform uiElement) { if (this.tempHud != null) this.tempHud.enabled = false; if (this.animationRoot != null) this.animationRoot.SetInState(); var canvas = uiElement.root.GetComponent<Canvas>(); if (canvas == null) canvas = uiElement.GetComponentsInParent<Canvas>()[0]; var scaleOut = canvas.transform.localScale.x; var pos = uiElement.position / scaleOut; this.root.position = pos; var anchor = this.root.anchoredPosition3D; anchor.z = 0f; this.root.anchoredPosition3D = anchor + Vector3.up * uiElement.sizeDelta.y * 0.5f; if (this.animationRoot != null) this.animationRoot.SetResetState(); }