完成大地图主要界面
This commit is contained in:
1 parent
5156473bb2
commit
d22eecd133
78 files changed
+8684
-6941
No files matched your search
@@ -0,0 +1,441 @@
|
||||
using Assets.Scripts.Apis;
|
||||
using Mapbox.Unity.Map;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Mapbox.Unity.MeshGeneration.Data;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Assets.Scripts;
|
||||
using Mapbox.Utils;
|
||||
using UnityEngine.UI;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using Mapbox.Examples;
|
||||
|
||||
public class BigMapController : PFUIPanel
|
||||
{
|
||||
MapApi mapApi;
|
||||
MapBoxApi mapboxApi;
|
||||
AbstractMap mapManager;
|
||||
//GameObject cube;
|
||||
//GameObject cube1;
|
||||
GameObject canvas;
|
||||
GameObject content;
|
||||
Text keyword;
|
||||
UnityEngine.Object begin;
|
||||
Sprite end;
|
||||
private Dictionary<int, LineItem> linesCache = new Dictionary<int, LineItem>();
|
||||
Tips tips;
|
||||
int timer = 0;
|
||||
protected override void Awake()
|
||||
{
|
||||
mapApi = new MapApi();
|
||||
mapboxApi = new MapBoxApi();
|
||||
|
||||
begin = Resources.Load("UI/Prefab/BigMap/Begin");
|
||||
|
||||
mapManager = this.transform.Find("Map").GetComponent<AbstractMap>();
|
||||
mapManager.OnInitialized += MapManager_OnInitialized;
|
||||
mapManager.OnUpdated += MapManager_OnUpdated;
|
||||
mapManager.OnMapRedrawn += () =>
|
||||
{
|
||||
//Debug.Log("map redrawn");
|
||||
};
|
||||
mapManager.OnTileFinished += (e) =>
|
||||
{
|
||||
//Debug.Log("finished");
|
||||
};
|
||||
|
||||
//// mapManager.OnTileFinished += MapManager_OnTileFinished;
|
||||
//mapManager.SetZoom(13);
|
||||
//mapManager.SetCenterLatitudeLongitude(new Mapbox.Utils.Vector2d(32.051203, 118.771572));
|
||||
|
||||
this.transform.Find("Map").GetComponent<QuadTreeCameraMovement>()._referenceCamera = Camera.main;
|
||||
|
||||
canvas = this.transform.Find("Canvas").gameObject;
|
||||
canvas.GetComponent<Canvas>().worldCamera = Camera.main;
|
||||
var goList = canvas.transform.Find("GoList");
|
||||
UIManager.AddEvent(goList.gameObject, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
//App.MainSceneParam.Add("Name", "MapListPanel");
|
||||
//SceneManager.LoadScene("MainScene");
|
||||
|
||||
mapManager.Destroy();
|
||||
|
||||
UIManager.ShowMapListPanel();
|
||||
|
||||
//this.gameObject.SetActive(false);
|
||||
DestroyImmediate(this.gameObject);
|
||||
});
|
||||
|
||||
var panel = canvas.transform.Find("Panel");
|
||||
SetRounded(panel,30f);
|
||||
|
||||
content = panel.Find("Scroll View").Find("Viewport").Find("Content").gameObject;
|
||||
var input = panel.Find("InputField");
|
||||
SetRounded(input, 20f);
|
||||
keyword = input.Find("Text").GetComponent<Text>();
|
||||
var searchBtn = input.Find("Search").gameObject;
|
||||
UIManager.AddEvent(searchBtn, EventTriggerType.PointerClick, Search);
|
||||
|
||||
tips = ((GameObject)Instantiate(Resources.Load("UI/Prefab/BigMap/Tips"), canvas.transform.Find("TipsContainer"))).GetComponent<Tips>();
|
||||
tips.Hide();
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 给对象设置圆角
|
||||
/// </summary>
|
||||
/// <param name="panel"></param>
|
||||
/// <param name="radius"></param>
|
||||
void SetRounded(Transform panel, float radius)
|
||||
{
|
||||
var rounded = Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial");
|
||||
var material = Instantiate(rounded);
|
||||
var rect = ((RectTransform)panel).rect;
|
||||
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, radius, 0));
|
||||
panel.GetComponent<Image>().material = material;
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
protected override void Start()
|
||||
{
|
||||
//var mapObject = this.transform.Find("Map");
|
||||
|
||||
}
|
||||
|
||||
private void Search(BaseEventData e)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(keyword.text))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var infoStr = mapboxApi.GetAddressInfo(keyword.text);
|
||||
//Debug.Log(info);
|
||||
var info = Newtonsoft.Json.Linq.JObject.Parse(infoStr);
|
||||
|
||||
var center = (info["features"] as JArray).First()["center"];
|
||||
mapManager.UpdateMap(new Vector2d(Convert.ToDouble(center[1]), Convert.ToDouble(center[0])));
|
||||
//mapManager.SetCenterLatitudeLongitude(new Vector2d(31.325053, 120.623564));
|
||||
//mapManager.UpdateMap(new Vector2d(31.325053, 120.623564));
|
||||
|
||||
}
|
||||
|
||||
private void MapManager_OnInitialized()
|
||||
{
|
||||
Load();
|
||||
}
|
||||
private void MapManager_OnUpdated()
|
||||
{
|
||||
foreach (var item in linesCache)
|
||||
{
|
||||
//if(item.Value.LineObject != null)
|
||||
//{
|
||||
// item.Value.LineObject.Destroy();
|
||||
// item.Value.LineObject = null;
|
||||
//}
|
||||
//if(item.Value.BeginMarker != null)
|
||||
//{
|
||||
// item.Value.BeginMarker.Destroy();
|
||||
// item.Value.BeginMarker = null;
|
||||
//}
|
||||
CreateLine(item.Key, item.Value);
|
||||
}
|
||||
timer += 1;
|
||||
Invoke("Load", 0.3f);
|
||||
//Load();
|
||||
}
|
||||
|
||||
async void Load()
|
||||
{
|
||||
if (timer >1)
|
||||
{
|
||||
timer--;
|
||||
return;
|
||||
}
|
||||
timer = 0;
|
||||
|
||||
var s1 = Camera.main.ScreenToWorldPoint(new Vector3(340f, 0f, 180f));
|
||||
//Debug.Log(s1);
|
||||
var start = mapManager.WorldToGeoPosition(s1);
|
||||
//Debug.Log(start);
|
||||
|
||||
var worldPoint = Camera.main.ScreenToWorldPoint(new Vector3(Screen.width, Screen.height, 180f));
|
||||
var end = mapManager.WorldToGeoPosition(worldPoint);
|
||||
//cube.transform.position = worldPoint;
|
||||
//cube1.transform.position = s1;
|
||||
//Debug.Log(end);
|
||||
//Screen.width
|
||||
//map.WorldToGeoPosition(start)
|
||||
|
||||
var bounds = $"{ start.y },{ start.x };{ end.y },{ end.x }";
|
||||
var res = await mapApi.GetNearRouteAsync((float)mapManager.CenterLatitudeLongitude.x, (float)mapManager.CenterLatitudeLongitude.y,
|
||||
mapManager.Zoom, bounds);
|
||||
if(res.result == false)
|
||||
{
|
||||
Debug.LogError(res.errMsg);
|
||||
return;
|
||||
}
|
||||
|
||||
//Debug.Log("条数:"+res.data.Count);
|
||||
|
||||
var lines = await mapApi.GetDetailsAsync(res.data.Select(d => d.Id).ToArray());
|
||||
|
||||
var aa = Newtonsoft.Json.Linq.JObject.Parse(lines);
|
||||
|
||||
//var points = (aa["data"] as JArray).First()["Points"] as JArray;
|
||||
|
||||
var ids = new List<int>();
|
||||
foreach (var line in (aa["data"] as JArray))
|
||||
{
|
||||
var id = line.Value<int>("Id");
|
||||
ids.Add(id);
|
||||
var points = line["Points"] as JArray;
|
||||
|
||||
if (linesCache.ContainsKey(id))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var pp1 = new List<Vector2d>();
|
||||
foreach (var item in points)
|
||||
{
|
||||
pp1.Add(new Mapbox.Utils.Vector2d(item[0].ToObject<double>(), item[1].ToObject<double>()));
|
||||
}
|
||||
|
||||
if (!linesCache.ContainsKey(id))
|
||||
{
|
||||
linesCache.Add(id, new LineItem { Points = pp1, Model = res.data.Single(d=>d.Id == id) });
|
||||
}
|
||||
CreateLine(id, linesCache[id]);
|
||||
|
||||
//Load();
|
||||
}
|
||||
|
||||
foreach (var item in linesCache.ToList())
|
||||
{
|
||||
if(ids.All(id=>id != item.Key))
|
||||
{
|
||||
item.Value.Destroy();
|
||||
linesCache.Remove(item.Key);
|
||||
if(item.Value.Selected)
|
||||
{
|
||||
tips.Hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//GameObject direct;
|
||||
void CreateLine(int id, LineItem line)
|
||||
{
|
||||
#region 画线
|
||||
List<Vector2d> pp1 = line.Points;
|
||||
var dat = new List<Vector3>();
|
||||
foreach (var item in pp1)
|
||||
{
|
||||
var pp = mapManager.GeoToWorldPosition(item);
|
||||
pp.y += 0.3f;
|
||||
dat.Add(pp);
|
||||
}
|
||||
var feat = new VectorFeatureUnity();
|
||||
feat.Points.Add(dat);
|
||||
|
||||
var direct = line.LineObject;
|
||||
LineRenderer lineRender;
|
||||
if (direct == null)
|
||||
{
|
||||
direct = new GameObject($"MapRoute-{ id }");
|
||||
direct.transform.SetParent(this.transform);
|
||||
lineRender = direct.AddComponent<LineRenderer>();
|
||||
lineRender.material = new Material(Shader.Find("Sprites/Default"));
|
||||
line.LineObject = direct;
|
||||
|
||||
lineRender.startColor = lineRender.endColor = Utils.HexToColor("F93086");
|
||||
|
||||
//设置宽度
|
||||
lineRender.startWidth = 1.2f;
|
||||
lineRender.endWidth = 1.2f;
|
||||
lineRender.numCornerVertices = 90;
|
||||
}
|
||||
else
|
||||
{
|
||||
lineRender = direct.GetComponent<LineRenderer>();
|
||||
}
|
||||
|
||||
//lineRender.SetWidth(0.5f, 0.5f);
|
||||
lineRender.positionCount = dat.Count;
|
||||
//lineRender.SetVertexCount(dat.Count);
|
||||
lineRender.SetPositions(feat.Points[0].ToArray());
|
||||
|
||||
#endregion
|
||||
|
||||
#region 添加左边的列表项
|
||||
if (linesCache[id].Item == null)
|
||||
{
|
||||
var itemObject = Resources.Load("UI/Prefab/BigMap/Item");
|
||||
|
||||
var itemObject1 = (GameObject)Instantiate(itemObject, content.transform, false);
|
||||
var iii = itemObject1.GetComponent<Item>();
|
||||
iii.SetModel(line.Model);
|
||||
|
||||
line.Item = iii;
|
||||
iii.onClick = () =>
|
||||
{
|
||||
if (line.Selected)
|
||||
{
|
||||
line.Selected = false;
|
||||
tips.Hide();
|
||||
//iii.Selected(false);
|
||||
return;
|
||||
}
|
||||
line.Selected = true;
|
||||
//iii.Selected(true);
|
||||
var position = line.BeginMarker.transform.position;
|
||||
//position.z += 25;
|
||||
tips.Show(position, line.Model);
|
||||
|
||||
foreach (var item in linesCache)
|
||||
{
|
||||
if(item.Key != line.Model.Id)
|
||||
{
|
||||
item.Value.Selected = false;
|
||||
//item.Value.Item.Selected(false);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 添加marker
|
||||
|
||||
if (line.BeginMarker == null)
|
||||
{
|
||||
var beginInstance = (GameObject)Instantiate(begin, canvas.transform.Find("MarkerContainer").transform);
|
||||
line.BeginMarker = beginInstance;
|
||||
|
||||
|
||||
UIManager.AddEvent(line.BeginMarker, EventTriggerType.PointerClick, new UnityAction<BaseEventData>((e) =>
|
||||
{
|
||||
if (line.Selected)
|
||||
{
|
||||
line.Selected = false;
|
||||
tips.Hide();
|
||||
return;
|
||||
}
|
||||
line.Selected = true;
|
||||
|
||||
var position = line.BeginMarker.transform.position;
|
||||
//position.z += 25;
|
||||
tips.Show(position, line.Model);
|
||||
|
||||
foreach (var item in linesCache)
|
||||
{
|
||||
if (item.Key != line.Model.Id)
|
||||
{
|
||||
item.Value.Selected = false;
|
||||
//item.Value.Item.Selected(false);
|
||||
}
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
line.BeginMarker.transform.localScale = new Vector3(2,2);
|
||||
//beginInstance.transform.localRotation = new Quaternion(90,0,0,0);
|
||||
|
||||
line.BeginMarker.transform.position = ConverToPosition(line.Points.First());
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
if (line.Selected)
|
||||
{
|
||||
line.Selected = true;
|
||||
var position = line.BeginMarker.transform.position;
|
||||
//position.z += 25;
|
||||
tips.Show(position, line.Model);
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 转换地理坐标到屏幕坐标
|
||||
/// </summary>
|
||||
/// <param name="vector"></param>
|
||||
/// <returns></returns>
|
||||
Vector3 ConverToPosition(Vector2d vector)
|
||||
{
|
||||
var worldPosition = mapManager.GeoToWorldPosition(vector);//32.061255, 118.80925
|
||||
|
||||
var vp = Camera.main.WorldToViewportPoint(worldPosition);
|
||||
vp.z = 180f;
|
||||
////Debug.Log(vp);
|
||||
//var wd = Camera.main.WorldToScreenPoint(worldPosition);
|
||||
var wd = Camera.main.ViewportToWorldPoint(vp);
|
||||
return wd;
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
//Debug.Log(Input.mousePosition.x + "," + Input.mousePosition.y + "," + Input.mousePosition.z);
|
||||
//timer += Time.deltaTime;
|
||||
}
|
||||
|
||||
|
||||
public override void Close()
|
||||
{
|
||||
//base.Close();
|
||||
|
||||
DestroyImmediate(this.gameObject);
|
||||
}
|
||||
|
||||
class LineItem
|
||||
{
|
||||
public List<Vector2d> Points { get; set; }
|
||||
|
||||
public GameObject LineObject { get; set; }
|
||||
|
||||
public GameObject BeginMarker { get; set; }
|
||||
|
||||
public NearRouteModel Model { get; set; }
|
||||
|
||||
public Item Item { get; set; }
|
||||
|
||||
private bool _Selected = false;
|
||||
public bool Selected {
|
||||
get
|
||||
{
|
||||
return _Selected;
|
||||
}
|
||||
set
|
||||
{
|
||||
_Selected = value;
|
||||
Item.Selected(value);
|
||||
var lineRender = LineObject.GetComponent<LineRenderer>();
|
||||
if (value)
|
||||
{
|
||||
lineRender.startColor = lineRender.endColor = Color.white;
|
||||
}
|
||||
else
|
||||
{
|
||||
lineRender.startColor = lineRender.endColor = Utils.HexToColor("F93086");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Destroy()
|
||||
{
|
||||
//Debug.Log($"销毁{ item.Key }, { item.Value.Item != null }");
|
||||
LineObject.Destroy();
|
||||
BeginMarker.Destroy();
|
||||
Item.gameObject.Destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 969b87ed3066bec4a9981a69d7dfb8e4
|
||||
guid: 221b4141e3d502548ac3b7fe1b3245d7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -17,7 +17,10 @@ public class DeviceController : PFUIPanel
|
||||
private Sprite ant1;
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
AntConnector.Instance();
|
||||
|
||||
Debug.Log("device awake");
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
@@ -30,10 +33,11 @@ public class DeviceController : PFUIPanel
|
||||
// UIManager.ShowHomePanel();
|
||||
//});
|
||||
|
||||
mReturnBtn = this.transform.Find("ReturnBtn").GetComponent<Button>();
|
||||
mReturnBtn = this.transform.Find("CloseBtn").GetComponent<Button>();
|
||||
UIManager.AddEvent(mReturnBtn.gameObject, EventTriggerType.PointerClick, new UnityEngine.Events.UnityAction<BaseEventData>(e =>
|
||||
{
|
||||
UIManager.ShowHomePanel();
|
||||
//UIManager.ShowHomePanel();
|
||||
UIManager.CloseModal();
|
||||
}));
|
||||
|
||||
var bg = this.transform.Find("Status").Find("Bg");
|
||||
@@ -41,7 +45,10 @@ public class DeviceController : PFUIPanel
|
||||
|
||||
ant0 = Resources.Load<Sprite>("Images/ANT+_0");
|
||||
ant1 = Resources.Load<Sprite>("Images/ANT+_1");
|
||||
|
||||
Debug.Log("device start");
|
||||
}
|
||||
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Apis;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
@@ -35,35 +37,33 @@ public class HomeController : PFUIPanel
|
||||
// toast.GetComponent<RectTransform>().position = new Vector3(Screen.width / 2, Screen.height / 2, 0);
|
||||
// toast.transform.parent = parent;
|
||||
//}
|
||||
if (App.CurrentUser != null)
|
||||
{
|
||||
GetSummary();
|
||||
}
|
||||
|
||||
//if (More != null)
|
||||
//{
|
||||
// More.onClick.AddListener(MoreFunc);
|
||||
//}
|
||||
BtnRide.onClick.AddListener(GoRide);
|
||||
var wifi = this.transform.Find("MainToolContainer").Find("Wifi");
|
||||
UIManager.AddEvent(wifi.gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
Debug.Log("click wifi");
|
||||
UIManager.ShowDevicePanel();
|
||||
});
|
||||
|
||||
var avatar = userInfo.Find("Avatar");
|
||||
var avatar = userInfo.Find("Avatar").GetComponent<RawImage>();
|
||||
var material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
|
||||
var rect = ((RectTransform)avatar.transform).rect;
|
||||
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height, 0));
|
||||
avatar.material = material;
|
||||
|
||||
UIManager.AddEvent(avatar.gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
});
|
||||
|
||||
if (App.CurrentUser == null)
|
||||
UIManager.AddEvent(userInfo.Find("BtnMore").gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
Login();
|
||||
}
|
||||
UIManager.ShowAlert("test");
|
||||
});
|
||||
|
||||
GetSummary();
|
||||
}
|
||||
|
||||
private async void Login()
|
||||
private async Task Login()
|
||||
{
|
||||
var result = await new UserApi().Login("13115011550", "laozhong", "");
|
||||
App.CurrentUser = result.data;
|
||||
@@ -91,31 +91,36 @@ public class HomeController : PFUIPanel
|
||||
|
||||
}
|
||||
|
||||
void SetCurrentUser()
|
||||
void SetCurrentUser(SummaryResultModel summary)
|
||||
{
|
||||
userInfo.Find("NickName").GetComponent<Text>().text = App.CurrentUser.Nickname;
|
||||
userInfo.Find("GroupTop").Find("FtpContainer").Find("FtpValue").GetComponent<Text>().text = App.CurrentUser.FTP.ToString();
|
||||
userInfo.Find("GroupTop").Find("WeightContainer").Find("WeightValue").GetComponent<Text>().text = App.CurrentUser.Weight.ToString();
|
||||
userInfo.Find("GroupTop").Find("WKGContainer").Find("WKGValue").GetComponent<Text>().text = $"{App.CurrentUser.Weight}kg/{App.CurrentUser.BicycleWeight}kg";
|
||||
//userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent<Text>().text = App.CurrentUser.Carlories;
|
||||
//userInfo.Find("KMContainer").Find("KMValue").GetComponent<Text>().text = App.CurrentUser.Distance.ToString("#0.00");
|
||||
//userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent<Text>().text = App.CurrentUser.Climb;
|
||||
userInfo.Find("CaloriesContainer").Find("CaloriesValue").GetComponent<Text>().text = summary.Kcal;
|
||||
userInfo.Find("KMContainer").Find("KMValue").GetComponent<Text>().text = summary.TotalDistance.ToString();
|
||||
userInfo.Find("ClimbContainer").Find("ClimbValue").GetComponent<Text>().text = summary.TotalClimb;
|
||||
//var user = ConfigHelper.CurrentUser;
|
||||
//Ftp.text = user.FTP.ToString();
|
||||
//Ftp.text = summary.Ftp.ToString();
|
||||
//Weight.text = user.Weight.ToString();
|
||||
//WKG.text = $"{user.Weight}KG/{user.BicycleWeight}KG";
|
||||
//NickName.text = user.Nickname;
|
||||
//Utils.DisplayImage(StartCoroutine, userInfo.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.Avatar);
|
||||
Utils.DisplayImage(StartCoroutine, userInfo.Find("Avatar").GetComponent<RawImage>(), App.CurrentUser.WxHeadImg);
|
||||
}
|
||||
void GetSummary()
|
||||
async void GetSummary()
|
||||
{
|
||||
if (App.CurrentUser == null)
|
||||
{
|
||||
await Login();
|
||||
}
|
||||
|
||||
var res = ConfigHelper.userApi.GetSummary();
|
||||
if (res.result)
|
||||
{
|
||||
//App.CurrentUser.Distance = res.data.TotalDistance;
|
||||
//App.CurrentUser.Climb = res.data.TotalClimb;
|
||||
//App.CurrentUser.Carlories = res.data.Kcal;
|
||||
SetCurrentUser();
|
||||
SetCurrentUser(res.data);
|
||||
//Climb.text = $"{res.data.TotalClimb.ToString()}M";
|
||||
//Calories.text = $"{res.data.Kcal.ToString()}KCAL";
|
||||
//Calories.text = res.data.
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class MapController : MonoBehaviour
|
||||
{
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,7 @@ public class MapListController : PFUIPanel
|
||||
[HideInInspector] public string hard = "全部";
|
||||
|
||||
private Button returnBtn;
|
||||
GameObject btnMapMode;
|
||||
public GameObject Content {
|
||||
get
|
||||
{
|
||||
@@ -35,6 +36,11 @@ public class MapListController : PFUIPanel
|
||||
//{
|
||||
// hardSelector.onValueChanged.AddListener(ChangeHard);
|
||||
//}
|
||||
btnMapMode = this.transform.Find("BtnMapMode").gameObject;
|
||||
UIManager.AddEvent(btnMapMode, EventTriggerType.PointerClick, (e) =>
|
||||
{
|
||||
UIManager.ShowBigMapPanel();
|
||||
});
|
||||
if (content!=null)
|
||||
{
|
||||
//var transform = content.transform.GetComponent<RectTransform>();
|
||||
|
||||
Reference in new issue
Block a user