feat:1、添加项目
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class ChatChooseCtrl : BaseCtrl
|
||||
{
|
||||
public static ChatChooseCtrl Instance { get; private set; }
|
||||
|
||||
private ChatChooseModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.ChatChooseModel) as ChatChooseModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9eb2f8cf020ff4c0eb19c2f692b8671a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class ChatChooseModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c92b4256954442228fec21a2bea9c70
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,160 @@
|
||||
|
||||
using FGUI.ZM_Common_01;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using IgnoreOPS;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class ChatChooseUI : BaseUI
|
||||
{
|
||||
private ChatChooseUICtrl ctrl;
|
||||
private ChatChooseModel model;
|
||||
private FGUI.LG_AIchat.com_chatChoose ui;
|
||||
|
||||
public ChatChooseUI(ChatChooseUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.ChatChooseUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "LG_AIchat";
|
||||
uiInfo.assetName = "com_chatChoose";
|
||||
uiInfo.layerType = UILayerType.Normal;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.ChatChooseModel) as ChatChooseModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.LG_AIchat.com_chatChoose;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (Screen.safeArea.y != 0)
|
||||
{
|
||||
ui.btn_gold.y += Screen.safeArea.y - 15;
|
||||
}
|
||||
InitView();
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.ChatChooseUI_Close);
|
||||
});
|
||||
RefreshRed();
|
||||
ui.btn_0.SetClick(() =>
|
||||
{
|
||||
if (DataMgr.IsUnlockChat.Value < 0 && GameHelper.GetVipLevel() < 0)//未解锁。
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SecretUnlockUI_Open, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DataMgr.IsUnlockChat.Value == 0)
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.UnlockTipsUI_Open, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.ChatUI_Open, 0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
ui.btn_1.SetClick(() =>
|
||||
{
|
||||
if (DataMgr.IsUnlockChat.Value < 0 && GameHelper.GetVipLevel() < 0)//未解锁。
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SecretUnlockUI_Open, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DataMgr.IsUnlockChat.Value == 0)
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.UnlockTipsUI_Open, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.ChatUI_Open, 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
ui.btn_2.SetClick(() =>
|
||||
{
|
||||
if (DataMgr.IsUnlockChat.Value < 0 && GameHelper.GetVipLevel() < 0)//未解锁。
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SecretUnlockUI_Open, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (DataMgr.IsUnlockChat.Value == 0)
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.UnlockTipsUI_Open, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.ChatUI_Open, 2);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
public void SetTopCurr(object a = null)
|
||||
{
|
||||
var btn_gold = ui.btn_gold as com_gold;
|
||||
btn_gold.text_gold.text = $"{DataMgr.Coin.Value:N0}";
|
||||
|
||||
|
||||
|
||||
}
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
GameDispatcher.Instance.AddListener(GameMsg.Gold_refresh, SetTopCurr);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.RefreshRedDot, RefreshRed);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.Gold_refresh, SetTopCurr);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.RefreshRedDot, RefreshRed);
|
||||
}
|
||||
#endregion
|
||||
private void RefreshRed(object isShow = null)
|
||||
{
|
||||
ui.btn_0.red.visible = ChatHelper.GetChatRed(0);
|
||||
ui.btn_1.red.visible = ChatHelper.GetChatRed(1);
|
||||
ui.btn_2.red.visible = ChatHelper.GetChatRed(2);
|
||||
}
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
SetTopCurr();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 83e9ae6711260435092c4e1af2e4ff5c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class ChatChooseUICtrl : BaseUICtrl
|
||||
{
|
||||
private ChatChooseUI ui;
|
||||
private ChatChooseModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.ChatChooseUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.ChatChooseUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.ChatChooseModel) as ChatChooseModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new ChatChooseUI(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);
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d217670d04bcc416790bd6b0d443de38
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user