Files
BingoGrassland/Assets/BingoBrain/ModuleUI/JEffect/JEffectUICtrl.cs
T
2026-04-20 13:49:36 +08:00

86 lines
1.9 KiB
C#

using BingoBrain.Core;
using BingoBrain.HotFix;
namespace BingoBrain
{
public class JEffectUICtrl : BaseUICtrl
{
private JEffectUI ui;
private JEffectModel model;
private uint openUIMsg = SkinInfo.JEffectUI_Open;
private uint closeUIMsg = SkinInfo.JEffectUI_Close;
private bool isOpen = false;
#region
protected override void OnInit()
{
}
protected override void OnDispose()
{
}
public override void OpenUI(object args = null)
{
if (ui == null || ui.isClose)
{
ui = new JEffectUI(this);
ui.Open(args);
}
}
public override void CloseUI(object args = null)
{
if (ui != null && !ui.isClose)
{
ui.Close();
}
ui = null;
}
#endregion
#region
public override uint GetOpenUIMsg(string uiName)
{
return openUIMsg;
}
public override uint GetCloseUIMsg(string uiName)
{
return closeUIMsg;
}
protected override void AddListener()
{
uiCtrlDispatcher.AddListener(openUIMsg, OpenUI);
uiCtrlDispatcher.AddListener(closeUIMsg, CloseUI);
uiCtrlDispatcher.AddListener(SkinInfo.PlayUIFX, PlayFx);
}
protected override void RemoveListener()
{
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
uiCtrlDispatcher.RemoveListener(SkinInfo.PlayUIFX, PlayFx);
}
private void PlayFx(object obj)
{
if (!isOpen)
{
OpenUI();
}
var fxType = (FxPlayData)obj;
ui.PlayFx(fxType);
}
#endregion
}
}