移除xcharts和细节调整
This commit is contained in:
1 parent
b71a15e2ba
commit
6d45d052a0
511 files changed
+5342
-1941568
No files matched your search
@@ -1,16 +1,12 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using XCharts;
|
||||
using XUGL;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using Mapbox.Unity.Map;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using Assets.Scenes.Ride.Scripts.Model;
|
||||
using UnityEngine.SceneManagement;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine.EventSystems;
|
||||
using ChartAndGraph;
|
||||
using Assets.Scripts;
|
||||
@@ -63,8 +59,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
Button cancelQuitButton;//退出panel取消按钮
|
||||
Button closeQuitButton;//退出panel关闭按钮
|
||||
|
||||
LineChart elevationChart;//海拔图
|
||||
RawImage img;//海拔图头像
|
||||
RawImage head;//海拔图头像
|
||||
RawImage miniMap;//小地图
|
||||
RawImage altitudeGraph;//海拔图
|
||||
Image leftImage;
|
||||
@@ -88,6 +83,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
Button alertCloseBtn;
|
||||
Text preSlopeText;
|
||||
GameObject startPanel;
|
||||
GameObject headPanel;
|
||||
GameObject settingPanel;
|
||||
void Awake()
|
||||
{
|
||||
#region 控件获取与事件绑定
|
||||
@@ -118,7 +115,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
mapName = transform.Find("Panel/TitlePanel/MapName").GetComponent<Text>();
|
||||
totalClimb = transform.Find("Panel/ComputerPanel/TotalClimbView/TotalClimb").GetComponent<Text>();
|
||||
//img = transform.Find("Panel/ElevationChart/HeadImage").GetComponent<RawImage>();
|
||||
img = transform.Find("Panel/GraphChart/Head").GetComponent<RawImage>();
|
||||
head = transform.Find("Panel/GraphChart/HeadPanel/Head").GetComponent<RawImage>();
|
||||
headPanel = transform.Find("Panel/GraphChart/HeadPanel").gameObject;
|
||||
t = transform.Find("Panel/GraphChart/Button");
|
||||
miniMap = transform.Find("Panel/MiniMap").GetComponent<RawImage>();
|
||||
|
||||
@@ -143,7 +141,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
altitudeGraph = transform.Find("Panel/TitlePanel/AltitudeGraph").GetComponent<RawImage>();
|
||||
leftImage = transform.Find("Panel/TitlePanel/Left").GetComponent<Image>();
|
||||
rightImage = transform.Find("Panel/TitlePanel/Right").GetComponent<Image>();
|
||||
|
||||
settingPanel = transform.Find("Panel/SettingPanel").gameObject;
|
||||
preSlopeText = transform.Find("Panel/PreSlopePanel/PreSlopeText").GetComponent<Text>();
|
||||
|
||||
target = transform.parent.Find("Target").gameObject;
|
||||
@@ -271,7 +269,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
//控制照片移动
|
||||
((RectTransform)arrow.transform).position = Camera.main.WorldToScreenPoint(target.transform.position);
|
||||
if (playerController.Distance > 0 && mainController.isStart)
|
||||
if (playerController.Speed > 0 && mainController.isStart)
|
||||
{
|
||||
arrow.transform.Find("bg").gameObject.SetActive(true);
|
||||
}
|
||||
@@ -420,6 +418,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//显示设置
|
||||
private void ShowSettingPanel(BaseEventData baseEventData)
|
||||
{
|
||||
settingPanel.SetActive(true);
|
||||
}
|
||||
int isSimple = 1;
|
||||
private bool clearLock = true;
|
||||
@@ -463,13 +462,10 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
chartDataSourceScript = transform.Find("Panel/GraphChart").GetComponent<ChartDataSourceScript>();
|
||||
graph = transform.Find("Panel/GraphChart").GetComponent<GraphChartBase>();
|
||||
chartDataSourceScript.SetDataSource(dd.ToArray());
|
||||
////初始化头像坐标
|
||||
//var n = graph.DataSource.GetPoint("Player 2", 0);
|
||||
//graph.PointToWorldSpace(out Vector3 nextPosition, n.x, n.y, "Player 2");
|
||||
//img.transform.DOMove(new Vector3(nextPosition.x, nextPosition.y, 0), 1);
|
||||
|
||||
if (App.CurrentUser != null)
|
||||
{
|
||||
Utils.DisplayImage(StartCoroutine, img, App.CurrentUser.WxHeadImg);
|
||||
Utils.DisplayImage(StartCoroutine, head, App.CurrentUser.WxHeadImg);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -486,8 +482,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
//移动当前用户头像
|
||||
private void MoverCurrentUserHead()
|
||||
{
|
||||
Vector3 prePos = img.transform.position;
|
||||
int nextIndex = playerController.CurrentIndex;
|
||||
Vector3 prePos = headPanel.transform.position;
|
||||
int nextIndex = playerController.CurrentIndex +1;
|
||||
var viewIndex = chartDataSourceScript.GetViewIndex(nextIndex);
|
||||
if (!mainController.isStart && !mainController.isPause && !mainController.isQuit)//未开始未暂停未结束
|
||||
{
|
||||
@@ -504,13 +500,13 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
var distance = playerController.Distance;
|
||||
var offset = currentDistance > 0 ? distance * 1000 / currentDistance : 1;
|
||||
graph.HorizontalScrolling += offset;
|
||||
img.transform.DOMove(new Vector3(prePos.x, nextPosition.y, 0), 1);
|
||||
headPanel.transform.DOMove(new Vector3(prePos.x, nextPosition.y, 0), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
img.transform.DOMove(new Vector3(nextPosition.x , nextPosition.y, 0), 1);
|
||||
headPanel.transform.DOMove(new Vector3(nextPosition.x , nextPosition.y, 0), 1);
|
||||
}
|
||||
img.transform.SetSiblingIndex(999);
|
||||
headPanel.transform.SetSiblingIndex(999);
|
||||
}
|
||||
//移动其他骑手头像
|
||||
private void MoveOtherHeads()
|
||||
@@ -518,7 +514,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
var others = FindObjectsOfType<OtherPlayerController>();
|
||||
foreach (var item in others)
|
||||
{
|
||||
var itemIndex = chartDataSourceScript.GetViewIndex(item.CurrentIndex);
|
||||
var itemIndex = chartDataSourceScript.GetViewIndex(item.CurrentIndex) + 1;
|
||||
if (!mainController.isStart && !mainController.isPause && !mainController.isQuit)//未开始未暂停未结束
|
||||
{
|
||||
itemIndex = 0;
|
||||
|
||||
Reference in new issue
Block a user