提交小游戏项目
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace TowerClimberChronicles
|
||||
{
|
||||
public class FlowerUnlockItemCtrl : BaseCtrl
|
||||
{
|
||||
public static FlowerUnlockItemCtrl Instance { get; private set; }
|
||||
|
||||
private FlowerUnlockItemModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.FlowerUnlockItemModel) as FlowerUnlockItemModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b445c8f92648b4e2db8fecd6167f14af
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
namespace TowerClimberChronicles
|
||||
{
|
||||
public class FlowerUnlockItemModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a4c56765635fb444688afacb9fec4358
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,104 @@
|
||||
|
||||
using FGUI.ZM_Common_01;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using SGModule.DataStorage;
|
||||
|
||||
namespace TowerClimberChronicles
|
||||
{
|
||||
public class FlowerUnlockItemUI : BaseUI
|
||||
{
|
||||
private FlowerUnlockItemUICtrl ctrl;
|
||||
private FlowerUnlockItemModel model;
|
||||
private FGUI.Game_flower_buy.com_unlockitem ui;
|
||||
|
||||
public FlowerUnlockItemUI(FlowerUnlockItemUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.FlowerUnlockItemUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "Game_flower_buy";
|
||||
uiInfo.assetName = "com_unlockitem";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.FlowerUnlockItemModel) as FlowerUnlockItemModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.Game_flower_buy.com_unlockitem;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
int type = (int)args;
|
||||
ui.type.selectedIndex = type;
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
if (type == 0)
|
||||
{
|
||||
DataMgr.FlowerItem0.Value = DataMgr.FlowerItem0.Value + 1;
|
||||
DataMgr.FlowerItemUnlock.Value[0] = true;
|
||||
}
|
||||
else if (type == 1)
|
||||
{
|
||||
DataMgr.FlowerItem1.Value = DataMgr.FlowerItem1.Value + 1;
|
||||
DataMgr.FlowerItemUnlock.Value[1] = true;
|
||||
}
|
||||
else if (type == 2)
|
||||
{
|
||||
DataMgr.FlowerItem2.Value = DataMgr.FlowerItem2.Value + 1;
|
||||
DataMgr.FlowerItemUnlock.Value[2] = true;
|
||||
}
|
||||
DataMgr.FlowerItemUnlock.Save();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.FlowerBuyItem);
|
||||
CtrlCloseUI();
|
||||
});
|
||||
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()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d15e2a8e344c34a4496df91173331c1e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
namespace TowerClimberChronicles
|
||||
{
|
||||
public class FlowerUnlockItemUICtrl : BaseUICtrl
|
||||
{
|
||||
private FlowerUnlockItemUI ui;
|
||||
private FlowerUnlockItemModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.FlowerUnlockItemUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.FlowerUnlockItemUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.FlowerUnlockItemModel) as FlowerUnlockItemModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new FlowerUnlockItemUI(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: 0bd3aed9ca30a47ec89d3eceee9b4fb3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user