登录增加loading&赛事提醒修改

This commit is contained in:
lishuo committed 2021-09-13 18:21:43 +08:00
1 parent 51cea743be
commit dfb80658dd
23 files changed
+2137 -34355

No files matched your search

@@ -30,6 +30,8 @@ namespace Assets.Scenes.Ride.Scripts
private GameObject CancelJoin { get; set; }
private GameObject ReadMore { get; set; }
CompetitionUIManager competitionUI { get; set; }
public override void InjectController(CyclingController controller)
{
cyclingController = controller;
@@ -45,7 +47,6 @@ namespace Assets.Scenes.Ride.Scripts
CompetitionDesc = panel.transform.Find("CompetitionDesc").GetComponent<RawImage>();
SponsorLogoImage = panel.transform.Find("SponsorTitle/Sponsor").GetComponent<RawImage>();
cyclingController.SetUIManager(mainPanel, modelPanel);
}
protected override void Start()
{
@@ -259,6 +260,8 @@ namespace Assets.Scenes.Ride.Scripts
Utils.showToast(gameObject, "race close");
return;
}
competitionUI = cyclingController.singleUIManager as CompetitionUIManager;
competitionUI?.SetMobileViewButton(false);
base.StartRide(baseEvent);
}
//观察
@@ -18,16 +18,18 @@ namespace Assets.Scenes.Ride.Scripts
Text title { get; set; }
Text timer { get; set; }
GameObject raceViewBtn { get; set; }
GameObject timerIcon { get; set; }
protected override void Start()
{
base.Start();
reviewPanel.SetActive(false);
//隐藏单人骑行时间
var spilitLineH2 = uipanel.transform.Find("ComputerPanel/SpilitLineH2").gameObject;
raceViewBtn = uipanel.transform.Find("RaceViewButton").gameObject;
#if UNITY_IOS || UNITY_ANDROID
viewButton.enabled = mainController.isWatch;
viewButton.interactable = mainController.isWatch;
timerIcon = uipanel.transform.Find("ComputerPanel/TimerIcon").gameObject;
timerIcon.SetActive(false);
#else
viewButton.gameObject.SetActive(false);
#endif
@@ -202,6 +204,14 @@ namespace Assets.Scenes.Ride.Scripts
}
}
public void SetMobileViewButton(bool enabled)
{
#if UNITY_IOS || UNITY_ANDROID
//viewButton.enabled = enabled;
viewButton.interactable = enabled;
#endif
}
protected override void StopRide(BaseEventData baseEventData)
{
if (!App.MainSceneParam.ContainsKey("Name"))
@@ -384,8 +384,8 @@ namespace Assets.Scenes.Ride.Scripts
if (mainController.competitionId > 0)
{
var showLeft = watchList.Count > 0;
viewButton.enabled = true;
viewButton.interactable = true;
//viewButton.enabled = true;
//viewButton.interactable = true;
distanceIconCompetition.SetActive(!showLeft);
totalDistanceCompetition.gameObject.SetActive(!showLeft);
totalDistance.gameObject.SetActive(showLeft);
@@ -93,11 +93,13 @@ public class CyclingController : DeviceServiceMonoBase
competitionId = App.CompetionId;
App.CompetionId = 0;//清空比赛参数
Resources.UnloadUnusedAssets();
}
void OnDestroy()
{
App.TextureCache.Clear();
//App.TextureCache.Clear();
Resources.UnloadUnusedAssets();
}
Transform target;
GameObject watcher;
@@ -437,7 +439,7 @@ public class CyclingController : DeviceServiceMonoBase
chartDataSourceScript.InitHorizontalScrolling(index);
}
//SingleUIManager singleUIManager;
BaseUIManager singleUIManager;
public BaseUIManager singleUIManager;
public void GameStart()
{
singleUIManager.StartRide();
@@ -2,10 +2,11 @@
using System.Collections.Generic;
using UnityEngine;
using System;
using System.Linq;
namespace Assets.Scenes.Ride.Scripts
{
public class GameEvent { }
public class GameEvent { string key { get; set; } }
public class EventQueueSystem : MonoSingleton<EventQueueSystem>
{
@@ -25,7 +26,11 @@ namespace Assets.Scenes.Ride.Scripts
//注册侦听事件(持续)
public static void AddListener<T>(EventDelegate<T> del) where T : GameEvent
{
Instance.AddDelegate(del);
if (!HasListener(del))
{
Debug.Log(30);
Instance.AddDelegate(del);
}
}
//注册侦听事件(一次)
@@ -39,7 +44,8 @@ namespace Assets.Scenes.Ride.Scripts
//判定侦听事件是否存在
public static bool HasListener<T>(EventDelegate<T> del) where T : GameEvent
{
return Instance.delegateLookup.ContainsKey(del);
return Instance.delegateLookup.Keys.Where(c => c.GetType() == del.GetType()).Any();
//return Instance.delegateLookup.ContainsKey(del);
}
//移除侦听事件
@@ -114,6 +120,18 @@ namespace Assets.Scenes.Ride.Scripts
return;
Instance.eventQueue.Enqueue(e);
}
static List<string> keyList = new List<string>();
public static void QueueEventOnce(GameEvent e,string key)
{
if (!Instance.delegates.ContainsKey(e.GetType()))
return;
if (keyList.Contains(key))
return;
keyList.Add(key);
Debug.Log(126);
Instance.eventQueue.Enqueue(e);
}
float timer = 0.0f;
//事件队列触发处理
void Update()