观察者TCP通信对接,实时列表优化,观察者模式界面显示逻辑
This commit is contained in:
1 parent
d6a7cd798f
commit
b2a527f518
41 files changed
+11545
-3263
No files matched your search
@@ -113,10 +113,12 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
map = transform.parent.Find("Map").GetComponent<AbstractMap>();
|
||||
mapData = mainController.GetMapData();//获取路书信息
|
||||
|
||||
//获取海拔图UI对象
|
||||
var graphObject = transform.parent.Find("SingleUI/Panel/GraphChart");
|
||||
chartDataSourceScript = graphObject.GetComponent<ChartDataSourceScript>();
|
||||
graph = graphObject.GetComponent<GraphChartBase>();
|
||||
////获取海拔图UI对象
|
||||
//var graphObject = transform.parent.Find("SingleUI/Panel/GraphChart");
|
||||
//chartDataSourceScript = graphObject.GetComponent<ChartDataSourceScript>();
|
||||
//graph = graphObject.GetComponent<GraphChartBase>();
|
||||
chartDataSourceScript = mainController.chartDataSourceScript;
|
||||
graph = mainController.graph;
|
||||
}
|
||||
|
||||
protected virtual void Excute()
|
||||
@@ -232,7 +234,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
for (int i = 0; i < pointList.Count; i++)
|
||||
{
|
||||
sumDistance += pointList[i].Distance;
|
||||
if (totalDistance * 1000 <= sumDistance)
|
||||
decimal left = (decimal)totalDistance * 1000;
|
||||
decimal right = (decimal)sumDistance;
|
||||
if (left <= right)
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
@@ -300,8 +304,15 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
|
||||
Vector3 v = Vector3.Lerp(prePos, nextPos, t);
|
||||
currentPos = v;
|
||||
transform.localPosition = v;
|
||||
yield return null; new WaitForEndOfFrame();
|
||||
transform.localPosition = v;
|
||||
if (UserId == mainController.currentPlayer.UserId)
|
||||
{
|
||||
yield return new WaitForEndOfFrame();
|
||||
}
|
||||
else
|
||||
{
|
||||
yield return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -27,6 +27,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
protected Text uploadByUserName;
|
||||
protected Text processText;
|
||||
protected Text mapDescText;
|
||||
protected Text rideNowText;
|
||||
protected RawImage head;
|
||||
protected RawImage country;
|
||||
protected RawImage mapCountry;
|
||||
@@ -34,7 +35,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
protected RawImage altitudeGraph;
|
||||
protected Button rideNow;
|
||||
protected Button cancel;
|
||||
protected MapApi mapApi;
|
||||
protected MapApi mapApi { get; set; }
|
||||
protected GameObject panel;
|
||||
protected CanvasGroup canvasGroup;
|
||||
protected Transform mapRanking;
|
||||
@@ -50,6 +51,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
App.TextureCache.Clear();
|
||||
loadingPanel = transform.Find("Panel/LoadingPanel").gameObject;
|
||||
loadingPanel.showLoadingExtension();
|
||||
mapApi = new MapApi();
|
||||
}
|
||||
public void InjectController(CyclingController controller)
|
||||
{
|
||||
@@ -69,20 +71,26 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
Utils.DisplayImage(mapRouteImage, url);
|
||||
}
|
||||
public void DrawMapRoute(MapDataModel mapData)
|
||||
public async void DrawMapRouteAsync(int routeId)
|
||||
{
|
||||
var url = Helper.GetMapboxApiUrl(mapData.List);
|
||||
this.AddProcess(10);
|
||||
//var url = Helper.GetMapboxApiUrl(mapData.List);
|
||||
mapApi = new MapApi();
|
||||
var result = await mapApi.GetMapLoadingCoverageUrl(routeId);
|
||||
if (!result.result)
|
||||
return;
|
||||
var url = result.data;
|
||||
if (App.TextureCache.ContainsKey(url))
|
||||
{
|
||||
mapRouteImage.texture = App.TextureCache[url];
|
||||
var canvasGroup = mapRouteImage.GetComponent<CanvasGroup>();
|
||||
canvasGroup.DOFade(1, 1);
|
||||
this.AddProcess(10);
|
||||
//this.AddProcess(10);
|
||||
}
|
||||
else
|
||||
{
|
||||
Utils.DisplayImageAysnc(StartCoroutine, mapRouteImage, url, dowloadCallBack);
|
||||
this.AddProcess(10);
|
||||
//this.AddProcess(10);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -160,6 +168,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
processText = transform.Find("Panel/ProcessText").GetComponent<Text>();
|
||||
mapDescText = transform.Find("Panel/MapDesc").GetComponent<Text>();
|
||||
rideNow = transform.Find("Panel/RideNow").GetComponent<Button>();
|
||||
rideNowText = rideNow.transform.Find("Text").GetComponent<Text>();
|
||||
cancel = transform.Find("Panel/Cancel").GetComponent<Button>();
|
||||
var root = transform.parent;
|
||||
_map = root.Find("Map").GetComponent<AbstractMap>();
|
||||
@@ -170,7 +179,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
UIManager.AddEvent(cancel.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, Cancel);
|
||||
|
||||
}
|
||||
protected void StartRide(BaseEventData baseEvent)
|
||||
protected virtual void StartRide(BaseEventData baseEvent)
|
||||
{
|
||||
var checkAnt = cyclingController.CheckAnt();
|
||||
#if UNITY_EDITOR
|
||||
@@ -183,6 +192,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
else
|
||||
{
|
||||
cyclingController.InitTcp();
|
||||
MapUDPService.SendGizpModel();
|
||||
cyclingController.ReSetUIManager();
|
||||
cyclingController.GoContinueRide();
|
||||
//启用ridenow
|
||||
|
||||
@@ -15,7 +15,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
|
||||
protected GameObject nearByItem;
|
||||
protected GameObject nearByMajorItem;
|
||||
private GameObject scroll;
|
||||
protected GameObject scroll;
|
||||
protected Transform parent { get; set; }
|
||||
private GameObject body;
|
||||
|
||||
protected int totalPages = 0;
|
||||
@@ -31,6 +32,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
protected virtual void Awake()
|
||||
{
|
||||
scroll = transform.parent.parent.gameObject;
|
||||
parent = transform;
|
||||
if (scroll != null)
|
||||
{
|
||||
UIManager.AddEvent(scroll, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag);
|
||||
@@ -59,34 +61,42 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
t -= Time.deltaTime;
|
||||
while (t < 0)
|
||||
{
|
||||
Utils.DestroyChildren(transform);
|
||||
//Utils.DestroyChildren(parent);
|
||||
CreateList();
|
||||
t = 1;
|
||||
t = 1f;
|
||||
}
|
||||
}
|
||||
protected virtual void CreateList()
|
||||
{
|
||||
|
||||
}
|
||||
private void OnEndDrag(BaseEventData arg0)
|
||||
protected virtual void OnEndDrag(BaseEventData arg0)
|
||||
{
|
||||
var scrollrect = scroll.GetComponent<ScrollRect>();
|
||||
if (scrollrect.verticalNormalizedPosition <= 0)
|
||||
{
|
||||
var p = pageIndex + 1;
|
||||
if (p * pageSize <= totalPages)
|
||||
{
|
||||
pageIndex++;
|
||||
}
|
||||
SetNextIndex();
|
||||
|
||||
}
|
||||
if (scrollrect.verticalNormalizedPosition >= (pageIndex == 0 ? 1.2 : 1))
|
||||
{
|
||||
var p = pageIndex - 1;
|
||||
if (p > 0)
|
||||
{
|
||||
pageIndex--;
|
||||
}
|
||||
SetPreIndex();
|
||||
}
|
||||
}
|
||||
protected void SetNextIndex()
|
||||
{
|
||||
var p = pageIndex + 1;
|
||||
if (p * pageSize <= totalPages)
|
||||
{
|
||||
pageIndex++;
|
||||
}
|
||||
}
|
||||
protected void SetPreIndex()
|
||||
{
|
||||
var p = pageIndex - 1;
|
||||
if (p > 0)
|
||||
{
|
||||
pageIndex--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -409,10 +409,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//保存游戏
|
||||
public virtual void SaveRide(BaseEventData baseEventData)
|
||||
{
|
||||
if (playerController.TotalTicks > 0 && !mainController.isQuit)
|
||||
if (playerController?.TotalTicks > 0 && !mainController.isQuit)
|
||||
{
|
||||
mainController.SetQuit();
|
||||
playerController.Upload();
|
||||
playerController?.Upload();
|
||||
quitPanel.SetActive(false);
|
||||
}
|
||||
else
|
||||
@@ -439,7 +439,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//结束游戏
|
||||
public virtual void StopRide(BaseEventData baseEventData)
|
||||
{
|
||||
if (playerController.TotalTicks > 0)
|
||||
if (playerController?.TotalTicks > 0)
|
||||
{
|
||||
quitPanel.SetActive(true);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,51 @@
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
using Assets.Scripts.Apis;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class CompetitionLoadingController : AbstratctLoadingController
|
||||
{
|
||||
private GameObject Watch;
|
||||
private bool hasJoin = false;
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
//显示报名按钮 观战按钮
|
||||
|
||||
}
|
||||
//先报名后开始
|
||||
protected override void StartRide(BaseEventData baseEvent)
|
||||
{
|
||||
//先报名
|
||||
if (!hasJoin)
|
||||
{
|
||||
MapCompetitionApi s = new MapCompetitionApi();
|
||||
_ = s.ApplyMapCompetition(cyclingController.competitionId);
|
||||
rideNowText.text = "RideNow";
|
||||
hasJoin = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
base.StartRide(baseEvent);
|
||||
}
|
||||
}
|
||||
|
||||
protected void StartWatch(BaseEventData baseEvent)
|
||||
{
|
||||
//隐藏当前用户
|
||||
cyclingController.isWatch = true;
|
||||
cyclingController.player.SetActive(false);
|
||||
base.StartRide(baseEvent);
|
||||
}
|
||||
protected override void InitGameObject()
|
||||
{
|
||||
base.InitGameObject();
|
||||
//比赛相关数据绑定
|
||||
//显示报名按钮 观战按钮 TODO
|
||||
rideNowText.text = "Apply";
|
||||
Watch = transform.Find("Panel/Watch").gameObject;
|
||||
|
||||
UIManager.AddEvent(Watch, EventTriggerType.PointerClick, StartWatch);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ using Assets.Scenes.Ride.Scripts.Model.CyclingModels;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
@@ -11,54 +13,101 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
private bool isInit = false;
|
||||
private List<CompetitionRankingSortModel> rankingList {get;set;}
|
||||
private AbstractPlayer currentPlayer { get; set; }
|
||||
private Text Title { get; set; }
|
||||
private Text OnlineUserNum { get; set; }
|
||||
private Text Rank { get; set; }
|
||||
private GameObject PreBtn { get; set; }
|
||||
private GameObject NextBtn { get; set; }
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
//base.Awake();
|
||||
scroll = transform.Find("List").gameObject;
|
||||
if (scroll != null)
|
||||
{
|
||||
UIManager.AddEvent(scroll, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag);
|
||||
}
|
||||
parent = scroll.transform.Find("Viewport/Content");
|
||||
cyclingController = FindObjectOfType<CyclingController>();
|
||||
playerController = FindObjectOfType<PlayerController>();
|
||||
currentPlayer = cyclingController.currentPlayer;
|
||||
nearByItem = Resources.Load<GameObject>("UI/Prefab/Match/CompetitionRankingItem");
|
||||
nearByMajorItem = Resources.Load<GameObject>("UI/Prefab/Match/CompetitionRankingMajorItem");
|
||||
|
||||
Title = transform.Find("Title").GetComponent<Text>();
|
||||
OnlineUserNum = transform.Find("Head/OnlineUserNum").GetComponent<Text>();
|
||||
PreBtn = transform.Find("Pre").gameObject;//上一页
|
||||
NextBtn = transform.Find("Next").gameObject;//下一页
|
||||
Rank = transform.Find("Rank").GetComponent<Text>();
|
||||
UIManager.AddEvent(PreBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, PrePage);
|
||||
UIManager.AddEvent(NextBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, NextPage);
|
||||
}
|
||||
private void PrePage(BaseEventData baseEventData)
|
||||
{
|
||||
SetPreIndex();
|
||||
isInit = true;
|
||||
}
|
||||
private void NextPage(BaseEventData baseEventData)
|
||||
{
|
||||
SetNextIndex();
|
||||
isInit = true;
|
||||
}
|
||||
protected override void CreateList()
|
||||
{
|
||||
//获取实时排名
|
||||
CompetitionModel s = cyclingController.cyclingController as CompetitionModel;
|
||||
var ss = s?.competitionRankingModel;
|
||||
rankingList = ss?.Sorts;
|
||||
|
||||
if (rankingList == null) return;
|
||||
totalPages = rankingList.Count();
|
||||
//TODO 计算当前用户排名
|
||||
//当前参赛总人数
|
||||
var totalCount = rankingList.Count();
|
||||
OnlineUserNum.text = totalCount.ToString();
|
||||
//当前用户排名
|
||||
var currentIndex = rankingList.Where(c => c.UserId == cyclingController.currentPlayer.UserId).FirstOrDefault()?.Index ?? 0;
|
||||
totalPages = (pageSize>0?totalCount / pageSize:0) + (totalCount % pageSize> 0? 1:0);
|
||||
if (!isInit)
|
||||
{
|
||||
//当前用户排名
|
||||
var currentIndex = rankingList.Where(c => c.UserId == currentPlayer.UserId).FirstOrDefault()?.Index??0;
|
||||
//当前用户在第几页
|
||||
pageIndex = currentIndex / pageSize;
|
||||
pageIndex = (pageSize > 0 ? currentIndex / pageSize : 0) + (totalCount % pageSize > 0 ? 1 : 0);
|
||||
}
|
||||
|
||||
Rank.text = $"{pageIndex}/{totalPages}";
|
||||
var pagedList = rankingList.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
|
||||
for (int i = 0; i < pagedList.Count(); i++)
|
||||
{
|
||||
Create(pagedList[i]);
|
||||
CreateOrUpdate(pagedList[i]);
|
||||
}
|
||||
}
|
||||
private void Create(CompetitionRankingSortModel item)
|
||||
private void CreateOrUpdate(CompetitionRankingSortModel item)
|
||||
{
|
||||
//创建
|
||||
GameObject prefabItem = item.IsSelf ? nearByMajorItem : nearByItem;
|
||||
GameObject newObj = (GameObject)Instantiate(prefabItem, transform);
|
||||
var competitionRankingItem = newObj.GetComponent<CompetitionRankingItem>();
|
||||
var rankingList = FindObjectsOfType<CompetitionRankingItem>();
|
||||
var competitionRankingItem = rankingList.Where(c => c.UserId == item.UserId).FirstOrDefault();
|
||||
//如果当前有这个用户则更新没有则创建并setslibingindex
|
||||
if (competitionRankingItem == null)
|
||||
{
|
||||
//创建
|
||||
if (bufferSize < pageSize)
|
||||
{
|
||||
//情况一:还有足够的buffer,直接创建
|
||||
GameObject prefabItem = cyclingController.currentPlayer.UserId == item.UserId ? nearByMajorItem : nearByItem;
|
||||
GameObject newObj = (GameObject)Instantiate(prefabItem, parent);
|
||||
competitionRankingItem = newObj.GetComponent<CompetitionRankingItem>();
|
||||
bufferSize++;
|
||||
}
|
||||
else
|
||||
{
|
||||
//情况二:没有足够的buffer,找到要被淘汰的buffer()最后一名
|
||||
competitionRankingItem = rankingList.OrderByDescending(c => c.rank).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
competitionRankingItem.setUserId(item.UserId);
|
||||
competitionRankingItem.SetRank(item.Index);
|
||||
competitionRankingItem.setName(item.Name);
|
||||
competitionRankingItem.setRatio(item.KGWeight+"W/KG");
|
||||
competitionRankingItem.setRatio(item.KGWeight + "W/KG");
|
||||
competitionRankingItem.setSpeed(item.Speed.ToString() + "KM/H");
|
||||
//competitionRankingItem.setHead(item.Headimage);
|
||||
//competitionRankingItem.setCountry(cyclingController.GetCountryImageByName(item.));
|
||||
competitionRankingItem.setHead(item.Headimage);
|
||||
competitionRankingItem.setCountry(item.CountryImg);
|
||||
competitionRankingItem.setDistance(item.Near.ToString() + "KM");
|
||||
bufferSize++;
|
||||
competitionRankingItem.transform.SetSiblingIndex(item.Index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,10 +9,13 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
private RawImage Head;
|
||||
private RawImage Country;
|
||||
private Image Background;
|
||||
private Text Name;
|
||||
private Text Speed;
|
||||
private Text Distance;
|
||||
private Text Ratio;//功体比
|
||||
private Text Rank;//当前排名
|
||||
private Text Timer;
|
||||
|
||||
private int _userId = 0;
|
||||
public int UserId { get { return _userId; } }
|
||||
@@ -22,25 +25,48 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
private string _speed = string.Empty;
|
||||
private string _distance = string.Empty;
|
||||
private string _ratio = string.Empty;
|
||||
public int rank { get; set; }
|
||||
private Texture countryTexture;
|
||||
CyclingController cyclingController;
|
||||
Color selectedColor = new Color(0.9764706f, 0.1882353f, 0.5254902f);
|
||||
Color unselectedColor = new Color(0.2078431f, 0.2078431f, 0.2627451f);
|
||||
private void Awake()
|
||||
{
|
||||
cyclingController = FindObjectOfType<CyclingController>();
|
||||
Background = transform.GetComponent<Image>();
|
||||
Head = transform.Find("Head").GetComponent<RawImage>();
|
||||
Country = transform.Find("Country").GetComponent<RawImage>();
|
||||
Name = transform.Find("Name").GetComponent<Text>();
|
||||
Speed = transform.Find("Speed").GetComponent<Text>();
|
||||
Distance = transform.Find("Distance").GetComponent<Text>();
|
||||
Ratio = transform.Find("Ratio").GetComponent<Text>();
|
||||
Rank = transform.Find("Rank").GetComponent<Text>();
|
||||
Timer = transform.Find("Timer")?.GetComponent<Text>();
|
||||
countryTexture = Resources.Load<Sprite>("Images/flag_China_Person").texture;
|
||||
UIManager.AddEvent(this.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, Watch);
|
||||
}
|
||||
private void Update()
|
||||
{
|
||||
if (cyclingController.currentPlayer.UserId == UserId)
|
||||
{
|
||||
Background.color = selectedColor;
|
||||
Ratio.color = Color.white;
|
||||
}
|
||||
else
|
||||
{
|
||||
Background.color = unselectedColor;
|
||||
}
|
||||
}
|
||||
|
||||
//切换到当前用户视角
|
||||
public void Watch(BaseEventData baseEventData)
|
||||
{
|
||||
cyclingController.ChangeCurrentPlayer(_userId);
|
||||
}
|
||||
public void setTimer(string timer)
|
||||
{
|
||||
Timer.text = timer;
|
||||
}
|
||||
public void setRatio(string ratio)
|
||||
{
|
||||
if (!_ratio.Equals(ratio))
|
||||
@@ -48,10 +74,16 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
Ratio.text = ratio;
|
||||
}
|
||||
}
|
||||
//设置当前排名
|
||||
public void SetRank(int rank)
|
||||
{
|
||||
Rank.text = rank.ToString().PadLeft(3,'0');
|
||||
this.rank = rank;
|
||||
}
|
||||
|
||||
public void setHead(string url)
|
||||
{
|
||||
if (!_headUrl.Equals(url))
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
Utils.DisplayImage(Head, url, true);
|
||||
var rect = ((RectTransform)Head.transform).rect;
|
||||
@@ -61,9 +93,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
}
|
||||
|
||||
public void setCountry(Texture texture)
|
||||
public void setCountry(string url)
|
||||
{
|
||||
Country.texture = texture;
|
||||
Utils.DisplayImage(Country, url, true);
|
||||
}
|
||||
public void setName(string name)
|
||||
{
|
||||
|
||||
@@ -28,8 +28,6 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
reviewPanel.SetActive(false);
|
||||
countDownPanel.SetActive(false);
|
||||
ShowCurrentRanking();
|
||||
miniMap.SetActive(false); //隐藏小地图
|
||||
viewButton.gameObject.SetActive(false);//隐藏切换视角
|
||||
}
|
||||
protected override void Update()
|
||||
{
|
||||
@@ -49,9 +47,13 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
competitionModel = mainController.cyclingController as CompetitionModel;
|
||||
}
|
||||
|
||||
|
||||
private void CountDown()
|
||||
{
|
||||
miniMap.SetActive(false); //隐藏小地图
|
||||
viewButton.gameObject.SetActive(false);//隐藏切换视角
|
||||
headPanel.SetActive(!mainController.isWatch); //隐藏海拔图观察者的头像
|
||||
|
||||
//比赛进行中
|
||||
if (competitionModel != null)
|
||||
{
|
||||
@@ -73,7 +75,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
countDownPanel.SetActive(false);
|
||||
}
|
||||
//显示结果
|
||||
if (competitionModel.mapCompetition?.HasRecord ?? false)
|
||||
var ishowResult = (competitionModel.mapCompetition?.HasRecord ?? false) || competitionModel.recorderData.Saved;
|
||||
if (ishowResult)
|
||||
{
|
||||
ShowResultList();
|
||||
}
|
||||
@@ -81,12 +84,15 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//显示关门时间
|
||||
if (s.Value.Item2)
|
||||
{
|
||||
//显示倒计时面板信息
|
||||
showCountDown(s.Value.Item1, "get the winner,end tance remains");
|
||||
if (s.Value.Item1 <= 0 && !mainController.cyclingController.recorderData.Saved)
|
||||
{
|
||||
//自动保存,游戏设置结束
|
||||
base.SaveRide(null);
|
||||
SaveRide(null);
|
||||
}
|
||||
else
|
||||
{
|
||||
//显示倒计时面板信息
|
||||
showCountDown(s.Value.Item1, "get the winner,end tance remains");
|
||||
}
|
||||
}
|
||||
else if (s.Value.Item1 > 0)
|
||||
@@ -94,6 +100,15 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//显示倒计时面板信息
|
||||
showCountDown(s.Value.Item1, "remaining");
|
||||
}
|
||||
////显示关门时间
|
||||
//if (s.Value.Item2 && s.Value.Item1 <= 0 && !mainController.cyclingController.recorderData.Saved)
|
||||
//{
|
||||
// //自动保存,游戏设置结束
|
||||
// SaveRide(null);
|
||||
//}
|
||||
//var title = s.Value.Item2 && s.Value.Item1 <= 0 ? "finish" : "remaining";
|
||||
////显示倒计时面板信息
|
||||
//showCountDown(s.Value.Item1, title);
|
||||
//显示当前比赛进行多长时间了
|
||||
timerTxt.text = competitionModel.ShowTime;
|
||||
}
|
||||
@@ -103,13 +118,25 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
countDownPanel.SetActive(true);
|
||||
title.text = text;
|
||||
timer.text = Helper.FormatTicks(count);
|
||||
if (count >= 0)
|
||||
{
|
||||
timer.text = Helper.FormatTicks(count);
|
||||
}
|
||||
}
|
||||
|
||||
public override void SaveRide(BaseEventData baseEventData)
|
||||
{
|
||||
if (!mainController.isQuit)
|
||||
{
|
||||
mainController.SetQuit();
|
||||
playerController.Upload();
|
||||
quitPanel.SetActive(false);
|
||||
}
|
||||
ShowResultList();//保存显示当前排名
|
||||
}
|
||||
|
||||
public override void ContinueRide()
|
||||
{
|
||||
MapCompetitionApi s = new MapCompetitionApi();
|
||||
_ = s.ApplyMapCompetition(App.CompetionId);
|
||||
mainController.SetCyclingModel(CyclingModel.Competition);
|
||||
}
|
||||
public override void PauseRide(BaseEventData baseEventData)
|
||||
@@ -120,9 +147,17 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
GameObject competitionRankingList;
|
||||
public void ShowCurrentRanking()
|
||||
{
|
||||
competitionRankingList = Instantiate(Resources.Load<GameObject>("UI/Prefab/Match/CompetitionRankingPanel"), transform.Find("Panel"));
|
||||
if (competitionRankingList == null)
|
||||
{
|
||||
competitionRankingList = Instantiate(Resources.Load<GameObject>("UI/Prefab/Match/CompetitionRankingPanel"), transform.Find("Panel"));
|
||||
}
|
||||
if (topRankPanel == null)
|
||||
{
|
||||
topRankPanel = Instantiate(Resources.Load<GameObject>("UI/Prefab/Match/TopRankPanel"), transform.Find("Panel"));
|
||||
}
|
||||
}
|
||||
GameObject competitionResultPanel;
|
||||
GameObject topRankPanel;
|
||||
//实时刷新显示比赛结果
|
||||
public void ShowResultList()
|
||||
{
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
using Assets.Scenes.Ride.Scripts.Model.CyclingModels;
|
||||
using Assets.Scripts;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class CompetitionWatcherFactory : MonoBehaviour
|
||||
{
|
||||
int pageIndex = 1;
|
||||
int pageSize = 8;
|
||||
CyclingController cyclingController;
|
||||
private void start()
|
||||
{
|
||||
cyclingController = FindObjectOfType<CyclingController>();
|
||||
}
|
||||
|
||||
float time = 1;
|
||||
private void Update()
|
||||
{
|
||||
time -= Time.deltaTime;
|
||||
while (time < 0)
|
||||
{
|
||||
Refresh();
|
||||
time = 1;
|
||||
}
|
||||
}
|
||||
|
||||
public void Refresh()
|
||||
{
|
||||
if (cyclingController.cyclingController is CompetitionModel model)
|
||||
{
|
||||
var list = model?.competitionRankingModel?.Results;
|
||||
if (list == null) return;
|
||||
var parent = transform.Find("ScrollView/Viewport/Content");
|
||||
Utils.DestroyChildren(parent);
|
||||
|
||||
var pagedList = list.Skip((pageIndex - 1) * pageSize).Take(pageSize).ToList();
|
||||
foreach (var item in pagedList)
|
||||
{
|
||||
var finalRankingItem = Instantiate(Resources.Load<GameObject>("UI/Prefab/Match/FinalRankingItem"), parent);
|
||||
var finalRankingItemScript = finalRankingItem.GetComponent<FinalRankingItemScript>();
|
||||
finalRankingItemScript.setRanking(item.Index.ToString());
|
||||
finalRankingItemScript.setHeartRate(item.HeartRate.ToString("f0"));
|
||||
finalRankingItemScript.setName(item.Name);
|
||||
finalRankingItemScript.setPower(item.Power.ToString());
|
||||
finalRankingItemScript.setRatio(item.WeightKg.ToString("f2"));
|
||||
finalRankingItemScript.setTimer(item.TripTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Close(BaseEventData baseEventData)
|
||||
{
|
||||
this.gameObject.SetActive(false);
|
||||
this.Destroy();
|
||||
//SceneManager.LoadScene("MainScene");
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab770f3fae92ac1478b8a7c28eccb895
|
||||
guid: 911cdbf2d21e6bc4f8713d8440ea06d5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -0,0 +1,90 @@
|
||||
using Assets.Scenes.Ride.Scripts.Model;
|
||||
using Assets.Scenes.Ride.Scripts.Model.CyclingModels;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class TopRankingFactory : BaseListFactory
|
||||
{
|
||||
private List<CompetitionRankingSortModel> rankingList {get;set;}
|
||||
private AbstractPlayer currentPlayer { get; set; }
|
||||
private int topSize = 6;//取前6名
|
||||
protected override void Awake()
|
||||
{
|
||||
//base.Awake();
|
||||
scroll = transform.Find("List").gameObject;
|
||||
if (scroll != null)
|
||||
{
|
||||
UIManager.AddEvent(scroll, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag);
|
||||
}
|
||||
parent = scroll.transform.Find("Viewport/Content");
|
||||
cyclingController = FindObjectOfType<CyclingController>();
|
||||
playerController = FindObjectOfType<PlayerController>();
|
||||
currentPlayer = cyclingController.currentPlayer;
|
||||
nearByItem = Resources.Load<GameObject>("UI/Prefab/Match/TopRankingItem");
|
||||
nearByMajorItem = Resources.Load<GameObject>("UI/Prefab/Match/CompetitionRankingMajorItem");
|
||||
}
|
||||
|
||||
protected override void CreateList()
|
||||
{
|
||||
CompetitionModel s = cyclingController.cyclingController as CompetitionModel;
|
||||
var ss = s?.competitionRankingModel;
|
||||
rankingList = ss?.Sorts;
|
||||
if (rankingList == null) return;
|
||||
var pagedList = rankingList.Take(topSize).ToList();
|
||||
for (int i = 0; i < pagedList.Count(); i++)
|
||||
{
|
||||
Create(pagedList[i]);
|
||||
}
|
||||
}
|
||||
private void Create(CompetitionRankingSortModel item)
|
||||
{
|
||||
////创建
|
||||
//GameObject prefabItem = item.IsSelf ? nearByMajorItem : nearByItem;
|
||||
//GameObject newObj = (GameObject)Instantiate(prefabItem, parent);
|
||||
//var competitionRankingItem = newObj.GetComponent<CompetitionRankingItem>();
|
||||
//competitionRankingItem.setUserId(item.UserId);
|
||||
//competitionRankingItem.setName(item.Name);
|
||||
//competitionRankingItem.setRatio(item.KGWeight+"W/KG");
|
||||
//competitionRankingItem.setSpeed(item.Speed.ToString() + "KM/H");
|
||||
////competitionRankingItem.setHead(item.Headimage);
|
||||
////competitionRankingItem.setCountry(cyclingController.GetCountryImageByName(item.));
|
||||
//competitionRankingItem.setDistance(item.Near.ToString() + "KM");
|
||||
////competitionRankingItem.setTimer(item.ti)
|
||||
//bufferSize++;
|
||||
|
||||
var rankingList = FindObjectsOfType<TopRankingItem>();
|
||||
var competitionRankingItem = rankingList.Where(c => c.UserId == item.UserId).FirstOrDefault();
|
||||
//如果当前有这个用户则更新没有则创建并setslibingindex
|
||||
if (competitionRankingItem == null)
|
||||
{
|
||||
//创建
|
||||
if (bufferSize < pageSize)
|
||||
{
|
||||
//情况一:还有足够的buffer,直接创建
|
||||
GameObject prefabItem = nearByItem;
|
||||
GameObject newObj = (GameObject)Instantiate(prefabItem, parent);
|
||||
competitionRankingItem = newObj.GetComponent<TopRankingItem>();
|
||||
bufferSize++;
|
||||
}
|
||||
else
|
||||
{
|
||||
//情况二:没有足够的buffer,找到要被淘汰的buffer()最后一名
|
||||
competitionRankingItem = rankingList.OrderByDescending(c => c.rank).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
competitionRankingItem.setUserId(item.UserId);
|
||||
competitionRankingItem.SetRank(item.Index);
|
||||
competitionRankingItem.setName(item.Name);
|
||||
competitionRankingItem.setRatio(item.KGWeight + "W/KG");
|
||||
competitionRankingItem.setSpeed(item.Speed.ToString() + "KM/H");
|
||||
competitionRankingItem.setHead(item.Headimage);
|
||||
competitionRankingItem.setCountry(item.CountryImg);
|
||||
competitionRankingItem.setDistance(item.Near.ToString() + "KM");
|
||||
competitionRankingItem.transform.SetSiblingIndex(item.Index);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d3903e9a2640d3447af0b98a0d6ce664
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,116 @@
|
||||
using Assets.Scripts;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class TopRankingItem : MonoBehaviour
|
||||
{
|
||||
private RawImage Head;
|
||||
private RawImage Country;
|
||||
private Image Background;
|
||||
private Text Name;
|
||||
private Text Speed;
|
||||
private Text Distance;
|
||||
private Text Ratio;//功体比
|
||||
private Text Rank;//当前排名
|
||||
private Text Timer;
|
||||
|
||||
private int _userId = 0;
|
||||
public int UserId { get { return _userId; } }
|
||||
private string _headUrl = string.Empty;
|
||||
private string _countryUrl = string.Empty;
|
||||
private string _name = string.Empty;
|
||||
private string _speed = string.Empty;
|
||||
private string _distance = string.Empty;
|
||||
private string _ratio = string.Empty;
|
||||
public int rank { get; set; }
|
||||
private Texture countryTexture;
|
||||
CyclingController cyclingController;
|
||||
private void Awake()
|
||||
{
|
||||
cyclingController = FindObjectOfType<CyclingController>();
|
||||
Background = transform.GetComponent<Image>();
|
||||
Head = transform.Find("Head").GetComponent<RawImage>();
|
||||
Country = transform.Find("Country").GetComponent<RawImage>();
|
||||
Name = transform.Find("Name").GetComponent<Text>();
|
||||
Speed = transform.Find("Speed").GetComponent<Text>();
|
||||
Distance = transform.Find("Distance").GetComponent<Text>();
|
||||
Ratio = transform.Find("Ratio").GetComponent<Text>();
|
||||
Rank = transform.Find("Rank").GetComponent<Text>();
|
||||
Timer = transform.Find("Timer")?.GetComponent<Text>();
|
||||
countryTexture = Resources.Load<Sprite>("Images/flag_China_Person").texture;
|
||||
var btn = this.gameObject.GetComponent<Button>();
|
||||
btn.onClick.AddListener(() =>
|
||||
{
|
||||
Watch();
|
||||
});
|
||||
///UIManager.AddEvent(this.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, Watch);
|
||||
}
|
||||
//切换到当前用户视角
|
||||
public void Watch()
|
||||
{
|
||||
cyclingController.ChangeCurrentPlayer(_userId);
|
||||
}
|
||||
public void setTimer(string timer)
|
||||
{
|
||||
Timer.text = timer;
|
||||
}
|
||||
public void setRatio(string ratio)
|
||||
{
|
||||
if (!_ratio.Equals(ratio))
|
||||
{
|
||||
Ratio.text = ratio;
|
||||
}
|
||||
}
|
||||
//设置当前排名
|
||||
public void SetRank(int rank)
|
||||
{
|
||||
Rank.text = rank.ToString();
|
||||
this.rank = rank;
|
||||
}
|
||||
|
||||
public void setHead(string url)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
Utils.DisplayImage(Head, url, true);
|
||||
var rect = ((RectTransform)Head.transform).rect;
|
||||
Material material = Instantiate(Resources.Load<Material>("UI/Material/RoundedCornersTextureMaterial"));
|
||||
material.SetVector(Shader.PropertyToID("_WidthHeightRadius"), new Vector4(rect.width, rect.height, rect.height, 0));
|
||||
Head.material = material;
|
||||
}
|
||||
}
|
||||
|
||||
public void setCountry(string url)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(url))
|
||||
{
|
||||
Utils.DisplayImage(Country, url, true);
|
||||
}
|
||||
}
|
||||
public void setName(string name)
|
||||
{
|
||||
if (!_name.Equals(name))
|
||||
Name.text = name;
|
||||
}
|
||||
|
||||
public void setSpeed(string speed)
|
||||
{
|
||||
if (!_speed.Equals(speed))
|
||||
Speed.text = speed;
|
||||
}
|
||||
|
||||
public void setDistance(string distance)
|
||||
{
|
||||
if (!_distance.Equals(distance))
|
||||
Distance.text = distance;
|
||||
}
|
||||
|
||||
public void setUserId(int userId)
|
||||
{
|
||||
_userId = userId;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2338fbdbfd33753468194151f9b88760
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -19,6 +19,8 @@ using UnityEngine.EventSystems;
|
||||
using UnityEngine.Events;
|
||||
using Assets.Scenes.Ride.Scripts.Model.RiderModels;
|
||||
using System.IO;
|
||||
using ChartAndGraph;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class CyclingController : DeviceServiceMonoBase
|
||||
{
|
||||
@@ -40,10 +42,10 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
private Vector2d coordiantes;//当前地图中心
|
||||
|
||||
public bool isStart;//当前游戏是否开始
|
||||
public CyclingModel cyclingModel;//当前骑行模式
|
||||
public CyclingModel cyclingModel { get; set; }//当前骑行模式
|
||||
public BaseCycling cyclingController { get; set; }
|
||||
private int routeId;
|
||||
private int competitionId;
|
||||
public int competitionId { get; set; }
|
||||
|
||||
private MapApi mapApi;
|
||||
public DateTime startTime;
|
||||
@@ -58,9 +60,10 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
var result = await new UserApi().Login("15261826280", "123456", "");
|
||||
App.CurrentUser = result.data;
|
||||
}
|
||||
GameObject miniMap;
|
||||
GameObject miniMap { get; set; }
|
||||
GameObject resultPanel;
|
||||
|
||||
public ChartDataSourceScript chartDataSourceScript { get; set; }
|
||||
public GraphChartBase graph { get; set; }
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
@@ -76,6 +79,12 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
//mapRoute = mapApi.GetById(routeId).data;
|
||||
//miniMap = transform.Find("MiniMap").gameObject;//小地图
|
||||
resultPanel = transform.Find("SingleUI/Panel/ResultPanel").gameObject;
|
||||
|
||||
//获取海拔图UI对象
|
||||
var graphObject = transform.Find("SingleUI/Panel/GraphChart");
|
||||
chartDataSourceScript = graphObject.GetComponent<ChartDataSourceScript>();
|
||||
graph = graphObject.GetComponent<GraphChartBase>();
|
||||
|
||||
competitionId = App.CompetionId;
|
||||
App.CompetionId = 0;//清空比赛参数
|
||||
}
|
||||
@@ -85,26 +94,34 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
App.TextureCache.Clear();
|
||||
}
|
||||
Transform target;
|
||||
|
||||
GameObject watcher;
|
||||
Transform uiParent;
|
||||
private void Start()
|
||||
{
|
||||
UIManager.Instance.MainPanel = this.transform.Find("SingleUI/Panel").GetComponent<PFUIPanel>();
|
||||
UIManager.Instance.ModalsPanel = this.transform.Find("SingleUI/ModalPanel").GetComponent<PFUIPanel>();
|
||||
onlineUserPrefab = Resources.Load<GameObject>("UI/Prefab/Ride/OnlinePlayer");
|
||||
miniMapPlayerPrefab = Resources.Load<GameObject>("UI/Prefab/Ride/MiniMapPlayer");
|
||||
|
||||
|
||||
|
||||
watcher = Resources.Load<GameObject>("UI/Prefab/Match/Watcher");
|
||||
target = transform.Find("Target");
|
||||
miniMap = transform.Find("MiniMap").gameObject;//小地图
|
||||
uiParent = transform.Find("SingleUI/Panel");
|
||||
//进入倒计时
|
||||
singleUIManager = UIObject.GetComponent<BaseUIManager>();
|
||||
TrailRenderer trail = player.GetComponent<TrailRenderer>();
|
||||
trail.Clear();
|
||||
playerController = player.GetComponent<PlayerController>();
|
||||
currentPlayer = playerController;//当前选中用户
|
||||
loadingController = transform.Find("LoadingCanvas").gameObject.AddComponent<LoadingController>();
|
||||
|
||||
|
||||
if (competitionId > 0)
|
||||
{
|
||||
loadingController = transform.Find("LoadingCanvas").gameObject.AddComponent<CompetitionLoadingController>();
|
||||
}
|
||||
else
|
||||
{
|
||||
loadingController = transform.Find("LoadingCanvas").gameObject.AddComponent<LoadingController>();
|
||||
}
|
||||
|
||||
//loadingController = FindObjectOfType<LoadingController>();
|
||||
//
|
||||
loadingController.InjectController(this);
|
||||
@@ -121,6 +138,17 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
return;
|
||||
}
|
||||
}
|
||||
float timer = 1f;
|
||||
private void Update()
|
||||
{
|
||||
//CamControl();
|
||||
timer -= Time.deltaTime;
|
||||
if (timer <= 0)//定时器 一秒执行一次
|
||||
{
|
||||
TcpHandler();
|
||||
timer = 1.0f;
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator Init()
|
||||
{
|
||||
@@ -133,6 +161,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
MapUDPService.Init();//初始化TCP
|
||||
loadingController.AddProcess(10);
|
||||
}
|
||||
public bool isWatch { get; set; }
|
||||
//初始比赛
|
||||
private IEnumerator InitRace()
|
||||
{
|
||||
@@ -142,9 +171,13 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
loadingController.AddProcess(10);
|
||||
InitRaceData();//初始化比赛数据
|
||||
InitRaceGameObject();//初始化比赛场景
|
||||
MapUDPService.Init();//初始化比赛TCP
|
||||
//MapUDPService.Init(competitionId,isWatch);//初始化比赛TCP
|
||||
loadingController.AddProcess(10);
|
||||
}
|
||||
public void InitTcp()
|
||||
{
|
||||
MapUDPService.Init(competitionId, isWatch);//初始化比赛TCP
|
||||
}
|
||||
|
||||
//初始化数据
|
||||
private void InitData()
|
||||
@@ -180,7 +213,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
|
||||
#endregion
|
||||
//异步请求mapbox画出当前路书路线图
|
||||
loadingController.DrawMapRoute(mapData);
|
||||
loadingController.DrawMapRouteAsync(mapRoute.Id);
|
||||
//计算上次骑行距离调整地图中心点
|
||||
double endDistance = selectParamModel.EndDistance;
|
||||
coordiantes = Along(endDistance);
|
||||
@@ -223,7 +256,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
|
||||
#endregion
|
||||
//异步请求mapbox画出当前路书路线图
|
||||
loadingController.DrawMapRoute(mapData);
|
||||
loadingController.DrawMapRouteAsync(mapRoute.Id);
|
||||
//计算上次骑行距离调整地图中心点
|
||||
double endDistance = selectParamModel.EndDistance;
|
||||
coordiantes = Along(endDistance);
|
||||
@@ -262,7 +295,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
player.SetActive(true);
|
||||
UIObject.SetActive(true);
|
||||
singleUIManager = UIObject.AddComponent<CompetitionUIManager>();
|
||||
miniMap.SetActive(true);
|
||||
//miniMap.SetActive(true);
|
||||
map.OnTileFinished += Map_OnTileFinished;
|
||||
mapPos = map.transform.position;
|
||||
//SetCyclingModel(CyclingModel.Competition);
|
||||
@@ -296,6 +329,8 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
}
|
||||
PlayerController playerController;
|
||||
public AbstractPlayer currentPlayer { get; set; }
|
||||
|
||||
private GameObject onlinePlayer { get; set; }
|
||||
public void ChangeCurrentPlayer(int userId)
|
||||
{
|
||||
var coll = FindObjectsOfType<AbstractPlayer>();
|
||||
@@ -304,6 +339,32 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
{
|
||||
currentPlayer = selectedPlayer;
|
||||
}
|
||||
//如果是3d地图,显示3d小人
|
||||
//if (Is3dView)
|
||||
//{
|
||||
// player.SetActive(true);
|
||||
// var playerscript = player.GetComponent<AbstractPlayer>();
|
||||
// playerscript = currentPlayer;
|
||||
//}
|
||||
//if (Is3dView)
|
||||
//{
|
||||
// onlinePlayer = Resources.Load<GameObject>("UI/Prefab/Ride/OnlinePlayer11");
|
||||
// var ob = Instantiate(onlinePlayer, transform);
|
||||
// ob.SetActive(true);
|
||||
// ob.transform.position = currentPlayer.currentPos;
|
||||
// //var on = ob.AddComponent<AbstractPlayer>();
|
||||
// //on = currentPlayer;
|
||||
//}
|
||||
}
|
||||
public void ChangeRandomPlayer()
|
||||
{
|
||||
var coll = FindObjectsOfType<AbstractPlayer>();
|
||||
var selectedPlayer = coll.FirstOrDefault();
|
||||
if (selectedPlayer != null)
|
||||
{
|
||||
currentPlayer = selectedPlayer;
|
||||
}
|
||||
//如果是3d地图,显示3d小人
|
||||
}
|
||||
//初始化人物位置角度
|
||||
private void InitPlayer()
|
||||
@@ -325,7 +386,12 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
playerController.currentRotation = neededRotation;
|
||||
//初始化海拔图头像位置
|
||||
var index = GetCurrentIndex(recorderData.EndDistance);
|
||||
playerController.InitGraph(index);
|
||||
InitGraph(index);
|
||||
//playerController.InitGraph(index);
|
||||
}
|
||||
public void InitGraph(int index)
|
||||
{
|
||||
chartDataSourceScript.InitHorizontalScrolling(index);
|
||||
}
|
||||
//SingleUIManager singleUIManager;
|
||||
BaseUIManager singleUIManager;
|
||||
@@ -349,6 +415,7 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
cyclingController.Run(null);
|
||||
//在线人物或比赛人物渲染
|
||||
ShowOnlineUsers();
|
||||
ShowWatchers();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,6 +462,13 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
{
|
||||
currentUser.SetDataSource(onlineTotalDistance, onlineDistance, onlineRider.NickName, onlineRider.WeightKg, index);
|
||||
}
|
||||
//如果是观察者且当前第一此进入场景(TODO:这样切换会闪一下待解决)
|
||||
if (isWatch && currentPlayer is PlayerController)
|
||||
{
|
||||
var userId = onlineRiders.FirstOrDefault()?.UserId??0;
|
||||
ChangeCurrentPlayer(userId);
|
||||
}
|
||||
//显示观察者头像
|
||||
}
|
||||
if(onlineRiders.Count > 0)
|
||||
messageIndex++;
|
||||
@@ -421,6 +495,25 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
if (bakePlayer != null)
|
||||
bakePlayer.IsShowInfo = true;
|
||||
}
|
||||
GameObject watcherList;
|
||||
//当前比赛观看者
|
||||
private void ShowWatchers()
|
||||
{
|
||||
if (watcherList == null)
|
||||
{
|
||||
watcherList = Resources.Load<GameObject>("UI/Prefab/Match/WatcherPanel");
|
||||
watcherList = Instantiate(watcherList, uiParent);
|
||||
}
|
||||
var content = watcherList.transform.Find("List/Viewport/Content");
|
||||
var watchList = MapUDPService.GetCompetitionWatchers(competitionId);
|
||||
Utils.DestroyChildren(content);
|
||||
foreach (var item in watchList)
|
||||
{
|
||||
var head = Instantiate(watcher, content);
|
||||
var headiamge = head.GetComponent<RawImage>();
|
||||
Utils.DisplayImage(headiamge, item.HeadImage, true);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void SetUIManager(PFUIPanel mainPanel, PFUIPanel model)
|
||||
@@ -613,11 +706,14 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
cyclingController.recorderData.ManufacturerId = ManufacturerId;
|
||||
cyclingController.recorderData.ManufacturerName = ManufacturerName;
|
||||
cyclingController.recorderData.DeviceNumber = DeviceNumber;
|
||||
//显示骑行结果
|
||||
resultPanel.SetActive(true);
|
||||
var rs = resultPanel.GetComponent<ResultPanelScript>();
|
||||
rs.InjectController(this);
|
||||
rs.SetDataSource(cyclingController.recorderData);
|
||||
//显示骑行结果(如果是比赛模式显示比赛最终排名)
|
||||
if (cyclingModel != CyclingModel.Competition)
|
||||
{
|
||||
resultPanel.SetActive(true);
|
||||
var rs = resultPanel.GetComponent<ResultPanelScript>();
|
||||
rs.InjectController(this);
|
||||
rs.SetDataSource(cyclingController.recorderData);
|
||||
}
|
||||
cyclingController.recorderData.SaveWithLocalRecordAysnc(cyclingModel, selectParamModel, imageFileName, recordId, path);
|
||||
}
|
||||
|
||||
@@ -667,7 +763,9 @@ public class CyclingController : DeviceServiceMonoBase
|
||||
for (int i = 0; i < pointList.Count; i++)
|
||||
{
|
||||
sumDistance += pointList[i].Distance;
|
||||
if (endDistance * 1000 <= sumDistance)
|
||||
decimal left = (decimal)(endDistance * 1000);
|
||||
decimal right = (decimal)sumDistance;
|
||||
if (left <= right)
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
|
||||
@@ -151,7 +151,8 @@ namespace Assets.Scenes.Ride.Scripts.Model.CyclingModels
|
||||
Speed = Math.Round(item.Speed, 1),
|
||||
CountryImg = ConfigHelper.Host + $"User/GetCountryImg?userid={ item.Id }",
|
||||
UserId = item.Id,
|
||||
IsSelf = item.IsSelf
|
||||
IsSelf = item.IsSelf,
|
||||
Headimage =item.HeadImage
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -347,6 +347,9 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
public int V { get; set; }
|
||||
public string Encoding { get; set; }
|
||||
public string Client { get; set; }
|
||||
public int MemberId { get; set; }
|
||||
public int Competitionid { get; set; }
|
||||
public bool IsWatch { get; set; }
|
||||
}
|
||||
|
||||
public class ReceiveMsgModel
|
||||
@@ -390,6 +393,8 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
|
||||
public bool Saved { get; set; }
|
||||
|
||||
public string WatchIdList { get; set; }
|
||||
|
||||
|
||||
public static ReceiveMsgModel Parse(string str)
|
||||
{
|
||||
@@ -485,6 +490,10 @@ namespace Assets.Scenes.Ride.Scripts.Model
|
||||
/// </summary>
|
||||
public bool IsCompleted { get; set; }
|
||||
|
||||
public bool IsWatcher { get; set; }
|
||||
|
||||
public List<int> WatcherList { get; set; }
|
||||
|
||||
public double PreDistance { get; set; }
|
||||
/// <summary>
|
||||
/// 最后距离
|
||||
|
||||
@@ -1,21 +1,34 @@
|
||||
using Assets.Scenes.Ride.Scripts.Model;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class NearByFactory : BaseListFactory
|
||||
{
|
||||
private Text Title { get; set; }
|
||||
private Text OnlineUserNum { get; set; }
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
scroll = transform.Find("NearByScrollView").gameObject;
|
||||
if (scroll != null)
|
||||
{
|
||||
UIManager.AddEvent(scroll, UnityEngine.EventSystems.EventTriggerType.EndDrag, OnEndDrag);
|
||||
}
|
||||
parent = scroll.transform.Find("Viewport/Content");
|
||||
cyclingController = FindObjectOfType<CyclingController>();
|
||||
playerController = FindObjectOfType<PlayerController>();
|
||||
nearByItem = Resources.Load<GameObject>("UI/Prefab/Ride/NearbyItem");
|
||||
nearByMajorItem = Resources.Load<GameObject>("UI/Prefab/Ride/NearbyMajorItem");
|
||||
|
||||
Title = transform.Find("Title").GetComponent<Text>();
|
||||
OnlineUserNum = transform.Find("NearByView/OnlineUserNum").GetComponent<Text>();
|
||||
pageSize = 999;//开启无线下拉
|
||||
}
|
||||
protected override void CreateList()
|
||||
{
|
||||
OnlineUserNum.text = MapUDPService.GetNearRiderCount().ToString();
|
||||
var nearList = MapUDPService.GetNearRiderData(pageIndex, pageSize, new double[] { playerController.Currentlatlong.x, playerController.Currentlatlong.y });
|
||||
totalPages = MapUDPService.GetNearRiderCount();
|
||||
for (int i = 0; i < nearList.Count(); i++)
|
||||
@@ -25,18 +38,47 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
private void Create(NearRiderModel item)
|
||||
{
|
||||
//创建
|
||||
GameObject prefabItem = item.IsSelf ? nearByMajorItem : nearByItem;
|
||||
GameObject newObj = (GameObject)Instantiate(prefabItem, transform);
|
||||
var nearByItemscript = newObj.GetComponent<NearByItemScript>();
|
||||
////创建
|
||||
//GameObject prefabItem = item.IsSelf ? nearByMajorItem : nearByItem;
|
||||
//GameObject newObj = (GameObject)Instantiate(prefabItem, parent);
|
||||
//var nearByItemscript = newObj.GetComponent<NearByItemScript>();
|
||||
//nearByItemscript.setUserId(item.Id);
|
||||
//nearByItemscript.setName(item.Name);
|
||||
//nearByItemscript.setRatio(item.KGWeight+"W/KG");
|
||||
//nearByItemscript.setSpeed(item.Speed.ToString() + "KM/H");
|
||||
//nearByItemscript.setHead(item.Headimage);
|
||||
//nearByItemscript.setCountry(cyclingController.GetCountryImageByName(item.Country));
|
||||
//nearByItemscript.setDistance(item.Near.ToString() + "KM");
|
||||
//bufferSize++;
|
||||
var rankingList = FindObjectsOfType<NearByItemScript>();
|
||||
var nearByItemscript = rankingList.Where(c => c.UserId == item.Id).FirstOrDefault();
|
||||
//如果当前有这个用户则更新没有则创建并setslibingindex
|
||||
if (nearByItemscript == null)
|
||||
{
|
||||
//创建
|
||||
if (bufferSize < pageSize)
|
||||
{
|
||||
//情况一:还有足够的buffer,直接创建
|
||||
GameObject prefabItem = item.IsSelf ? nearByMajorItem : nearByItem;
|
||||
GameObject newObj = (GameObject)Instantiate(prefabItem, parent);
|
||||
nearByItemscript = newObj.GetComponent<NearByItemScript>();
|
||||
bufferSize++;
|
||||
}
|
||||
else
|
||||
{
|
||||
//情况二:没有足够的buffer,找到要被淘汰的buffer()最后一名
|
||||
nearByItemscript = rankingList.OrderByDescending(c => c.distance).FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
nearByItemscript.setUserId(item.Id);
|
||||
nearByItemscript.setName(item.Name);
|
||||
nearByItemscript.setRatio(item.KGWeight+"W/KG");
|
||||
nearByItemscript.setRatio(item.KGWeight + "W/KG");
|
||||
nearByItemscript.setSpeed(item.Speed.ToString() + "KM/H");
|
||||
nearByItemscript.setHead(item.Headimage);
|
||||
nearByItemscript.setCountry(cyclingController.GetCountryImageByName(item.Country));
|
||||
nearByItemscript.setDistance(item.Near.ToString() + "KM");
|
||||
bufferSize++;
|
||||
nearByItemscript.transform.SetSiblingIndex((int)item.Near);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class NearByHeadScript :MonoBehaviour
|
||||
{
|
||||
private Text Title;
|
||||
private Text OnlineUserNum;
|
||||
private void Start()
|
||||
{
|
||||
//Title = transform.Find("Title").GetComponent<Text>();
|
||||
//OnlineUserNum = transform.Find("NearByView/OnlineUserNum").GetComponent<Text>();
|
||||
}
|
||||
float t = 1;
|
||||
private void Update()
|
||||
{
|
||||
t -= Time.deltaTime;
|
||||
while (t < 0)
|
||||
{
|
||||
//OnlineUserNum.text = MapUDPService.GetNearRiderCount().ToString();
|
||||
t = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
private string _speed = string.Empty;
|
||||
private string _distance = string.Empty;
|
||||
private string _ratio = string.Empty;
|
||||
public double distance { get; set; }
|
||||
private Texture countryTexture;
|
||||
private void Awake()
|
||||
{
|
||||
|
||||
@@ -44,10 +44,12 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
/// <summary>
|
||||
/// 初始化(如果UDP服务未启动,则会已没5秒一次不断尝试,直到连接上为止,前端不需要考虑任何UDP连接的事情)
|
||||
/// </summary>
|
||||
public static void Init()
|
||||
public static void Init(int competitionid = 0, bool isWatch = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
Competitionid = competitionid;
|
||||
IsWatch = isWatch;
|
||||
//var ddd = new MapWorkoutService().GetRealOnlineUserInfo(new List<int> { 6 });
|
||||
isExit = false;
|
||||
Pause = false;
|
||||
@@ -148,7 +150,9 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
Console.WriteLine("发送心跳失败:" + e);
|
||||
}
|
||||
}
|
||||
public static int Competitionid { get; set; }
|
||||
|
||||
public static bool IsWatch { get; set; }
|
||||
/// <summary>
|
||||
/// 告诉TCP服务器给我Gzip的格式
|
||||
/// </summary>
|
||||
@@ -161,7 +165,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
CommandType = 2,
|
||||
V = 2,
|
||||
Encoding = "gzip",
|
||||
Client = App.AppVersion
|
||||
Client = App.AppVersion,
|
||||
MemberId = App.CurrentUser.Id,
|
||||
Competitionid = Competitionid,
|
||||
IsWatch = IsWatch
|
||||
};
|
||||
var sendBytes = Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(model));
|
||||
_udpService.Send(sendBytes, sendBytes.Length);
|
||||
@@ -271,7 +278,13 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//比赛中的人只能看到当前比赛的人
|
||||
public static List<OnlineUser> GetCompetitionOnlineUsers(int competitionId)
|
||||
{
|
||||
var result = onlineUserHelper.OnlineUsers.Where(u => u.CompetitionId == competitionId).ToList();
|
||||
var result = onlineUserHelper.OnlineUsers.Where(u => u.CompetitionId == competitionId && !u.IsWatcher).ToList();
|
||||
return result;
|
||||
}
|
||||
//当前比赛观察者
|
||||
public static List<OnlineUser> GetCompetitionWatchers(int competitionId,int size = 5)
|
||||
{
|
||||
var result = onlineUserHelper.OnlineUsers.Where(u => u.CompetitionId == competitionId && u.IsWatcher).Take(size).ToList();
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -378,6 +391,15 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
user.PreDistance = item.PreDistance;
|
||||
user.CompetitionId = item.Competitionid;
|
||||
user.Saved = item.Saved;
|
||||
user.WatcherList = new List<int>();
|
||||
foreach (var o in item.WatchIdList.Split('|'))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(o))
|
||||
{
|
||||
user.WatcherList.Add(Convert.ToInt32(o));
|
||||
}
|
||||
}
|
||||
user.IsWatcher = user.WatcherList.Contains(item.MemberId);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -131,17 +131,39 @@ namespace Assets.Scenes.Ride.Scripts.Network
|
||||
{
|
||||
//解压 temp
|
||||
var uncompressStr = Decompress(Convert.FromBase64String(temp));
|
||||
#if UNITY_EDITOR
|
||||
Console.WriteLine(uncompressStr);
|
||||
#endif
|
||||
var list = new List<ReceiveMsgModel>();
|
||||
var itemList = uncompressStr.Split('|');
|
||||
|
||||
temp = "";
|
||||
|
||||
foreach (var obj in itemList)
|
||||
//数据解析 l{},w{1|2|3|4} l:列表 w:观察者模式
|
||||
var arr = uncompressStr.Split(';');
|
||||
foreach (var t in arr)
|
||||
{
|
||||
var info = ReceiveMsgModel.Parse(obj);
|
||||
if (info != null)
|
||||
//列表
|
||||
if (t.IndexOf('l') == 0)
|
||||
{
|
||||
list.Add(info);
|
||||
var l = t.Replace("l{", "").Replace("}", "");
|
||||
var itemList = l.Split('|');
|
||||
temp = "";
|
||||
|
||||
foreach (var obj in itemList)
|
||||
{
|
||||
var info = ReceiveMsgModel.Parse(obj);
|
||||
if (info != null)
|
||||
{
|
||||
list.Add(info);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//观察者
|
||||
if (t.IndexOf('w') == 0)
|
||||
{
|
||||
var w = t.Replace("w{", "").Replace("}", "");
|
||||
foreach (var o in list)
|
||||
{
|
||||
o.WatchIdList = w;
|
||||
}
|
||||
}
|
||||
}
|
||||
_action(list);
|
||||
|
||||
@@ -45,8 +45,14 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
protected override void Compute()
|
||||
{
|
||||
currentlatlong = mainController.Along(totalDistance);//下一个坐标
|
||||
|
||||
diff = Math.Round((totalDistance - _playerController.TotalDistance) * 1000, 0);
|
||||
if (_playerController != null)
|
||||
{
|
||||
diff = Math.Round((totalDistance - _playerController.TotalDistance) * 1000, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
diff = 0;
|
||||
}
|
||||
}
|
||||
double diff = 0;
|
||||
public void SetDataSource(double _totalDistance, double _distance,string Name,double weightKg,int index=0)
|
||||
@@ -97,7 +103,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
|
||||
public void RemoveSelf()
|
||||
{
|
||||
arrowImage.gameObject?.Destroy();
|
||||
arrowImage?.gameObject?.Destroy();
|
||||
headPanel?.Destroy();
|
||||
infoPanel?.Destroy();
|
||||
transform.gameObject.Destroy();
|
||||
@@ -107,7 +113,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
var playerScreenPos = Camera.main.WorldToScreenPoint(transform.position);
|
||||
//如果是比赛模式头像
|
||||
if (mainController.cyclingController.Mode == CyclingModel.Competition)
|
||||
if (mainController.cyclingModel == CyclingModel.Competition)
|
||||
{
|
||||
playerScreenPos.y += 10f;
|
||||
}
|
||||
@@ -162,10 +168,22 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
|
||||
protected override void MoveGraphHead()
|
||||
{
|
||||
if (mainController.cyclingModel == CyclingModel.Competition)
|
||||
{
|
||||
MoveGraghHead4Race();
|
||||
}
|
||||
else
|
||||
{
|
||||
MoveHead();
|
||||
}
|
||||
}
|
||||
|
||||
private void MoveHead()
|
||||
{
|
||||
var itemIndex = chartDataSourceScript.GetViewIndex(CurrentIndex);
|
||||
var m = graph.DataSource.GetPoint("Player 2", itemIndex);
|
||||
|
||||
|
||||
graph.PointToWorldSpace(out Vector3 itemPosition, m.x, m.y, "Player 2");
|
||||
itemPosition.x -= 12f;
|
||||
itemPosition.y += 5f;
|
||||
@@ -196,5 +214,20 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void MoveGraghHead4Race()
|
||||
{
|
||||
MoveHead();
|
||||
var rect = ((RectTransform)(headPanel.transform));
|
||||
//如果切换到当前用户,当前用户头像变大
|
||||
if (mainController.currentPlayer.UserId == UserId)
|
||||
{
|
||||
rect.DOScale(new Vector3(1.5f, 1.5f, 1.5f), 0.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
rect.DOScale(new Vector3(1f, 1f, 1f), 0.5f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -112,19 +112,19 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
_Lon = currentlatlong.y,
|
||||
_TotalClimb = totalClimb,
|
||||
};
|
||||
|
||||
recorderData.PreDistance = targetData._Distance - Distance;
|
||||
recorderData.EndDistance = targetData._Distance;
|
||||
var preDistance = totalDistance >= mapData.TotalDistance ? targetData._Distance : targetData._Distance - Distance;
|
||||
recorderData.PreDistance = Math.Round(preDistance,6,MidpointRounding.AwayFromZero);
|
||||
recorderData.EndDistance = Math.Round(targetData._Distance,6,MidpointRounding.AwayFromZero);
|
||||
recorderData.RiderDatas.Add(targetData);
|
||||
}
|
||||
|
||||
}
|
||||
protected override void BeforeRun()
|
||||
{
|
||||
if (mainController != null)
|
||||
{
|
||||
mainController.TcpHandler();
|
||||
}
|
||||
//if (mainController != null)
|
||||
//{
|
||||
// mainController.TcpHandler();
|
||||
//}
|
||||
}
|
||||
|
||||
//上传数据
|
||||
@@ -137,10 +137,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void InitGraph(int index)
|
||||
{
|
||||
chartDataSourceScript.InitHorizontalScrolling(index);
|
||||
}
|
||||
//public void InitGraph(int index)
|
||||
//{
|
||||
// chartDataSourceScript.InitHorizontalScrolling(index);
|
||||
//}
|
||||
//移动海拔图头像
|
||||
protected override void MoveGraphHead()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user