合并后微调,增加赛事提醒功能
This commit is contained in:
1 parent
21529db9dc
commit
7f8ac10d47
17 files changed
+1508
-25
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using Assets.Scripts;
|
||||
using Assets.Scenes.Ride.Scripts;
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Apis;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using Assets.Scripts.UI.Control;
|
||||
@@ -74,7 +75,8 @@ public class HomeController : PFUIPanel
|
||||
|
||||
UIManager.AddEvent(userInfo.Find("BtnMore").gameObject, EventTriggerType.PointerClick, x =>
|
||||
{
|
||||
UIManager.ShowUserInfoPanel();
|
||||
// UIManager.ShowUserInfoPanel();
|
||||
UIManager.ShowRaceAlertPanel();
|
||||
//UIManager.ShowConfirm("Quit", "Do you want to quit PowerFun?", null);
|
||||
});
|
||||
//GetSummary();
|
||||
@@ -113,14 +115,7 @@ public class HomeController : PFUIPanel
|
||||
//进入比赛
|
||||
private void GoMatch(BaseEventData e)
|
||||
{
|
||||
//TODO:进入比赛列表
|
||||
UIManager.ShowRaceHomePanel();
|
||||
return;
|
||||
#region 测试比赛
|
||||
App.CompetionId = 1048;
|
||||
App.RouteIdParam = 1215;
|
||||
SceneManager.LoadScene("Ride");
|
||||
#endregion
|
||||
}
|
||||
private void OnHover(BaseEventData e)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
using Assets.Scripts;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
public class RaceAlertController : PFUIPanel
|
||||
{
|
||||
public Text Content { get; set; }
|
||||
public Text Timer { get; set; }
|
||||
|
||||
public GameObject GoBtn { get; set; }
|
||||
public GameObject StayBtn { get; set; }
|
||||
|
||||
public int ticks = 0;
|
||||
|
||||
public int CompetitionId { get; set; }
|
||||
public int RouteId { get; set; }
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
Timer = this.transform.Find("Card/Timer").GetComponent<Text>();
|
||||
Content = this.transform.Find("Card/Content").GetComponent<Text>();
|
||||
GoBtn = this.transform.Find("Card/Go").gameObject;
|
||||
StayBtn = this.transform.Find("Card/Stay").gameObject;
|
||||
|
||||
UIManager.AddEvent(GoBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Go);
|
||||
UIManager.AddEvent(StayBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Stay);
|
||||
}
|
||||
float t = 1f;
|
||||
private void Update()
|
||||
{
|
||||
t -= Time.deltaTime;
|
||||
while (t <= 0)
|
||||
{
|
||||
if (ticks > 0)
|
||||
{
|
||||
ticks--;
|
||||
Timer.text = Helper.FormatTicks(ticks);
|
||||
}
|
||||
t = 1f;
|
||||
}
|
||||
}
|
||||
|
||||
//切换到当前用户视角
|
||||
public void Go(BaseEventData baseEventData)
|
||||
{
|
||||
App.CompetitionIdList.Add(CompetitionId);
|
||||
App.CompetionId = CompetitionId;
|
||||
App.RouteIdParam = RouteId;
|
||||
SceneManager.LoadScene("Ride");
|
||||
}
|
||||
|
||||
public void Stay(BaseEventData baseEventData)
|
||||
{
|
||||
App.CompetitionIdList.Add(CompetitionId);
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1640d8d75dcdfa744896cf9c703dca2b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in new issue
Block a user