62 lines
1.3 KiB
C#
62 lines
1.3 KiB
C#
using BigSpace.Logic;
|
|
using BigSpace.XRCore.Base;
|
|
using BigSpace.XRCore.Event;
|
|
using BigSpace.XRCore.Video;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using UnityEngine.Video;
|
|
|
|
public class UIPanelControll : MonoSingleton<UIPanelControll>
|
|
{
|
|
public List<Image> ListUiImg;
|
|
|
|
//¼ÆÊ±Ïà¹Ø
|
|
bool isRun = false;
|
|
float waitTime = 5f;
|
|
float runTime = 0;
|
|
|
|
int nowIndex = 0; //µ±Ç°Ï±ê
|
|
|
|
void Start()
|
|
{
|
|
GlobalEventMgr.Listen<int>(GameEvent.EventShowUI, GameDataManage_EventShowUI);
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
if (isRun)
|
|
{
|
|
runTime += Time.deltaTime;
|
|
if (runTime >= waitTime)
|
|
{
|
|
isRun = false;
|
|
runTime = 0;
|
|
ListUiImg[nowIndex].gameObject.SetActive(false);
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
void GameDataManage_EventShowUI(int index)
|
|
{
|
|
if (index == 0|| index == 7)
|
|
{
|
|
nowIndex = index;
|
|
ListUiImg[nowIndex].gameObject.SetActive(true);
|
|
if (index != 7)
|
|
isRun = true;
|
|
else
|
|
{
|
|
if (index == 7)
|
|
{
|
|
waitTime = 11;
|
|
isRun = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|