117 lines
2.7 KiB
C#
117 lines
2.7 KiB
C#
|
|
|
|
|
|
using DG.Tweening;
|
|
using FGUI.ZM_H5_15;
|
|
using IgnoreOPS;
|
|
using SGModule.NetKit;
|
|
using UnityEngine;
|
|
|
|
namespace ChillConnect
|
|
{
|
|
public class H5UI : BaseUI
|
|
{
|
|
private H5UICtrl ctrl;
|
|
private H5Model model;
|
|
private com_webview ui;
|
|
|
|
public H5UI(H5UICtrl ctrl) : base(ctrl)
|
|
{
|
|
uiName = UIConst.H5UI;
|
|
this.ctrl = ctrl;
|
|
}
|
|
|
|
protected override void SetUIInfo(UIInfo uiInfo)
|
|
{
|
|
uiInfo.packageName = "ZM_H5_15";
|
|
uiInfo.assetName = "com_webview";
|
|
uiInfo.layerType = UILayerType.Popup;
|
|
uiInfo.isNeedOpenAnim = false;
|
|
uiInfo.isNeedCloseAnim = false;
|
|
uiInfo.isNeedUIMask = true;
|
|
}
|
|
|
|
#region 生命周期
|
|
protected override void OnInit()
|
|
{
|
|
//model = ModuleManager.Instance.GetModel(ModelConst.H5Model) as H5Model;
|
|
}
|
|
|
|
protected override void OnClose()
|
|
{
|
|
FreeWebViewManager.Instance.CloseWeb();
|
|
|
|
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
|
|
|
|
GameDispatcher.Instance.Dispatch(GameMsg.showBroadCast);
|
|
|
|
HallManager.Instance.SetCameraVisible(true);
|
|
|
|
}
|
|
|
|
protected override void OnBind()
|
|
{
|
|
ui = baseUI as FGUI.ZM_H5_15.com_webview;
|
|
}
|
|
|
|
private SDKOpenConfig _config;
|
|
protected override void OnOpenBefore(object args)
|
|
{
|
|
if (args is not SDKOpenConfig openConfig) return;
|
|
|
|
_config = openConfig;
|
|
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
|
|
|
|
// Debug.Log($"H5UI OpenBefore url: {_config.url} normal: {_config.normal}");
|
|
|
|
DOVirtual.DelayedCall(0.1f, () =>
|
|
{
|
|
FreeWebViewManager.Instance.OpenWeb(_config.url);
|
|
});
|
|
|
|
GameDispatcher.Instance.Dispatch(GameMsg.hideBroadCast);
|
|
|
|
|
|
ui.btn_close.SetClick(() =>
|
|
{
|
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Close);
|
|
});
|
|
InitView();
|
|
|
|
}
|
|
|
|
protected override void OnOpen(object args)
|
|
{
|
|
}
|
|
|
|
protected override void OnHide()
|
|
{
|
|
}
|
|
|
|
protected override void OnDisplay(object args)
|
|
{
|
|
}
|
|
#endregion
|
|
|
|
#region 消息
|
|
protected override void AddListener()
|
|
{
|
|
|
|
}
|
|
protected override void RemoveListener()
|
|
{
|
|
|
|
}
|
|
#endregion
|
|
|
|
//初始化页面逻辑
|
|
private void InitView()
|
|
{
|
|
}
|
|
public void ClickBtn(string name)
|
|
{
|
|
|
|
}
|
|
|
|
}
|
|
} |