ball 项目提交
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class PassunlockCtrl : BaseCtrl
|
||||
{
|
||||
public static PassunlockCtrl Instance { get; private set; }
|
||||
|
||||
private PassunlockModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.PassunlockModel) as PassunlockModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b53fa48e580b4882a9c0441fac55e15
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class PassunlockModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb4bc378cc43143cdaa3c2fa20c27548
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,165 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using FairyGUI;
|
||||
using FGUI.ZM_Common_01;
|
||||
using IgnoreOPS;
|
||||
using SGModule.NetKit;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class PassunlockUI : BaseUI
|
||||
{
|
||||
private PassunlockUICtrl ctrl;
|
||||
private PassunlockModel model;
|
||||
private FGUI.ZM_Pass_14.com_passunlock ui;
|
||||
|
||||
public btn_watchAd btn_WatchAd;
|
||||
|
||||
public PassunlockUI(PassunlockUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.PassunlockUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Pass_14";
|
||||
uiInfo.assetName = "com_passunlock";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.PassunlockModel) as PassunlockModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
AdExchangeManager.Instance.Destroy();
|
||||
GameHelper.CallShowTurn();
|
||||
|
||||
if (_loader != null && !_loader.isDisposed && _loader.texture != null)
|
||||
{
|
||||
_loader.texture = null;
|
||||
}
|
||||
_loader = null;
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Pass_14.com_passunlock;
|
||||
}
|
||||
|
||||
private GLoader _loader = new GLoader();
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
_loader = ui.loader.picture;
|
||||
|
||||
if (GameHelper.IsAdModelOfPay()) {
|
||||
ui.pay_type.selectedIndex = 0;
|
||||
AdExchangeManager.Instance.SetWatchAd(PurchasingManager.GetPaySku(PayType.battle_pass), ui.btn_buypass as btn_watchAd,SetTextString);
|
||||
|
||||
AdExchangeManager.Instance.Start();
|
||||
SetTextString();
|
||||
|
||||
} else {
|
||||
ui.pay_type.selectedIndex = 1;
|
||||
decimal price = (decimal)GameHelper.GetCommonModel().Passportgift2;
|
||||
ui.btn_max_pay.title = GameHelper.Get102Str(price);
|
||||
|
||||
ui.btn_max_pay.SetClick(() => {
|
||||
ApplePayClass maxPayData = new ApplePayClass
|
||||
{
|
||||
amount = (int)Math.Round(price * 100),
|
||||
sku = PurchasingManager.GetPaySku(PayType.battle_pass),
|
||||
currency = "USD"
|
||||
};
|
||||
MaxPayManager.Instance.Buy(maxPayData);
|
||||
});
|
||||
}
|
||||
|
||||
InitView();
|
||||
TrackKit.SendEvent(GameHelper.getTrackEvenName(), ADEventTrack.Property.master_pass_show);
|
||||
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
ui.state.selectedIndex = 1;
|
||||
var fileName = GameHelper.GetBackgroundName(des_key.pass_gift.ToString());
|
||||
TextureHelper.SetImgLoader(ui.loader.picture, fileName, null, "Background/", FolderNames.BackgroundName);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.state.selectedIndex = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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.apple_pay_success, pay_success);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.apple_pay_success, pay_success);
|
||||
}
|
||||
#endregion
|
||||
void pay_success(object str)
|
||||
{
|
||||
string type = (string)str;
|
||||
string purch_number = "";
|
||||
|
||||
if (type == PurchasingManager.GetPaySku(PayType.battle_pass))
|
||||
{
|
||||
CtrlCloseUI();
|
||||
}
|
||||
// if (purch_number != "")
|
||||
// {
|
||||
// GameHelper.SendRevenueToAF(purch_number);
|
||||
// }
|
||||
}
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
ui.btn_close.SetClick(CtrlCloseUI);
|
||||
int gold = 0;
|
||||
|
||||
List<Passportrewards> Passportrewards_list = ConfigSystem.GetConfig<Passportrewards>();
|
||||
for (int i = 0; i < Passportrewards_list.Count; i++)
|
||||
{
|
||||
|
||||
if (Passportrewards_list[i].Paid_rewards_type == 0) gold += Passportrewards_list[i].Paid_rewards_num;
|
||||
|
||||
}
|
||||
ui.text_allgold.text = GameHelper.Get101Str(gold);
|
||||
|
||||
}
|
||||
|
||||
public void SetTextString()
|
||||
{
|
||||
var need = AdExchangeManager.Instance.GetCeilingNeedAds(PurchasingManager.GetPaySku(PayType.battle_pass));
|
||||
var myAd = AdExchangeManager.Instance.GetLookRewardADNum();
|
||||
|
||||
ui.tips.SetVar("num", need.ToString()).FlushVars();
|
||||
ui.ads.SetVar("num", myAd.ToString()).FlushVars();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6923c290d351644508b81cee1a88e1d8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,74 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class PassunlockUICtrl : BaseUICtrl
|
||||
{
|
||||
private PassunlockUI ui;
|
||||
private PassunlockModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.PassunlockUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.PassunlockUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.PassunlockModel) as PassunlockModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new PassunlockUI(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: 9730d87819cc94ea5b1f8a5871d19ccc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user