feat:1、添加项目
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class SubUnlockCtrl : BaseCtrl
|
||||
{
|
||||
public static SubUnlockCtrl Instance { get; private set; }
|
||||
|
||||
private SubUnlockModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.SubUnlockModel) as SubUnlockModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 049e2bdfed97e46d9aacaaf297a8c89e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class SubUnlockModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 955ab31d0977643cd9ffe11228d6e524
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,145 @@
|
||||
|
||||
using FGUI.ZM_Common_01;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using SGModule.NetKit;
|
||||
using Spine.Unity;
|
||||
using System;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class SubUnlockUI : BaseUI
|
||||
{
|
||||
private SubUnlockUICtrl ctrl;
|
||||
private SubUnlockModel model;
|
||||
private FGUI.LG_Unlock.com_SubUnlock ui;
|
||||
|
||||
public SubUnlockUI(SubUnlockUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.SubUnlockUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "LG_Unlock";
|
||||
uiInfo.assetName = "com_SubUnlock";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.SubUnlockModel) as SubUnlockModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
closeCallback?.Invoke();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.LG_Unlock.com_SubUnlock;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
InitView();
|
||||
|
||||
TrackKit.SendEvent(ADEventTrack.Subscription, ADEventTrack.Property.vip_show_sell);
|
||||
|
||||
}
|
||||
|
||||
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.BuyVip, refrsh);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.BuyVip, refrsh);
|
||||
}
|
||||
#endregion
|
||||
private void refrsh(object a = null)
|
||||
{
|
||||
GameHelper.ShowTips("unlock_vip", true);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
private Action closeCallback;
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
SkeletonAnimation ske_pot = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_parent, Fx_Type.fx_chatphone, ref closeCallback);
|
||||
ske_pot.state.SetAnimation(0, "animation", true);
|
||||
var vip_list = ConfigSystem.GetConfig<VipClub>();
|
||||
ui.text_unlockLive.SetVar("num", GameHelper.GetCommonModel().UnlockLive[1].ToString()).FlushVars();
|
||||
ui.text_unlockAlbum.SetVar("num", GameHelper.GetCommonModel().UnlockSecret[1].ToString()).FlushVars();
|
||||
ui.btn_vip0.text_price.text = GameHelper.getPrice((decimal)vip_list[0].DiscountPrice);
|
||||
ui.btn_vip1.text_price.text = GameHelper.getPrice((decimal)vip_list[1].DiscountPrice);
|
||||
ui.btn_vip2.text_price.text = GameHelper.getPrice((decimal)vip_list[2].DiscountPrice);
|
||||
ui.btn_vip0.SetClick(() =>
|
||||
{
|
||||
string _type = "vip_club" + 0;
|
||||
ApplePayClass maxPayData = new ApplePayClass
|
||||
{
|
||||
amount = (int)System.Math.Round(vip_list[0].DiscountPrice * 100),
|
||||
sku = IAPPayManager.PRODUCT_VIP_WEEK,
|
||||
currency = "USD",
|
||||
shopName = _type
|
||||
};
|
||||
MaxPayManager.Instance.Buy(maxPayData);
|
||||
});
|
||||
|
||||
ui.btn_vip1.SetClick(() =>
|
||||
{
|
||||
string _type = "vip_club" + 1;
|
||||
ApplePayClass maxPayData = new ApplePayClass
|
||||
{
|
||||
amount = (int)System.Math.Round(vip_list[1].DiscountPrice * 100),
|
||||
sku = IAPPayManager.PRODUCT_VIP_MONTH,
|
||||
currency = "USD",
|
||||
shopName = _type
|
||||
};
|
||||
MaxPayManager.Instance.Buy(maxPayData);
|
||||
});
|
||||
|
||||
ui.btn_vip2.SetClick(() =>
|
||||
{
|
||||
string _type = "vip_club" + 2;
|
||||
ApplePayClass maxPayData = new ApplePayClass
|
||||
{
|
||||
amount = (int)System.Math.Round(vip_list[2].DiscountPrice * 100),
|
||||
sku = IAPPayManager.PRODUCT_VIP_YEAR,
|
||||
currency = "USD",
|
||||
shopName = _type
|
||||
};
|
||||
MaxPayManager.Instance.Buy(maxPayData);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fabe169f21e25495691f8eef32677d91
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class SubUnlockUICtrl : BaseUICtrl
|
||||
{
|
||||
private SubUnlockUI ui;
|
||||
private SubUnlockModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.SubUnlockUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.SubUnlockUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.SubUnlockModel) as SubUnlockModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new SubUnlockUI(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: 5ab2a65a4e39f41648d4d0fdf38ab3d2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user