赛事消息通知面板和界面微调
This commit is contained in:
1 parent
7d0128d912
commit
17f2b1cedd
9 files changed
+893
-52
No files matched your search
@@ -1,4 +1,5 @@
|
||||
using Assets.Scripts;
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using UnityEngine.SceneManagement;
|
||||
@@ -9,11 +10,15 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
public class RaceAlertController : PFUIPanel
|
||||
{
|
||||
public Text Content { get; set; }
|
||||
public Text BandContent { get; set; }
|
||||
public Text Timer { get; set; }
|
||||
|
||||
public GameObject GoBtn { get; set; }
|
||||
public GameObject Card { get; set; }
|
||||
public GameObject Band { get; set; }
|
||||
public GameObject BandGoBtn { get; set; }
|
||||
public GameObject StayBtn { get; set; }
|
||||
|
||||
public GameObject BandStayBtn { get; set; }
|
||||
|
||||
public int ticks = 0;
|
||||
|
||||
public int CompetitionId { get; set; }
|
||||
@@ -21,13 +26,25 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
//Card
|
||||
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;
|
||||
Card = this.transform.Find("Card").gameObject;
|
||||
|
||||
//band
|
||||
BandContent = this.transform.Find("Band/Content").GetComponent<Text>();
|
||||
BandGoBtn = this.transform.Find("Band/Go").gameObject;
|
||||
BandStayBtn = this.transform.Find("Band/Stay").gameObject;
|
||||
Band = this.transform.Find("Band").gameObject;
|
||||
|
||||
UIManager.AddEvent(GoBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Go);
|
||||
UIManager.AddEvent(StayBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Stay);
|
||||
|
||||
UIManager.AddEvent(BandGoBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Go);
|
||||
UIManager.AddEvent(BandStayBtn, UnityEngine.EventSystems.EventTriggerType.PointerClick, Stay);
|
||||
|
||||
}
|
||||
float t = 1f;
|
||||
private void Update()
|
||||
@@ -44,6 +61,22 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
}
|
||||
}
|
||||
|
||||
public void Set(DateTime startTime, DateTime now,string title, string sceneName, int competitionId,int routeId)
|
||||
{
|
||||
ticks = (int)(startTime - now).TotalSeconds;
|
||||
|
||||
var content = $"Your <color='#F93086'>{title}</color> race about to start";
|
||||
Content.text = content;
|
||||
BandContent.text = content;
|
||||
|
||||
CompetitionId = competitionId;
|
||||
RouteId = routeId;
|
||||
|
||||
var ride = sceneName.Equals("Ride");
|
||||
Card.SetActive(ride);
|
||||
Band.SetActive(!ride);
|
||||
}
|
||||
|
||||
//切换到当前用户视角
|
||||
public void Go(BaseEventData baseEventData)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user