121 lines
3.2 KiB
C#
121 lines
3.2 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using LuaInterface;
|
|
using Newtonsoft.Json;
|
|
using UnityEngine;
|
|
|
|
namespace CSUI
|
|
{
|
|
public class GotAnimNotice_ItemInfo
|
|
{
|
|
[JsonProperty("cfgId")]
|
|
public int cfgId { get; set; }
|
|
|
|
[JsonProperty("num")]
|
|
public int num { get; set; }
|
|
}
|
|
|
|
public class GotAnimNotice_Data
|
|
{
|
|
[JsonProperty("endPoses")]
|
|
public List<Vector3> endPoses { get; set; }
|
|
|
|
[JsonProperty("enterType")]
|
|
public int enterType { get; set; }
|
|
|
|
[JsonProperty("list")]
|
|
public List<GotAnimNotice_ItemInfo> list { get; set; }
|
|
|
|
[JsonProperty("needOffset")]
|
|
public bool needOffset { get; set; }
|
|
|
|
[JsonProperty("startPoses")]
|
|
public List<Vector3> startPoses { get; set; }
|
|
}
|
|
|
|
public class LuaUIMgr
|
|
{
|
|
private LuaFunction _G_OpenUI_LuaFunction = null;
|
|
private LuaFunction _G_LuaUIMgr_ShowMinTips = null;
|
|
private Dictionary<int, object> _uiCtrDict = new();
|
|
|
|
public LuaUIMgr()
|
|
{
|
|
_uiCtrDict[UIPageName.UIMain] = new UIMainCtr();
|
|
_uiCtrDict[UIPageName.UIBattle] = new UIBattleCtr();
|
|
}
|
|
|
|
public UIViewBase CreateUIView(int pageID)
|
|
{
|
|
UIViewBase view = null;
|
|
switch (pageID)
|
|
{
|
|
case UIPageName.UIBattleWin:
|
|
view = new UIBattleWinView();
|
|
break;
|
|
case UIPageName.UIBigMap:
|
|
view = new UIBigMapView();
|
|
break;
|
|
}
|
|
return view;
|
|
}
|
|
|
|
public void ShowMinTips(string contentKey)
|
|
{
|
|
if (_G_LuaUIMgr_ShowMinTips == null)
|
|
{
|
|
_G_LuaUIMgr_ShowMinTips = LuaMgr.Instance.luaState.GetFunction("_G_LuaUIMgr_ShowMinTips");
|
|
}
|
|
_G_LuaUIMgr_ShowMinTips.Call(contentKey);
|
|
}
|
|
|
|
public void Open(int ui, object data)
|
|
{
|
|
if (_G_OpenUI_LuaFunction == null)
|
|
{
|
|
_G_OpenUI_LuaFunction = LuaMgr.Instance.luaState.GetFunction("_G_OpenUI");
|
|
}
|
|
_G_OpenUI_LuaFunction.Call(ui, data);
|
|
}
|
|
|
|
public void Open(int ui, LuaTable data)
|
|
{
|
|
if (_G_OpenUI_LuaFunction == null)
|
|
{
|
|
_G_OpenUI_LuaFunction = LuaMgr.Instance.luaState.GetFunction("_G_OpenUI");
|
|
}
|
|
_G_OpenUI_LuaFunction.Call(ui, data);
|
|
}
|
|
|
|
public void ClosePage(int ui, bool v)
|
|
{
|
|
|
|
}
|
|
|
|
public void Hide(int ui)
|
|
{
|
|
|
|
}
|
|
|
|
public void POPGotAnimNotice(GotAnimNotice_Data data)
|
|
{
|
|
var uiData = ManagerContainer.CfgMgr.GetUIData(UIPageName.UIPOPGotAnims);
|
|
var page = UIMgr.Instance.GetPage(uiData.id);
|
|
if (page == null)
|
|
{
|
|
Open(UIPageName.UIPOPGotAnims, data);
|
|
}
|
|
else
|
|
{
|
|
ManagerContainer.LuaEventMgr.Dispatch(UIEventNames.GOT_ITEM_ANIM, data);
|
|
}
|
|
}
|
|
|
|
public object GetViewCtrById(int ui)
|
|
{
|
|
return _uiCtrDict[ui];
|
|
}
|
|
}
|
|
}
|
|
|