48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
|
using ET;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
|
|||
|
namespace ET
|
|||
|
{
|
|||
|
public class MainUIGlobalText:Entity
|
|||
|
{
|
|||
|
public class MainUIGlobalTextAwakeSystem : AwakeSystem<MainUIGlobalText>
|
|||
|
{
|
|||
|
public override void Awake(MainUIGlobalText self)
|
|||
|
{
|
|||
|
Instance = self;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public class MainUIGlobalTextUpdateSystem : UpdateSystem<MainUIGlobalText>
|
|||
|
{
|
|||
|
|
|||
|
public override void Update(MainUIGlobalText self)
|
|||
|
{
|
|||
|
if (self.txtUi != null)
|
|||
|
{
|
|||
|
if (self.txtUi.m_Effect.playing)
|
|||
|
return;
|
|||
|
if (self.queue.Count > 0)
|
|||
|
{
|
|||
|
var str = self.queue.Dequeue();
|
|||
|
self.txtUi.self.title = str;
|
|||
|
self.txtUi.m_Effect.Play();
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public static MainUIGlobalText Instance{get;private set;}
|
|||
|
|
|||
|
private Queue<string> queue = new Queue<string>();
|
|||
|
|
|||
|
private FUI_LabelGlobalText txtUi;
|
|||
|
public void Init(string message)
|
|||
|
{
|
|||
|
txtUi =txtUi?? MainUI.GlobalText;
|
|||
|
queue.Enqueue(message);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|