Beispiel #1
0
        /// <summary>
        /// 跟新player的UI位置
        /// </summary>
        public void UpdatePosition()
        {
            Vector3 pp = miniCamera.WorldToViewportPoint(target.position);

            playerIcon.rectTransform.anchoredPosition    = MiniMapUtils.CalculateMiniMapPosition(pp, mapUIRoot);
            miniCamera.transform.parent.localEulerAngles = new Vector3(90, 0, -target.localEulerAngles.y);
            miniCamera.transform.position = target.position + Vector3.up * defaultHeight;
        }
Beispiel #2
0
        /// <summary>
        /// 更新交互UI的实时位置
        /// </summary>
        public void UpdatePosition()
        {
            Vector3 pp = miniCamera.WorldToViewportPoint(target.position + offect);

            iconItem.anchoredPosition = MiniMapUtils.CalculateMiniMapPosition(pp, mapUIRoot);
        }