using UnityEngine; using UnityEngine.UI; using System.Linq; using Mapbox.Unity.Map; using DG.Tweening; using System; using UnityEngine.SceneManagement; using System.Collections.Generic; using UnityEngine.EventSystems; using ChartAndGraph; using Assets.Scripts; using Assets.Scripts.Apis.Models; namespace Assets.Scenes.Ride.Scripts { public class BaseUIManager : MonoBehaviour { #region UI control protected GameObject target; protected GameObject nearByPanel;//附近的人列表 protected GameObject leftPanel;//伴侣骑行列表 protected GameObject nextSlopePanel;//下一个坡度面板 protected GameObject currentSlopePanel;//当前坡度面板 protected GameObject selectPanel;//骑行模式选择 protected GameObject selectPlayer;//伴侣骑行选择窗口 protected GameObject reviewPanel; protected GameObject titlePanel; protected GameObject quitPanel;//退出界面 protected Text nextSlopeText;//下一个坡度 protected Text nextSlopeDistanceText;//下一个坡度距离 protected Text currentSlopeText;//当前坡度 protected Text currentSlopeDistanceText;//当前坡度已骑行距离 protected Text currentSlopeToatalDistanceText;//当前坡度总距离 protected Text speedTxt;//当前速度 protected Text powerTxt;//功率 protected Text timerTxt;//计时器 protected Text ditance;//当前骑行距离 protected Text totalDistance;//当前骑行距离 protected Text candance;//踏频 protected Text heartRate;//心率 protected Text countDownTxt;//倒计时5s protected Text mapName;//路书名称 protected Text fps;//fps protected Text totalClimb; protected Button startBtn;//开始按钮 protected Button simpleBtn;//进入简约模式按钮 protected Button pauseButton;//暂停按钮 protected Button settingButton;//设置那妞 protected Button deviceButton;//设备按钮 protected Button viewButton;//视角按钮 protected Button exitButton;//退出按钮 protected Button singleButton;//单人骑行按钮 protected Button shadowButton;//影子选手按钮 protected Button addButton;//添加伴侣骑行 protected Button saveButton;//退出panel保存按钮 protected Button cancelQuitButton;//退出panel取消按钮 protected Button closeQuitButton;//退出panel关闭按钮 protected RawImage head;//海拔图头像 protected GameObject miniMap;//小地图 protected RawImage altitudeGraph;//海拔图 protected Image leftImage; protected Image rightImage; protected Image area; #endregion #region 控制器 protected PlayerController playerController;//当前用户 protected CyclingController mainController;//主控制器 #endregion protected float timeRemaining = 1f; protected int count = 0; protected Image arrow; protected AbstractMap map; protected Transform t; protected GameObject alertPanel; protected Button alertBtn; protected Button alertCloseBtn; protected Text preSlopeText; protected GameObject startPanel; protected GameObject headPanel; protected GameObject settingPanel; protected Button abandonButton; protected GameObject singleArea; protected Sprite downhill1; protected Sprite uphill1; protected Sprite straight; protected Sprite downhill1Small; protected Sprite uphill1Small; protected Sprite straightSmall; protected Image nextSlopeImage; protected Image currentSlopeImage; protected Image miniMapProcess; protected Image currentSlopeProcess; protected Text miniMapProcessText; protected Slider cameraSlider; protected virtual 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; startPanel = transform.Find("Panel/StartPanel").gameObject; startBtn = transform.Find("Panel/StartPanel/StartButton").GetComponent