fix:1、更换项目,使用winter来创建
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class ChatNumberCtrl : BaseCtrl
|
||||
{
|
||||
public static ChatNumberCtrl Instance { get; private set; }
|
||||
|
||||
private ChatNumberModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.ChatNumberModel) as ChatNumberModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0f1c72491f98a47f9984461d5b5797ec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class ChatNumberModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b99d4915960364dcf83eda361634c06c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,116 @@
|
||||
|
||||
using FGUI.ZM_Common_01;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class ChatNumberUI : BaseUI
|
||||
{
|
||||
private ChatNumberUICtrl ctrl;
|
||||
private ChatNumberModel model;
|
||||
private FGUI.LG_AIchat.com_ChatNumber ui;
|
||||
|
||||
public ChatNumberUI(ChatNumberUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.ChatNumberUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "LG_AIchat";
|
||||
uiInfo.assetName = "com_ChatNumber";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.ChatNumberModel) as ChatNumberModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.LG_AIchat.com_ChatNumber;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
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()
|
||||
{
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
});
|
||||
int[] array = GameHelper.GetCommonModel().CoinsAccess;
|
||||
ui.text_coins.SetVar("coin", array[0].ToString()).FlushVars();
|
||||
ui.text_coins.SetVar("num", array[1].ToString()).FlushVars();
|
||||
ui.text_ads.SetVar("num", GameHelper.GetCommonModel().AdAccess.ToString()).FlushVars();
|
||||
ui.btn_coins.title = array[0].ToString();
|
||||
ui.btn_coins.SetClick(() =>
|
||||
{
|
||||
if (DataMgr.Coin.Value >= array[0])
|
||||
{
|
||||
DataMgr.Coin.Value -= array[0];
|
||||
DataMgr.ChatNumber.Value += array[1];
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.AddChatNum);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
CtrlCloseUI();
|
||||
GameHelper.ShowTips("more_message", true);
|
||||
}
|
||||
else GameHelper.ShowTips("no_enough_gold", true);
|
||||
});
|
||||
|
||||
ui.btn_watch.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowVideoAd("TaskReward", (issuccess) =>
|
||||
{
|
||||
if (issuccess)
|
||||
{
|
||||
DataMgr.ChatNumber.Value += GameHelper.GetCommonModel().AdAccess;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.AddChatNum);
|
||||
CtrlCloseUI();
|
||||
GameHelper.ShowTips("more_message", true);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6aa550f4b878c46b1b94f94bd8344e29
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class ChatNumberUICtrl : BaseUICtrl
|
||||
{
|
||||
private ChatNumberUI ui;
|
||||
private ChatNumberModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.ChatNumberUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.ChatNumberUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.ChatNumberModel) as ChatNumberModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new ChatNumberUI(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: cfc256c0532ea497899ef69ce0fc0e54
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user