//--------------------------------------------------------
|
// [Author]: 玩个游戏
|
// [ Date ]: Tuesday, July 24, 2018
|
//--------------------------------------------------------
|
|
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
|
//开服活动-排行榜 3 - 开服关卡榜 ; 4 - 开服招募榜
|
public class OSRankWin : PlayerRankWin
|
{
|
|
[SerializeField] Text timeText;
|
[SerializeField] Text overTimeText;
|
|
|
|
|
protected override void OnPreOpen()
|
{
|
base.OnPreOpen();
|
GlobalTimeEvent.Instance.secondEvent += OnSecond;
|
ShowTime();
|
|
}
|
|
void ShowTime()
|
{
|
var seconds = OSActivityManager.Instance.GetEndTime(rankType);
|
if (seconds > 0)
|
{
|
timeText.SetActive(true);
|
overTimeText.SetActive(false);
|
timeText.text = TimeUtility.SecondsToShortDHMS(seconds);
|
}
|
else
|
{
|
timeText.SetActive(false);
|
overTimeText.SetActive(true);
|
}
|
}
|
|
protected override void OnPreClose()
|
{
|
base.OnPreClose();
|
GlobalTimeEvent.Instance.secondEvent -= OnSecond;
|
}
|
|
void OnSecond()
|
{
|
ShowTime();
|
}
|
|
}
|