赛事消息通知面板和界面微调
This commit is contained in:
1 parent
7d0128d912
commit
17f2b1cedd
9 files changed
+893
-52
No files matched your search
@@ -1,7 +1,6 @@
|
||||
using Assets.Scripts;
|
||||
using Assets.Scripts.Apis;
|
||||
using Assets.Scripts.Apis.Models;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@@ -21,6 +20,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
private Text StartTime { get; set; }
|
||||
private Text Contestant { get; set; }
|
||||
private Text CompetitionStatus { get; set; }
|
||||
private Text GetReady { get; set; }
|
||||
private Text GetReadyTitle { get; set; }
|
||||
private Transform PlayersPanel {get;set;}
|
||||
private GameObject LeftBack { get; set; }
|
||||
private GameObject MiddleBack { get; set; }
|
||||
@@ -42,6 +43,28 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
{
|
||||
base.Start();
|
||||
}
|
||||
MapCompetition competition { get; set; }
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
#region 倒计时状态
|
||||
if (competition != null)
|
||||
{
|
||||
var count = (int)(competition.StartTime.ToLocalTime() - UIManager.Now.GetDateTime()).TotalSeconds;
|
||||
if (count > 0)
|
||||
{
|
||||
GetReady.text = Helper.FormatTicks(count);
|
||||
GetReadyTitle.gameObject.SetActive(true);
|
||||
GetReady.gameObject.SetActive(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
GetReadyTitle.gameObject.SetActive(false);
|
||||
GetReady.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
protected override void ShowLoading()
|
||||
{
|
||||
loadingPanel = panel.transform.Find("LoadingPanel").gameObject;
|
||||
@@ -67,6 +90,8 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
MiddleBack = panel.transform.Find("MiddleBack").gameObject;
|
||||
CompetitionStatus = panel.transform.Find("CompetitionStatus").GetComponent<Text>();
|
||||
ReadMore = panel.transform.Find("ReadMore").gameObject;
|
||||
GetReady = panel.transform.Find("GetReady").GetComponent<Text>();
|
||||
GetReadyTitle = panel.transform.Find("GetReadyTitle").GetComponent<Text>();
|
||||
|
||||
UIManager.AddEvent(ReadMore, EventTriggerType.PointerClick, ReadCompetitionPreview);
|
||||
UIManager.AddEvent(Watch, EventTriggerType.PointerClick, StartWatch);
|
||||
@@ -78,7 +103,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
protected override void InitGameObjectData()
|
||||
{
|
||||
var route = cyclingController.mapRoute;
|
||||
var competition = cyclingController.competition;
|
||||
competition = cyclingController.competition;
|
||||
//赛事状态按钮控制
|
||||
_canJoin = competition.CanJoin;
|
||||
_canStart = competition.CanStart;
|
||||
@@ -119,16 +144,17 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
mapDescText.text = route.Dec;
|
||||
//主办方logo
|
||||
Utils.DisplayImage(SponsorLogoImage, competition.SponsorCoverage, true);
|
||||
|
||||
//赛事详情
|
||||
if (!string.IsNullOrEmpty(competition.ShortPreview))
|
||||
{
|
||||
LeftBack.SetActive(false);
|
||||
MiddleBack.SetActive(false);
|
||||
Utils.DisplayImage(CompetitionDesc, competition.ShortPreview, true);
|
||||
var canvasGroup = CompetitionDesc.GetComponent<CanvasGroup>();
|
||||
canvasGroup.DOFade(1, 1);
|
||||
}
|
||||
else
|
||||
//if (!string.IsNullOrEmpty(competition.ShortPreview))
|
||||
//{
|
||||
// LeftBack.SetActive(false);
|
||||
// MiddleBack.SetActive(false);
|
||||
// Utils.DisplayImage(CompetitionDesc, competition.ShortPreview, true);
|
||||
// var canvasGroup = CompetitionDesc.GetComponent<CanvasGroup>();
|
||||
// canvasGroup.DOFade(1, 1);
|
||||
//}
|
||||
//else
|
||||
{
|
||||
//异步请求mapbox画出当前路书路线图
|
||||
DrawMapRouteAsync(route.Id, 1);
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
ShowLoading();
|
||||
}
|
||||
|
||||
void Update()
|
||||
protected virtual void Update()
|
||||
{
|
||||
if (canvasGroup == null)
|
||||
{
|
||||
|
||||
@@ -71,17 +71,19 @@ namespace Assets.Scenes.Ride.Scripts
|
||||
public class CompetitonStartMessageEvent : GameEvent
|
||||
{
|
||||
public string title;//赛事标题
|
||||
public string SceneName;//场景名称
|
||||
public int competitionId;//赛事id
|
||||
public int routeId;//路书id
|
||||
public DateTime StartTime;//赛事开始时间
|
||||
|
||||
|
||||
public CompetitonStartMessageEvent(string Title, int Id, int RouteId, DateTime StartTime)
|
||||
public CompetitonStartMessageEvent(string Title, int Id, int RouteId, DateTime StartTime,string SceneName)
|
||||
{
|
||||
this.title = Title;
|
||||
this.competitionId = Id;
|
||||
this.routeId = RouteId;
|
||||
this.StartTime = StartTime;
|
||||
this.SceneName = SceneName;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user