bingo 项目提交
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class JTermCtrl : BaseCtrl
|
||||
{
|
||||
public static JTermCtrl Instance { get; private set; }
|
||||
|
||||
private JTermModel model;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ff5e6c030cfe4bc2b85946be57987962
|
||||
timeCreated: 1680858658
|
||||
@@ -0,0 +1,23 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class JTermModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnReset()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 044901d97fcf486e9e7cdcc0f795e018
|
||||
timeCreated: 1680858658
|
||||
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using FairyGUI;
|
||||
using UnityEngine;
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.Asset;
|
||||
using System.Globalization;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class JTermUI : BaseUI
|
||||
{
|
||||
private JTermUICtrl ctrl;
|
||||
private JTermModel model;
|
||||
private FGUI.JPrivacy.com_privacy ui;
|
||||
|
||||
private string content;
|
||||
|
||||
private bool isTerm;
|
||||
|
||||
public JTermUI(JTermUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.JTermUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "JPrivacy";
|
||||
uiInfo.assetName = "com_privacy";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = true;
|
||||
uiInfo.isNeedCloseAnim = true;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
ui?.FadeOut();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.JPrivacy.com_privacy;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (args != null)
|
||||
{
|
||||
isTerm = (bool)args;
|
||||
}
|
||||
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
ui?.FadeIn();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
ui.txt_title.text = isTerm ? "Terms of Service" : "Privacy Policy";
|
||||
|
||||
|
||||
|
||||
BetKit.Instance.LoadAsset<TextAsset>("TextAsset", isTerm ? "Term" : "Privacy", (txt) =>
|
||||
{
|
||||
content = txt.text;
|
||||
|
||||
var str = getstr(content, 16327);
|
||||
|
||||
foreach (var t in str)
|
||||
{
|
||||
var aRichTextField = new GTextField();
|
||||
aRichTextField.SetSize(GRoot.inst.width, 100);
|
||||
aRichTextField.color = new Color32(81, 81, 81,1);
|
||||
|
||||
|
||||
aRichTextField.textFormat.size = 38;
|
||||
aRichTextField.textFormat.bold=true;
|
||||
aRichTextField.autoSize = AutoSizeType.Height;
|
||||
aRichTextField.AddRelation(GRoot.inst, RelationType.Width);
|
||||
aRichTextField.text = t;
|
||||
ui.list_privacy.AddChild(aRichTextField);
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
ui.closeButton.SetClick(CtrlCloseUI);
|
||||
}
|
||||
|
||||
public string[] getstr(string strs, int len)
|
||||
{
|
||||
double i = strs.Length;
|
||||
string[] myarray = new string[int.Parse(Math.Ceiling(i / len).ToString())];
|
||||
for (int j = 0; j < myarray.Length; j++)
|
||||
{
|
||||
len = len <= strs.Length ? len : strs.Length;
|
||||
myarray[j] = strs.Substring(0, len);
|
||||
strs = strs.Substring(len, strs.Length - len);
|
||||
}
|
||||
|
||||
return myarray;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 98c03668211f439db1c4857c929c420a
|
||||
timeCreated: 1680858658
|
||||
@@ -0,0 +1,71 @@
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class JTermUICtrl : BaseUICtrl
|
||||
{
|
||||
private JTermUI ui;
|
||||
private JTermModel model;
|
||||
|
||||
private uint openUIMsg = SkinInfo.JTermUI_Open;
|
||||
private uint closeUIMsg = SkinInfo.JTermUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new JTermUI(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);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 08b56c1864624ee9aae99719b6b5b9c0
|
||||
timeCreated: 1680858658
|
||||
Reference in New Issue
Block a user