合并前备份

This commit is contained in:
lishuo 2021-04-23 09:37:41 +08:00
parent 96f3644b5b
commit d35c9daa82
4 changed files with 3030 additions and 2988 deletions

File diff suppressed because it is too large Load Diff

View File

@ -15,6 +15,8 @@ using TurfCS;
using Mapbox.Utils; using Mapbox.Utils;
using Assets.Scripts; using Assets.Scripts;
using System.Threading.Tasks; using System.Threading.Tasks;
using UnityEngine.EventSystems;
using UnityEngine.Events;
public class CyclingController : DeviceServiceMonoBase public class CyclingController : DeviceServiceMonoBase
{ {
@ -76,6 +78,11 @@ public class CyclingController : DeviceServiceMonoBase
Init(); Init();
} }
public void AddEvent(GameObject sender, EventTriggerType eventType,UnityAction<BaseEventData> unityAction)
{
UIManager.AddEvent(sender, eventType, unityAction);
}
public Texture GetCountryImageByCode(string code) public Texture GetCountryImageByCode(string code)
{ {
return UIManager.Instance.loginRegOptions.GetCountryImage(code); return UIManager.Instance.loginRegOptions.GetCountryImage(code);

View File

@ -5,6 +5,8 @@ using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
using System.Linq; using System.Linq;
using System; using System;
using UnityEngine.EventSystems;
using UnityEngine.SceneManagement;
namespace Assets.Scenes.Ride.Scripts namespace Assets.Scenes.Ride.Scripts
{ {
@ -34,6 +36,11 @@ namespace Assets.Scenes.Ride.Scripts
#endregion #endregion
#region
GameObject goResultBtn;
GameObject cancelBtn;
#endregion
CyclingController cyclingController; CyclingController cyclingController;
private void Awake() private void Awake()
{ {
@ -58,18 +65,41 @@ namespace Assets.Scenes.Ride.Scripts
maxSpeed = transform.Find("FitPanel/MaxSpeedView/Value").GetComponent<Text>(); maxSpeed = transform.Find("FitPanel/MaxSpeedView/Value").GetComponent<Text>();
avSpeed = transform.Find("FitPanel/AverageSpeed/Value").GetComponent<Text>(); avSpeed = transform.Find("FitPanel/AverageSpeed/Value").GetComponent<Text>();
#endregion #endregion
goResultBtn = transform.Find("ConFirmButton").gameObject;
cancelBtn = transform.Find("CloseButton").gameObject;
} }
public void InjectController(CyclingController controller) public void InjectController(CyclingController controller)
{ {
cyclingController = controller; cyclingController = controller;
cyclingController.AddEvent(goResultBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, GoResult);
cyclingController.AddEvent(cancelBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Cancel);
}
private void GoResult(BaseEventData baseEventData)
{
if (App.MainSceneParam.ContainsKey("Name"))
{
App.MainSceneParam["Name"] = "UserInfoPanel";
}
else
{
App.MainSceneParam.Add("Name", "UserInfoPanel");
}
SceneManager.LoadScene("MainScene");
} }
public void RegisterButton() private void Cancel(BaseEventData baseEventData)
{ {
if (App.MainSceneParam.ContainsKey("Name"))
{
App.MainSceneParam["Name"] = "MapListPanel";
}
else
{
App.MainSceneParam.Add("Name", "MapListPanel");
}
SceneManager.LoadScene("MainScene");
} }
public void SetDataSource(RecorderDataModel record) public void SetDataSource(RecorderDataModel record)
{ {
var route = record.CurrentRoute.RouteInstance; var route = record.CurrentRoute.RouteInstance;

View File

@ -32,6 +32,11 @@ public class MainController : MonoBehaviour
{ {
UIManager.ShowMapListPanel(); UIManager.ShowMapListPanel();
} }
if (App.MainSceneParam["Name"] == "UserInfoPanel")
{
UIManager.ShowUserInfoPanel();
}
} }
else else
{ {