少年修仙传客户端代码仓库
System/MainInterfacePanel/TopRightTip.cs
@@ -91,18 +91,25 @@
                var mapHeight = mapResConfig.MapScale.y;
                var uiMapWidth = mapWidth * mapResConfig.MapShowScale;
                var uiMapHeight = mapHeight * mapResConfig.MapShowScale;
                m_MapName.text = mapResConfig.Name;
                this.mapMatrix = new LocalMap(this.dataMapId, mapWidth, mapHeight, uiMapWidth, uiMapHeight);
                m_MapImage.SetSprite(mapResConfig.BigMap);
                m_MapImage.SetNativeSize();
                var hPos = mapMatrix.WorldToLocalPosition(PlayerDatas.Instance.hero.Pos);
                heroPrePosition = hPos;
                m_MapName.text = mapResConfig.Name;
                if (mapWidth == 0)
                {
                    heroPrePosition = Vector3.zero;
                }
                else
                {
                    var hPos = mapMatrix.WorldToLocalPosition(PlayerDatas.Instance.hero.Pos);
                    heroPrePosition = hPos;
                }
            }
            //更新坐标
            if (dataMapId == PlayerDatas.Instance.baseData.MapID && PlayerDatas.Instance.hero.IsRun())
            if (heroPrePosition != Vector3.zero && dataMapId == PlayerDatas.Instance.baseData.MapID && PlayerDatas.Instance.hero.IsRun())
            {
                var heroPos = mapMatrix.WorldToLocalPosition(PlayerDatas.Instance.hero.Pos);
                if (Vector3.Distance(heroPrePosition, heroPos) > 1f)
@@ -115,9 +122,8 @@
                    m_MapHero.transform.eulerAngles = _mapHeroEular;
                }
            }
            if (m_MapImage.transform.localPosition != heroPrePosition)
            if (heroPrePosition != Vector3.zero)
                m_MapImage.transform.localPosition = heroPrePosition;
        }
@@ -147,6 +153,11 @@
            }
        }
        public void ShowMiniMap(bool show)
        {
            m_Map.gameObject.SetActive(show);
        }
    }
}