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 Assets.Cyp.Common; using System.Threading.Tasks; using UnityEngine.EventSystems; using ChartAndGraph; namespace Assets.Scenes.Ride.Scripts { public class SingleUIManager : MonoBehaviour { #region UI control GameObject target; GameObject nearByPanel;//附近的人列表 GameObject leftPanel;//伴侣骑行列表 GameObject nextSlopePanel;//下一个坡度面板 GameObject currentSlopePanel;//当前坡度面板 GameObject selectPanel;//骑行模式选择 GameObject selectPlayer;//伴侣骑行选择窗口 GameObject reviewPanel; GameObject titlePanel; GameObject quitPanel;//退出界面 Text nextSlopeText;//下一个坡度 Text nextSlopeDistanceText;//下一个坡度距离 Text currentSlopeText;//当前坡度 Text currentSlopeDistanceText;//当前坡度已骑行距离 Text currentSlopeToatalDistanceText;//当前坡度总距离 Text speedTxt;//当前速度 Text powerTxt;//功率 Text timerTxt;//计时器 Text ditance;//当前骑行距离 Text totalDistance;//当前骑行距离 Text candance;//踏频 Text heartRate;//心率 Text countDownTxt;//倒计时5s Text mapName;//路书名称 Text fps;//fps Text totalClimb; Button startBtn;//开始按钮 Button simpleBtn;//进入简约模式按钮 Button pauseButton;//暂停按钮 Button settingButton;//设置那妞 Button deviceButton;//设备按钮 Button viewButton;//视角按钮 Button exitButton;//退出按钮 Button singleButton;//单人骑行按钮 Button shadowButton;//影子选手按钮 Button addButton;//添加伴侣骑行 Button saveButton;//退出panel保存按钮 Button cancelQuitButton;//退出panel取消按钮 Button closeQuitButton;//退出panel关闭按钮 LineChart elevationChart;//海拔图 RawImage img;//海拔图头像 RawImage miniMap;//小地图 RawImage altitudeGraph;//海拔图 #endregion #region 控制器 public PlayerController playerController;//当前用户 public CyclingController mainController;//主控制器 #endregion private float timeRemaining = 1f; private int count = 0; Image arrow; AbstractMap map; Transform t; GameObject alertPanel; Button alertBtn; Button alertCloseBtn; Text preSlopeText; void Awake() { #region 控件获取与事件绑定 fps = transform.Find("Panel/FPS").GetComponent(); arrow = transform.Find("Panel/Arrow").GetComponent(); map = transform.parent.Find("Map").GetComponent(); leftPanel = transform.Find("Panel/ReviewPanel").gameObject; nearByPanel = transform.Find("Panel/NearPanel").gameObject; startBtn = transform.Find("Panel/StartButton").GetComponent