| | |
| | | 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)
|
| | |
| | | m_MapHero.transform.eulerAngles = _mapHeroEular;
|
| | | }
|
| | | }
|
| | | if (m_MapImage.transform.localPosition != heroPrePosition)
|
| | | if (heroPrePosition != Vector3.zero)
|
| | | m_MapImage.transform.localPosition = heroPrePosition;
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public void ShowMiniMap(bool show)
|
| | | {
|
| | | m_Map.gameObject.SetActive(show);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|