2021-03-25 16:22:09 +08:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using UnityEngine.UI;
|
2021-03-28 18:17:15 +08:00
|
|
|
|
using XCharts;
|
|
|
|
|
|
using XUGL;
|
|
|
|
|
|
using System.Linq;
|
2021-03-29 20:32:30 +08:00
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using Mapbox.Unity.Map;
|
|
|
|
|
|
using DG.Tweening;
|
2021-03-30 17:15:16 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using Assets.Scenes.Ride.Scripts.Model;
|
2021-04-02 19:17:23 +08:00
|
|
|
|
using UnityEngine.SceneManagement;
|
2021-04-07 17:22:45 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using Assets.Cyp.Common;
|
2021-04-15 10:13:01 +08:00
|
|
|
|
using System.Threading.Tasks;
|
2021-04-19 14:38:31 +08:00
|
|
|
|
using UnityEngine.EventSystems;
|
2021-04-23 19:28:35 +08:00
|
|
|
|
using ChartAndGraph;
|
2021-03-25 16:22:09 +08:00
|
|
|
|
|
|
|
|
|
|
namespace Assets.Scenes.Ride.Scripts
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2021-04-02 19:17:23 +08:00
|
|
|
|
public class SingleUIManager : MonoBehaviour
|
2021-03-25 16:22:09 +08:00
|
|
|
|
{
|
2021-03-30 17:15:16 +08:00
|
|
|
|
#region UI control
|
2021-04-15 10:13:01 +08:00
|
|
|
|
GameObject target;
|
2021-04-21 14:08:45 +08:00
|
|
|
|
GameObject nearByPanel;//附近的人列表
|
|
|
|
|
|
GameObject leftPanel;//伴侣骑行列表
|
2021-03-31 20:46:57 +08:00
|
|
|
|
GameObject nextSlopePanel;//下一个坡度面板
|
|
|
|
|
|
GameObject currentSlopePanel;//当前坡度面板
|
2021-04-15 10:13:01 +08:00
|
|
|
|
GameObject selectPanel;//骑行模式选择
|
|
|
|
|
|
GameObject selectPlayer;//伴侣骑行选择窗口
|
|
|
|
|
|
GameObject reviewPanel;
|
|
|
|
|
|
GameObject titlePanel;
|
|
|
|
|
|
GameObject quitPanel;//退出界面
|
|
|
|
|
|
|
2021-03-31 20:46:57 +08:00
|
|
|
|
Text nextSlopeText;//下一个坡度
|
|
|
|
|
|
Text nextSlopeDistanceText;//下一个坡度距离
|
|
|
|
|
|
Text currentSlopeText;//当前坡度
|
2021-04-15 10:13:01 +08:00
|
|
|
|
Text currentSlopeDistanceText;//当前坡度已骑行距离
|
|
|
|
|
|
Text currentSlopeToatalDistanceText;//当前坡度总距离
|
2021-03-30 17:15:16 +08:00
|
|
|
|
Text speedTxt;//当前速度
|
|
|
|
|
|
Text powerTxt;//功率
|
|
|
|
|
|
Text timerTxt;//计时器
|
2021-04-15 10:13:01 +08:00
|
|
|
|
Text ditance;//当前骑行距离
|
|
|
|
|
|
Text totalDistance;//当前骑行距离
|
|
|
|
|
|
Text candance;//踏频
|
|
|
|
|
|
Text heartRate;//心率
|
2021-03-30 17:15:16 +08:00
|
|
|
|
Text countDownTxt;//倒计时5s
|
2021-04-02 19:17:23 +08:00
|
|
|
|
Text mapName;//路书名称
|
2021-04-15 10:13:01 +08:00
|
|
|
|
Text fps;//fps
|
|
|
|
|
|
Text totalClimb;
|
|
|
|
|
|
|
|
|
|
|
|
Button startBtn;//开始按钮
|
|
|
|
|
|
Button simpleBtn;//进入简约模式按钮
|
|
|
|
|
|
Button pauseButton;//暂停按钮
|
|
|
|
|
|
Button settingButton;//设置那妞
|
|
|
|
|
|
Button deviceButton;//设备按钮
|
2021-04-21 14:08:45 +08:00
|
|
|
|
Button viewButton;//视角按钮
|
2021-04-15 10:13:01 +08:00
|
|
|
|
Button exitButton;//退出按钮
|
|
|
|
|
|
Button singleButton;//单人骑行按钮
|
|
|
|
|
|
Button shadowButton;//影子选手按钮
|
|
|
|
|
|
Button addButton;//添加伴侣骑行
|
|
|
|
|
|
Button saveButton;//退出panel保存按钮
|
|
|
|
|
|
Button cancelQuitButton;//退出panel取消按钮
|
|
|
|
|
|
Button closeQuitButton;//退出panel关闭按钮
|
|
|
|
|
|
|
|
|
|
|
|
LineChart elevationChart;//海拔图
|
|
|
|
|
|
RawImage img;//海拔图头像
|
2021-04-21 14:08:45 +08:00
|
|
|
|
RawImage miniMap;//小地图
|
2021-04-23 19:28:35 +08:00
|
|
|
|
RawImage altitudeGraph;//海拔图
|
2021-03-30 17:15:16 +08:00
|
|
|
|
#endregion
|
2021-03-28 18:17:15 +08:00
|
|
|
|
|
2021-03-30 17:15:16 +08:00
|
|
|
|
#region 控制器
|
|
|
|
|
|
|
2021-04-12 17:35:56 +08:00
|
|
|
|
public PlayerController playerController;//当前用户
|
|
|
|
|
|
public CyclingController mainController;//主控制器
|
2021-03-30 17:15:16 +08:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
2021-03-29 20:32:30 +08:00
|
|
|
|
|
2021-03-25 16:22:09 +08:00
|
|
|
|
private float timeRemaining = 1f;
|
|
|
|
|
|
private int count = 0;
|
2021-04-19 14:38:31 +08:00
|
|
|
|
Image arrow;
|
|
|
|
|
|
AbstractMap map;
|
2021-04-23 19:28:35 +08:00
|
|
|
|
Transform t;
|
2021-04-25 13:33:43 +08:00
|
|
|
|
GameObject alertPanel;
|
|
|
|
|
|
Button alertBtn;
|
|
|
|
|
|
Button alertCloseBtn;
|
|
|
|
|
|
Text preSlopeText;
|
2021-03-28 18:17:15 +08:00
|
|
|
|
void Awake()
|
|
|
|
|
|
{
|
2021-04-15 10:13:01 +08:00
|
|
|
|
#region 控件获取与事件绑定
|
|
|
|
|
|
fps = transform.Find("Panel/FPS").GetComponent<Text>();
|
2021-04-19 14:38:31 +08:00
|
|
|
|
arrow = transform.Find("Panel/Arrow").GetComponent<Image>();
|
|
|
|
|
|
map = transform.parent.Find("Map").GetComponent<AbstractMap>();
|
2021-04-12 17:35:56 +08:00
|
|
|
|
leftPanel = transform.Find("Panel/ReviewPanel").gameObject;
|
2021-04-21 14:08:45 +08:00
|
|
|
|
nearByPanel = transform.Find("Panel/NearPanel").gameObject;
|
2021-04-12 17:35:56 +08:00
|
|
|
|
startBtn = transform.Find("Panel/StartButton").GetComponent<Button>();
|
|
|
|
|
|
simpleBtn = transform.Find("Panel/SimpleButton").GetComponent<Button>();
|
2021-04-21 14:08:45 +08:00
|
|
|
|
ditance = transform.Find("Panel/ComputerPanel/DistanceView/Distance").GetComponent<Text>();
|
2021-04-15 10:13:01 +08:00
|
|
|
|
titlePanel = transform.Find("Panel/TitlePanel").gameObject;
|
|
|
|
|
|
totalDistance = transform.Find("Panel/TitlePanel/TotalDistance").GetComponent<Text>();
|
2021-04-12 17:35:56 +08:00
|
|
|
|
candance = transform.Find("Panel/PowerPanel/Cadance").GetComponent<Text>();
|
|
|
|
|
|
heartRate = transform.Find("Panel/PowerPanel/Hrv").GetComponent<Text>();
|
|
|
|
|
|
nextSlopePanel = transform.Find("Panel/NextSlopePanel").gameObject;
|
|
|
|
|
|
currentSlopePanel = transform.Find("Panel/CurrentSlopePanel").gameObject;
|
2021-04-15 10:13:01 +08:00
|
|
|
|
nextSlopeText = transform.Find("Panel/NextSlopePanel/NextSlopeText").GetComponent<Text>();
|
|
|
|
|
|
nextSlopeDistanceText = transform.Find("Panel/NextSlopePanel/NextSlopeDistance").GetComponent<Text>();
|
|
|
|
|
|
currentSlopeText = transform.Find("Panel/CurrentSlopePanel/CurrentSlopeText").GetComponent<Text>();
|
|
|
|
|
|
currentSlopeDistanceText = transform.Find("Panel/CurrentSlopePanel/CurrentSlopeDistance").GetComponent<Text>();
|
|
|
|
|
|
currentSlopeToatalDistanceText = transform.Find("Panel/CurrentSlopePanel/TotalSlopeDistance").GetComponent<Text>();
|
2021-04-21 14:08:45 +08:00
|
|
|
|
speedTxt = transform.Find("Panel/ComputerPanel/SpeedView/Speed").GetComponent<Text>();
|
2021-04-15 10:13:01 +08:00
|
|
|
|
powerTxt = transform.Find("Panel/PowerPanel/Power").GetComponent<Text>();
|
2021-04-21 14:08:45 +08:00
|
|
|
|
timerTxt = transform.Find("Panel/ComputerPanel/Timer").GetComponent<Text>();
|
2021-04-15 10:13:01 +08:00
|
|
|
|
countDownTxt = transform.Find("Panel/CountDown").GetComponent<Text>();
|
|
|
|
|
|
mapName = transform.Find("Panel/TitlePanel/MapName").GetComponent<Text>();
|
2021-04-21 14:08:45 +08:00
|
|
|
|
totalClimb = transform.Find("Panel/ComputerPanel/TotalClimbView/TotalClimb").GetComponent<Text>();
|
2021-04-15 10:13:01 +08:00
|
|
|
|
elevationChart = transform.Find("Panel/ElevationChart").GetComponent<LineChart>();
|
2021-04-23 19:28:35 +08:00
|
|
|
|
//img = transform.Find("Panel/ElevationChart/HeadImage").GetComponent<RawImage>();
|
|
|
|
|
|
img = transform.Find("Panel/GraphChart/Head").GetComponent<RawImage>();
|
|
|
|
|
|
t = transform.Find("Panel/GraphChart/Button");
|
2021-04-21 14:08:45 +08:00
|
|
|
|
miniMap = transform.Find("Panel/MiniMap").GetComponent<RawImage>();
|
2021-04-25 13:33:43 +08:00
|
|
|
|
|
|
|
|
|
|
alertPanel = transform.Find("Panel/Alert").gameObject;
|
|
|
|
|
|
alertBtn = transform.Find("Panel/Alert/SaveButton").GetComponent<Button>();
|
|
|
|
|
|
alertCloseBtn = transform.Find("Panel/Alert/CloseButton").GetComponent<Button>();
|
|
|
|
|
|
UIManager.AddEvent(alertBtn.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, AlertOk);
|
|
|
|
|
|
UIManager.AddEvent(alertCloseBtn.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, AlertClose);
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-15 10:13:01 +08:00
|
|
|
|
selectPanel = transform.Find("Panel/SelectPanel").gameObject;
|
|
|
|
|
|
selectPlayer = transform.Find("Panel/SelectPlayer").gameObject;
|
|
|
|
|
|
reviewPanel = transform.Find("Panel/ReviewPanel").gameObject;
|
|
|
|
|
|
quitPanel = transform.Find("Panel/QuitPanel").gameObject;
|
|
|
|
|
|
|
|
|
|
|
|
pauseButton = transform.Find("Panel/ToolBarPanel/StartOrPauseButton").GetComponent<Button>();
|
|
|
|
|
|
settingButton = transform.Find("Panel/ToolBarPanel/SettingButton").GetComponent<Button>();
|
|
|
|
|
|
deviceButton = transform.Find("Panel/ToolBarPanel/DeviceButton").GetComponent<Button>();
|
|
|
|
|
|
exitButton = transform.Find("Panel/ToolBarPanel/ExitButton").GetComponent<Button>();
|
|
|
|
|
|
singleButton = transform.Find("Panel/SelectPanel/SingleButton").GetComponent<Button>();
|
|
|
|
|
|
shadowButton = transform.Find("Panel/SelectPanel/ShadowButton").GetComponent<Button>();
|
|
|
|
|
|
addButton = transform.Find("Panel/ReviewPanel/SingleArea/AddButton").GetComponent<Button>();
|
|
|
|
|
|
saveButton = transform.Find("Panel/QuitPanel/SaveButton").GetComponent<Button>();
|
|
|
|
|
|
cancelQuitButton = transform.Find("Panel/QuitPanel/CancelButton").GetComponent<Button>();
|
|
|
|
|
|
closeQuitButton = transform.Find("Panel/QuitPanel/CloseButton").GetComponent<Button>();
|
2021-04-21 14:08:45 +08:00
|
|
|
|
viewButton =transform.Find("Panel/ViewButton").GetComponent<Button>();
|
2021-04-23 19:28:35 +08:00
|
|
|
|
altitudeGraph = transform.Find("Panel/TitlePanel/AltitudeGraph").GetComponent<RawImage>();
|
2021-04-12 17:35:56 +08:00
|
|
|
|
|
2021-04-25 13:33:43 +08:00
|
|
|
|
preSlopeText = transform.Find("Panel/PreSlopePanel/PreSlopeText").GetComponent<Text>();
|
|
|
|
|
|
|
2021-04-15 10:13:01 +08:00
|
|
|
|
target = transform.parent.Find("Target").gameObject;
|
2021-04-12 17:35:56 +08:00
|
|
|
|
|
2021-04-19 14:38:31 +08:00
|
|
|
|
UIManager.AddEvent(startBtn.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, StartRide);
|
|
|
|
|
|
UIManager.AddEvent(simpleBtn.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, ClearPanel);
|
|
|
|
|
|
UIManager.AddEvent(pauseButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, PauseRide);
|
|
|
|
|
|
UIManager.AddEvent(settingButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, ShowSettingPanel);
|
|
|
|
|
|
UIManager.AddEvent(deviceButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, ShowDevicePanel);
|
|
|
|
|
|
UIManager.AddEvent(exitButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, StopRide);
|
|
|
|
|
|
UIManager.AddEvent(singleButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, SingleRide);
|
|
|
|
|
|
UIManager.AddEvent(shadowButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, ShadowRide);
|
|
|
|
|
|
UIManager.AddEvent(addButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, ShowSelectPlayer);
|
|
|
|
|
|
UIManager.AddEvent(saveButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, SaveRide);
|
|
|
|
|
|
UIManager.AddEvent(cancelQuitButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, CancelQuit);
|
|
|
|
|
|
UIManager.AddEvent(closeQuitButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, CloseQuit);
|
2021-04-21 14:08:45 +08:00
|
|
|
|
UIManager.AddEvent(viewButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, ChangeView);
|
2021-04-22 19:29:59 +08:00
|
|
|
|
UIManager.AddEvent(singleButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerEnter, OnPointEnter);
|
|
|
|
|
|
UIManager.AddEvent(shadowButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerEnter, OnPointEnter);
|
|
|
|
|
|
UIManager.AddEvent(singleButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerExit, OnPointExit);
|
|
|
|
|
|
UIManager.AddEvent(shadowButton.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerExit, OnPointExit);
|
|
|
|
|
|
|
2021-04-15 10:13:01 +08:00
|
|
|
|
#endregion
|
2021-03-28 18:17:15 +08:00
|
|
|
|
}
|
2021-04-15 10:13:01 +08:00
|
|
|
|
|
2021-04-22 19:29:59 +08:00
|
|
|
|
float? localY;
|
|
|
|
|
|
void OnPointEnter(BaseEventData pointerEventData)
|
|
|
|
|
|
{
|
|
|
|
|
|
var button = ((PointerEventData)pointerEventData).pointerEnter.GetComponent<Button>();
|
|
|
|
|
|
if (button != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var enterTransform = button.transform;
|
|
|
|
|
|
if (localY == null)
|
|
|
|
|
|
{
|
|
|
|
|
|
localY = enterTransform.localPosition.y;
|
|
|
|
|
|
}
|
|
|
|
|
|
enterTransform.DOLocalMoveY(localY.Value + 5f, 0.5f);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
void OnPointExit(BaseEventData pointerEventData)
|
|
|
|
|
|
{
|
|
|
|
|
|
var button =((PointerEventData)pointerEventData).pointerEnter.GetComponent<Button>();
|
|
|
|
|
|
if (button != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
var enterTransform = button.transform;
|
|
|
|
|
|
enterTransform.DOLocalMoveY(localY.Value, 0.5f);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-25 16:22:09 +08:00
|
|
|
|
void Start()
|
|
|
|
|
|
{
|
2021-04-02 19:17:23 +08:00
|
|
|
|
playerController = FindObjectOfType<PlayerController>();
|
|
|
|
|
|
mainController = FindObjectOfType<CyclingController>();
|
|
|
|
|
|
var route = mainController.GetRoute();
|
|
|
|
|
|
mapName.text = route.RouteInstance.Name;
|
2021-04-19 18:03:04 +08:00
|
|
|
|
totalDistance.text = Math.Round(mainController.GetMapData().TotalDistance, 1).ToString() + "KM";//总里程
|
2021-04-23 19:28:35 +08:00
|
|
|
|
Utils.DisplayImage(StartCoroutine, altitudeGraph, route.RouteInstance.AltitudeGraph);//渲染海拔图
|
2021-03-28 18:17:15 +08:00
|
|
|
|
RenderChart();
|
2021-04-07 17:22:45 +08:00
|
|
|
|
startIndex = playerController.CurrentIndex;
|
2021-04-19 14:38:31 +08:00
|
|
|
|
//继续骑行如果有伴侣就自动进入伴侣骑行
|
|
|
|
|
|
if (mainController.routeResult != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (mainController.routeResult.Mode == CyclingModel.Review.ToString())
|
|
|
|
|
|
{
|
|
|
|
|
|
mainController.SetCyclingModel(CyclingModel.Review);
|
|
|
|
|
|
selectPanel.SetActive(false);
|
|
|
|
|
|
var reviewFactory = reviewPanel.transform.GetComponent<ReviewFactory>();
|
|
|
|
|
|
reviewFactory.Refresh();
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (mainController.routeResult.Mode == CyclingModel.Single.ToString())
|
|
|
|
|
|
{
|
|
|
|
|
|
mainController.SetCyclingModel(CyclingModel.Single);
|
|
|
|
|
|
selectPanel.SetActive(false);
|
|
|
|
|
|
}
|
2021-04-21 14:08:45 +08:00
|
|
|
|
//显示附近的人面板
|
|
|
|
|
|
nearByPanel.SetActive(true);
|
2021-04-19 14:38:31 +08:00
|
|
|
|
}
|
2021-03-25 16:22:09 +08:00
|
|
|
|
}
|
2021-03-31 20:46:57 +08:00
|
|
|
|
// Update is called once per frame
|
2021-04-02 19:17:23 +08:00
|
|
|
|
float tt = 1f;
|
2021-03-31 20:46:57 +08:00
|
|
|
|
void Update()
|
|
|
|
|
|
{
|
2021-04-02 19:17:23 +08:00
|
|
|
|
tt -= Time.deltaTime;
|
|
|
|
|
|
while (tt < 0) {
|
2021-04-15 10:13:01 +08:00
|
|
|
|
fps.text = (1 / Time.deltaTime).ToString();
|
2021-04-19 14:38:31 +08:00
|
|
|
|
MoveChartMarkPoint();
|
2021-04-02 19:17:23 +08:00
|
|
|
|
tt = 1;
|
|
|
|
|
|
}
|
2021-03-31 20:46:57 +08:00
|
|
|
|
//获取当前选中玩家绑定当前UI
|
|
|
|
|
|
if (playerController != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
//绑定UI
|
2021-04-19 18:03:04 +08:00
|
|
|
|
speedTxt.text = $"{Math.Round(playerController.Speed,1)}";
|
2021-03-31 20:46:57 +08:00
|
|
|
|
powerTxt.text = $"{playerController.Power}";
|
|
|
|
|
|
timerTxt.text = Helper.FormatTicks(playerController.TotalTicks);
|
2021-04-19 18:03:04 +08:00
|
|
|
|
ditance.text = Math.Round(playerController.TotalDistance, 1).ToString("f1");
|
2021-03-31 20:46:57 +08:00
|
|
|
|
heartRate.text = $"{Math.Round(playerController.HeartRate, 0)}";
|
|
|
|
|
|
candance.text = $"{Math.Round(playerController.Cadance, 0)}";
|
2021-04-25 13:33:43 +08:00
|
|
|
|
preSlopeText.text = $"{Math.Round(playerController.PreSlope, 1)}%";
|
2021-03-31 20:46:57 +08:00
|
|
|
|
//倒计时
|
|
|
|
|
|
if (count > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
timeRemaining -= Time.deltaTime;
|
|
|
|
|
|
if (timeRemaining <= 0)//定时器
|
|
|
|
|
|
{
|
|
|
|
|
|
count--;
|
|
|
|
|
|
if (count == 0)
|
|
|
|
|
|
{
|
2021-04-19 18:03:04 +08:00
|
|
|
|
mainController.SetStart();
|
2021-03-31 20:46:57 +08:00
|
|
|
|
countDownTxt.gameObject.SetActive(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
timeRemaining = 1.0f;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
countDownTxt.text = count.ToString();
|
|
|
|
|
|
//坡度相关数据
|
|
|
|
|
|
nextSlopeText.text = Math.Round(playerController.NextSlope, 1).ToString() + "%";
|
|
|
|
|
|
nextSlopeDistanceText.text ="-" + Math.Round(playerController.NextSlopeDistance, 0).ToString()+"M";
|
|
|
|
|
|
currentSlopeText.text = Math.Round(playerController.CurrentSlope, 1).ToString() + "%";
|
|
|
|
|
|
currentSlopeDistanceText.text = Math.Round(playerController.CurrentSlopeDistance, 0).ToString() + "M";
|
2021-04-15 10:13:01 +08:00
|
|
|
|
totalClimb.text = Math.Round(playerController.TotalClimb, 0).ToString();
|
2021-04-23 19:28:35 +08:00
|
|
|
|
//动态显示当前人物移动动画
|
|
|
|
|
|
|
2021-03-31 20:46:57 +08:00
|
|
|
|
//移动海拔图头像 TODO:移动所有人的头像
|
2021-04-19 14:38:31 +08:00
|
|
|
|
|
2021-04-07 17:22:45 +08:00
|
|
|
|
//MoveChartMarkPoint();
|
2021-03-31 20:46:57 +08:00
|
|
|
|
}
|
2021-04-07 17:22:45 +08:00
|
|
|
|
if (target != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
target.transform.position = playerController.transform.position; //new Vector3((float)Math.Round(player.transform.position.x,1), 0, (float)Math.Round(player.transform.position.z,1));
|
2021-04-21 14:08:45 +08:00
|
|
|
|
if (!mainController.Is3dView)
|
|
|
|
|
|
{ //target.transform.rotation = playerController.transform.rotation;//new Quaternion(playerController.transform.rotation.x, playerController.transform.rotation.y +1f, playerController.transform.rotation.z, playerController.transform.rotation.w);
|
|
|
|
|
|
target.transform.eulerAngles = new Vector3(0, playerController.transform.eulerAngles.y + 155f, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
target.transform.eulerAngles = new Vector3(0, -65f, 0);
|
|
|
|
|
|
}
|
2021-04-19 14:38:31 +08:00
|
|
|
|
//控制照片移动
|
|
|
|
|
|
((RectTransform)arrow.transform).position = Camera.main.WorldToScreenPoint(target.transform.position);
|
2021-04-25 13:33:43 +08:00
|
|
|
|
if (playerController.Distance > 0 && mainController.isStart)
|
|
|
|
|
|
{
|
|
|
|
|
|
arrow.transform.Find("bg").gameObject.SetActive(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
arrow.transform.Find("bg").gameObject.SetActive(false);
|
|
|
|
|
|
}
|
2021-04-07 17:22:45 +08:00
|
|
|
|
}
|
2021-03-31 20:46:57 +08:00
|
|
|
|
}
|
2021-04-19 14:38:31 +08:00
|
|
|
|
|
|
|
|
|
|
private void SingleRide(BaseEventData baseEventData)
|
2021-04-15 10:13:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
selectPanel.SetActive(false);
|
2021-04-19 14:38:31 +08:00
|
|
|
|
mainController.SetCyclingModel(CyclingModel.Single);
|
2021-04-15 10:13:01 +08:00
|
|
|
|
//显示单人骑行列表
|
|
|
|
|
|
reviewPanel.SetActive(true);
|
2021-04-21 14:08:45 +08:00
|
|
|
|
//显示附近的人列表
|
|
|
|
|
|
nearByPanel.SetActive(true);
|
2021-04-15 10:13:01 +08:00
|
|
|
|
}
|
2021-04-19 14:38:31 +08:00
|
|
|
|
private void ShadowRide(BaseEventData baseEventData)
|
2021-04-15 10:13:01 +08:00
|
|
|
|
{
|
2021-04-19 14:38:31 +08:00
|
|
|
|
mainController.SetCyclingModel(CyclingModel.Review);
|
2021-04-15 10:13:01 +08:00
|
|
|
|
selectPanel.SetActive(false);
|
|
|
|
|
|
//显示影子选手骑行列表
|
|
|
|
|
|
selectPlayer.SetActive(true);
|
2021-04-21 14:08:45 +08:00
|
|
|
|
//显示附近的人列表
|
|
|
|
|
|
nearByPanel.SetActive(true);
|
2021-04-15 10:13:01 +08:00
|
|
|
|
}
|
2021-04-19 14:38:31 +08:00
|
|
|
|
private void ShowSelectPlayer(BaseEventData baseEventData)
|
2021-04-15 10:13:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
selectPlayer.SetActive(true);
|
|
|
|
|
|
}
|
2021-04-25 13:33:43 +08:00
|
|
|
|
public void AlertOk(BaseEventData baseEventData)
|
|
|
|
|
|
{
|
|
|
|
|
|
alertPanel.SetActive(false);
|
|
|
|
|
|
UIManager.Show(UIManager.Instance.DevicePanel, transform.Find("Panel").GetComponent<PFUIPanel>());
|
|
|
|
|
|
}
|
|
|
|
|
|
public void AlertClose(BaseEventData baseEventData)
|
|
|
|
|
|
{
|
|
|
|
|
|
alertPanel.SetActive(false);
|
|
|
|
|
|
}
|
|
|
|
|
|
public void StartRide(BaseEventData baseEventData)
|
2021-03-25 16:22:09 +08:00
|
|
|
|
{
|
2021-04-19 14:38:31 +08:00
|
|
|
|
var antConnected = mainController.CheckAnt();//初始化ant+设备
|
2021-04-25 13:33:43 +08:00
|
|
|
|
#if !UNITY_EDITOR
|
|
|
|
|
|
if (!antConnected)
|
|
|
|
|
|
{
|
|
|
|
|
|
alertPanel.SetActive(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
2021-03-25 16:22:09 +08:00
|
|
|
|
//加个5秒钟倒计时
|
|
|
|
|
|
count = 5;
|
|
|
|
|
|
startBtn.gameObject.SetActive(false);
|
|
|
|
|
|
countDownTxt.gameObject.SetActive(true);
|
|
|
|
|
|
countDownTxt.text = count.ToString();
|
2021-03-29 20:32:30 +08:00
|
|
|
|
}
|
2021-03-30 17:15:16 +08:00
|
|
|
|
//暂停游戏
|
2021-04-19 14:38:31 +08:00
|
|
|
|
private void PauseRide(BaseEventData baseEventData)
|
2021-03-30 17:15:16 +08:00
|
|
|
|
{
|
2021-04-19 18:03:04 +08:00
|
|
|
|
mainController.SetPause();
|
2021-03-30 17:15:16 +08:00
|
|
|
|
startBtn.gameObject.SetActive(true);
|
|
|
|
|
|
}
|
2021-04-19 14:38:31 +08:00
|
|
|
|
private void SaveRide(BaseEventData baseEventData)
|
2021-04-15 10:13:01 +08:00
|
|
|
|
{
|
2021-04-19 18:03:04 +08:00
|
|
|
|
if (playerController.TotalTicks > 0 && !mainController.isQuit )
|
2021-04-15 17:09:35 +08:00
|
|
|
|
{
|
2021-04-22 19:29:59 +08:00
|
|
|
|
mainController.SetQuit();
|
2021-04-15 17:09:35 +08:00
|
|
|
|
playerController.Upload();
|
|
|
|
|
|
quitPanel.SetActive(false);
|
|
|
|
|
|
}
|
2021-04-22 19:29:59 +08:00
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
SceneManager.LoadScene("MainScene");
|
|
|
|
|
|
}
|
2021-04-15 10:13:01 +08:00
|
|
|
|
}
|
2021-04-19 14:38:31 +08:00
|
|
|
|
private void CancelQuit(BaseEventData baseEventData)
|
2021-04-15 10:13:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
quitPanel.SetActive(false);
|
|
|
|
|
|
SceneManager.LoadScene("MainScene");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-04-19 14:38:31 +08:00
|
|
|
|
private void CloseQuit(BaseEventData baseEventData)
|
2021-04-15 10:13:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
quitPanel.SetActive(false);
|
|
|
|
|
|
}
|
2021-04-21 14:08:45 +08:00
|
|
|
|
|
|
|
|
|
|
//切换到3d视角
|
|
|
|
|
|
private void ChangeView(BaseEventData baseEventData)
|
|
|
|
|
|
{
|
|
|
|
|
|
mainController.ChangeMapImageStyle(arrow.gameObject);
|
|
|
|
|
|
}
|
2021-03-30 17:15:16 +08:00
|
|
|
|
//结束游戏
|
2021-04-19 14:38:31 +08:00
|
|
|
|
private void StopRide(BaseEventData baseEventData)
|
2021-03-30 17:15:16 +08:00
|
|
|
|
{
|
2021-04-15 17:09:35 +08:00
|
|
|
|
if (playerController.TotalTicks > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
quitPanel.SetActive(true);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
SceneManager.LoadScene("MainScene");
|
|
|
|
|
|
}
|
2021-03-30 17:15:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
//显示设备连接
|
2021-04-19 14:38:31 +08:00
|
|
|
|
private void ShowDevicePanel(BaseEventData baseEventData)
|
2021-03-30 17:15:16 +08:00
|
|
|
|
{
|
2021-04-15 17:09:35 +08:00
|
|
|
|
UIManager.Show(UIManager.Instance.DevicePanel, transform.Find("Panel").GetComponent<PFUIPanel>());
|
2021-03-30 17:15:16 +08:00
|
|
|
|
}
|
|
|
|
|
|
//显示设置
|
2021-04-19 14:38:31 +08:00
|
|
|
|
private void ShowSettingPanel(BaseEventData baseEventData)
|
2021-03-30 17:15:16 +08:00
|
|
|
|
{
|
|
|
|
|
|
}
|
2021-03-29 20:32:30 +08:00
|
|
|
|
int isSimple = 1;
|
2021-04-15 10:13:01 +08:00
|
|
|
|
|
|
|
|
|
|
private bool clearLock = true;
|
2021-04-19 14:38:31 +08:00
|
|
|
|
private void ClearPanel(BaseEventData baseEventData)
|
2021-03-29 20:32:30 +08:00
|
|
|
|
{
|
2021-04-15 10:13:01 +08:00
|
|
|
|
if (clearLock)
|
|
|
|
|
|
{
|
|
|
|
|
|
clearLock = false;
|
|
|
|
|
|
leftPanel.transform.DOLocalMove(new Vector3(leftPanel.transform.localPosition.x + isSimple * -430f, leftPanel.transform.localPosition.y, leftPanel.transform.localPosition.z), 1);
|
|
|
|
|
|
titlePanel.transform.DOLocalMove(new Vector3(titlePanel.transform.localPosition.x, titlePanel.transform.localPosition.y + isSimple * 180f, titlePanel.transform.localPosition.z), 1);
|
2021-04-21 14:08:45 +08:00
|
|
|
|
miniMap.transform.DOLocalMove(new Vector3(miniMap.transform.localPosition.x , miniMap.transform.localPosition.y + isSimple * 260f, miniMap.transform.localPosition.z), 1);
|
|
|
|
|
|
nearByPanel.transform.DOLocalMove(new Vector3(nearByPanel.transform.localPosition.x + isSimple * 330f, nearByPanel.transform.localPosition.y, nearByPanel.transform.localPosition.z), 1).onComplete += () =>
|
2021-04-15 10:13:01 +08:00
|
|
|
|
{
|
|
|
|
|
|
clearLock = true;
|
|
|
|
|
|
isSimple *= -1;
|
2021-04-21 14:08:45 +08:00
|
|
|
|
simpleBtn.targetGraphic = simpleBtn.image;
|
|
|
|
|
|
simpleBtn.image.sprite = isSimple == -1? Resources.Load<Sprite>("Images/Ride/full") : Resources.Load<Sprite>("Images/Ride/simple");
|
2021-04-15 10:13:01 +08:00
|
|
|
|
};
|
|
|
|
|
|
}
|
2021-03-25 16:22:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-04-07 17:22:45 +08:00
|
|
|
|
private int maxCacheDataNumber = 100;//海拔图最大点数
|
|
|
|
|
|
private int totalCount;//路线实际点数
|
|
|
|
|
|
private int startIndex;//选中玩家起始索引
|
|
|
|
|
|
private int interval = 50;//选中玩家移动索引个数
|
|
|
|
|
|
private float[] elevationList;
|
2021-04-23 19:28:35 +08:00
|
|
|
|
GraphChartBase graph;
|
2021-03-30 17:15:16 +08:00
|
|
|
|
//初始化海拔图
|
2021-03-28 18:17:15 +08:00
|
|
|
|
void RenderChart()
|
|
|
|
|
|
{
|
2021-04-23 19:28:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
2021-04-22 19:29:59 +08:00
|
|
|
|
//elevationChart.ClearData();
|
|
|
|
|
|
//elevationList = mainController.GetLineChartData();
|
|
|
|
|
|
//totalCount = elevationList.Length;
|
|
|
|
|
|
//maxCacheDataNumber = Math.Min(totalCount, maxCacheDataNumber);
|
|
|
|
|
|
//elevationChart.SetMaxCache(maxCacheDataNumber);
|
|
|
|
|
|
////for (int i = 0; i < maxCacheDataNumber; i++)
|
|
|
|
|
|
////{
|
|
|
|
|
|
//// elevationChart.AddData(0, elevationList[i]);
|
|
|
|
|
|
////}
|
|
|
|
|
|
////elevationChart.RefreshChart();
|
|
|
|
|
|
//ElevationToScreenPoint();
|
|
|
|
|
|
//var endIndex = playerController.CurrentIndex;
|
|
|
|
|
|
//var s = endIndex / maxCacheDataNumber;
|
|
|
|
|
|
//var v = endIndex % maxCacheDataNumber;
|
|
|
|
|
|
|
|
|
|
|
|
//maxCacheDataNumber = Math.Min(totalCount-s* maxCacheDataNumber, maxCacheDataNumber);
|
|
|
|
|
|
|
2021-04-07 17:22:45 +08:00
|
|
|
|
//for (int i = 0; i < maxCacheDataNumber; i++)
|
|
|
|
|
|
//{
|
2021-04-22 19:29:59 +08:00
|
|
|
|
// initCount++;
|
|
|
|
|
|
// if (initCount > maxCacheDataNumber) break;
|
|
|
|
|
|
// AddOneData(s * maxCacheDataNumber + v + i);
|
2021-04-07 17:22:45 +08:00
|
|
|
|
//}
|
|
|
|
|
|
|
2021-04-22 19:29:59 +08:00
|
|
|
|
//elevationChart.RefreshChart();
|
|
|
|
|
|
var mapData = mainController.GetMapData();
|
|
|
|
|
|
double x = 0;
|
|
|
|
|
|
Dictionary<double, double> dataSource = new Dictionary<double, double>();
|
|
|
|
|
|
List<double> dd = new List<double>();
|
|
|
|
|
|
var one = mapData.List.Where(c => c.Distance == 0).Count();
|
|
|
|
|
|
foreach (var item in mapData.List)
|
2021-03-28 18:17:15 +08:00
|
|
|
|
{
|
2021-04-22 19:29:59 +08:00
|
|
|
|
x += item.Distance;
|
|
|
|
|
|
if (!dataSource.ContainsKey(x))
|
|
|
|
|
|
{
|
|
|
|
|
|
dataSource.Add(x, item.Elevation);
|
|
|
|
|
|
}
|
|
|
|
|
|
dd.Add(item.Elevation);
|
2021-03-28 18:17:15 +08:00
|
|
|
|
}
|
2021-04-22 19:29:59 +08:00
|
|
|
|
var sc = transform.Find("Panel/GraphChart").GetComponent<ChartDataSourceScript>();
|
2021-04-23 19:28:35 +08:00
|
|
|
|
|
|
|
|
|
|
graph = transform.Find("Panel/GraphChart").GetComponent<GraphChartBase>();
|
|
|
|
|
|
|
2021-04-22 19:29:59 +08:00
|
|
|
|
sc.SetDataSource(dd.ToArray());
|
|
|
|
|
|
|
2021-04-12 17:35:56 +08:00
|
|
|
|
if (App.CurrentUser != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
Utils.DisplayImage(StartCoroutine, img, App.CurrentUser.WxHeadImg);
|
|
|
|
|
|
}
|
2021-04-22 19:29:59 +08:00
|
|
|
|
|
|
|
|
|
|
|
2021-04-07 17:22:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
//长路线动态更新chart
|
|
|
|
|
|
private int initCount;
|
|
|
|
|
|
private float updateTime;
|
|
|
|
|
|
private int lastIndex;
|
|
|
|
|
|
private int chartAddNum;
|
|
|
|
|
|
void UpdateRealTimeChart()
|
|
|
|
|
|
{
|
|
|
|
|
|
var endIndex = playerController.CurrentIndex;
|
|
|
|
|
|
updateTime += Time.deltaTime;
|
|
|
|
|
|
if (updateTime >= 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
int delta = endIndex - lastIndex;
|
|
|
|
|
|
if (delta >0 && initCount < totalCount)
|
|
|
|
|
|
{
|
|
|
|
|
|
lastIndex = endIndex;
|
|
|
|
|
|
AddOneData(initCount);
|
|
|
|
|
|
initCount++;
|
|
|
|
|
|
updateTime = 0;
|
|
|
|
|
|
chartAddNum++;
|
|
|
|
|
|
}
|
|
|
|
|
|
var v = (endIndex - chartAddNum) % maxCacheDataNumber;
|
2021-04-19 14:38:31 +08:00
|
|
|
|
//MoveChartMarkPoint(v);
|
2021-04-15 17:09:35 +08:00
|
|
|
|
App.CurrentUserHeadTexture = img.texture;
|
2021-04-07 17:22:45 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
void AddOneData(int index)
|
|
|
|
|
|
{
|
2021-04-15 10:13:01 +08:00
|
|
|
|
string category = index.ToString();
|
2021-04-19 14:38:31 +08:00
|
|
|
|
|
2021-04-07 17:22:45 +08:00
|
|
|
|
elevationChart.AddData(0, elevationList[index]);
|
2021-04-15 10:13:01 +08:00
|
|
|
|
//elevationChart.AddXAxisData(category);
|
2021-04-07 17:22:45 +08:00
|
|
|
|
//elevationChart.AddXAxisData(index.ToString(), index);
|
|
|
|
|
|
|
2021-03-28 18:17:15 +08:00
|
|
|
|
}
|
2021-04-19 14:38:31 +08:00
|
|
|
|
private Dictionary<int, Vector2> pointMap = new Dictionary<int, Vector2>();
|
|
|
|
|
|
void ElevationToScreenPoint()
|
2021-03-28 18:17:15 +08:00
|
|
|
|
{
|
2021-04-19 14:38:31 +08:00
|
|
|
|
|
|
|
|
|
|
var xUnit =(float) Math.Round(854f * (Screen.width/1600f) / elevationList.Length);//x单位
|
|
|
|
|
|
var maxelev = (float)elevationList.Max();
|
|
|
|
|
|
var yUnit =(float)Math.Round(46f * (Screen.height / 900f) / maxelev);//y单位
|
|
|
|
|
|
var xoffset = 373f * (Screen.width / 1600f);
|
|
|
|
|
|
var yoffset = 175f * (Screen.height / 900f);
|
|
|
|
|
|
for (int i = 0; i < elevationList.Length; i++)
|
2021-03-29 20:32:30 +08:00
|
|
|
|
{
|
2021-04-19 14:38:31 +08:00
|
|
|
|
var c = new Vector2(i*xUnit+ xoffset, elevationList[i]*yUnit + yoffset);
|
|
|
|
|
|
pointMap.Add(i, c);
|
2021-03-29 20:32:30 +08:00
|
|
|
|
}
|
2021-03-28 18:17:15 +08:00
|
|
|
|
}
|
2021-04-19 14:38:31 +08:00
|
|
|
|
public GameObject testButton;
|
2021-04-23 19:28:35 +08:00
|
|
|
|
//挪到人物脚本中处理
|
2021-04-19 14:38:31 +08:00
|
|
|
|
void MoveChartMarkPoint()
|
|
|
|
|
|
{
|
2021-04-23 19:28:35 +08:00
|
|
|
|
Vector3 prePosition = img.transform.position;
|
2021-04-25 13:33:43 +08:00
|
|
|
|
int nextIndex = playerController.CurrentIndex+1;
|
2021-04-23 19:28:35 +08:00
|
|
|
|
double ditance = playerController.Distance;//当前移动距离
|
|
|
|
|
|
double currentDistance = playerController.CurrentDistance;//当前区间距离
|
|
|
|
|
|
var t = currentDistance != 0 ? ditance*1000 / currentDistance : 0;
|
|
|
|
|
|
var n = graph.DataSource.GetPoint("Player 2", nextIndex);
|
|
|
|
|
|
|
|
|
|
|
|
graph.PointToWorldSpace(out Vector3 nextPosition, n.x, n.y, "Player 2");
|
|
|
|
|
|
|
|
|
|
|
|
var currentPos = Vector3.Lerp(prePosition, nextPosition, (float)t);
|
|
|
|
|
|
img.transform.DOMove(currentPos, 1);
|
2021-04-25 13:33:43 +08:00
|
|
|
|
var ss = graph.GetComponentInChildren<ChartDataSourceScript>();
|
|
|
|
|
|
var q = ss.pageStartThreshold;
|
|
|
|
|
|
var p = ss.pageEndThreshold;
|
|
|
|
|
|
var diff = currentPos.x - prePosition.x;
|
|
|
|
|
|
var s = graph.ScrollableData;
|
|
|
|
|
|
var sss = s.GetMaxValue(0, true);
|
|
|
|
|
|
Debug.Log(sss);
|
|
|
|
|
|
//graph.HorizontalScrolling += diff / graph.TotalWidth;
|
2021-04-23 19:28:35 +08:00
|
|
|
|
//人物移动到中间的时候,线开始向左边平滑移动
|
|
|
|
|
|
//int del = (int)Math.Round(graph.DataSource.HorizontalViewSize / 2, 0);
|
|
|
|
|
|
//if (playerController.CurrentIndex % del == 0)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// graph.HorizontalScrolling += 1;
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
2021-04-25 13:33:43 +08:00
|
|
|
|
#region 注释
|
2021-04-19 14:38:31 +08:00
|
|
|
|
//var dataPoints = elevationChart.series.list[0].dataPoints.OrderBy(c => c.x).ToList();
|
|
|
|
|
|
//if (dataPoints.Count > 0)
|
|
|
|
|
|
//{
|
|
|
|
|
|
// var pinLoction = dataPoints[index];
|
|
|
|
|
|
// pinLoction.y = img.transform.localPosition.y;
|
|
|
|
|
|
// img.transform.localPosition = pinLoction;
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
//if (pointMap.ContainsKey(playerController.CurrentIndex-1) )
|
|
|
|
|
|
//{
|
2021-04-23 19:28:35 +08:00
|
|
|
|
|
|
|
|
|
|
|
2021-04-19 14:38:31 +08:00
|
|
|
|
// Vector3 mousePos;
|
|
|
|
|
|
// //testButton.transform.localPosition = new Vector3(pointMap[playerController.CurrentIndex - 1].x, pointMap[playerController.CurrentIndex - 1].y, 0);
|
|
|
|
|
|
// //RectTransformUtility.ScreenPointToLocalPointInRectangle(transform.parent.GetComponent<RectTransform>(), new Vector3(pointMap[playerController.CurrentIndex - 1].x , pointMap[playerController.CurrentIndex - 1].y, 0), null, out mousePos);
|
|
|
|
|
|
// ((RectTransform)testButton.transform).position = new Vector3(pointMap[playerController.CurrentIndex - 1].x, pointMap[playerController.CurrentIndex - 1].y, 0);
|
|
|
|
|
|
// //testButton.transform.position = new Vector3( pointMap[index].x, 229f, 0);
|
|
|
|
|
|
// //testButton.transform.position = new Vector3(pointMap[playerController.CurrentIndex-1].x, pointMap[playerController.CurrentIndex-1].y, 0);
|
|
|
|
|
|
// //testButton.transform.DOMove(new Vector3(pointMap[playerController.CurrentIndex].x, pointMap[playerController.CurrentIndex].y,0),1).on;
|
|
|
|
|
|
// //testButton.transform.DOLocalMove(new Vector3(pointMap[playerController.CurrentIndex - 1].x-Screen.width/2, pointMap[playerController.CurrentIndex - 1].y, 0),0.5f);
|
|
|
|
|
|
// //pointMap.Remove(playerController.CurrentIndex - 1);
|
|
|
|
|
|
//}
|
2021-04-25 13:33:43 +08:00
|
|
|
|
#endregion
|
2021-04-19 14:38:31 +08:00
|
|
|
|
}
|
2021-03-25 16:22:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|