feat:1、添加项目
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9717499f5de1c4919858e43697142105
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,45 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AdcomingCtrl : BaseCtrl
|
||||
{
|
||||
public static AdcomingCtrl Instance { get; private set; }
|
||||
|
||||
private AdcomingModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.AdcomingModel) as AdcomingModel;
|
||||
}
|
||||
|
||||
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: c8bd042de9ef64e59b65fefb9788f71d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,30 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AdcomingModel : 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: 29789969ee11944f8be5196fc0b81532
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,102 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using FutureCore;
|
||||
using FairyGUI;
|
||||
using DG.Tweening;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AdcomingUI : BaseUI
|
||||
{
|
||||
private AdcomingUICtrl ctrl;
|
||||
private AdcomingModel model;
|
||||
private FGUI.ZM_Pack_16.com_adcoming ui;
|
||||
|
||||
public AdcomingUI(AdcomingUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.AdcomingUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Pack_16";
|
||||
uiInfo.assetName = "com_adcoming";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.AdcomingModel) as AdcomingModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Pack_16.com_adcoming;
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
GameDispatcher.Instance.AddListener(GameMsg.pack_close, playAni);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.pack_close, playAni);
|
||||
}
|
||||
#endregion
|
||||
private int time = 5;
|
||||
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
ui.time_text.text = time.ToString();
|
||||
|
||||
tweer = DOVirtual.Float(time, 0, time, value => { ui.time_text.text = ((int)value).ToString(); });
|
||||
tweer.onComplete += () =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
GameHelper.ShowInterstitial("interstitial_gameend");
|
||||
};
|
||||
|
||||
ui.btn_removead.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LuckyPackUI_Open,true);
|
||||
tweer.Pause();
|
||||
});
|
||||
|
||||
}
|
||||
private Tween tweer;
|
||||
void playAni(object a)
|
||||
{
|
||||
tweer.Play();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dfe9a378b6c07410b91e71ce80c75a05
|
||||
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 AdcomingUICtrl : BaseUICtrl
|
||||
{
|
||||
private AdcomingUI ui;
|
||||
private AdcomingModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.AdcomingUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.AdcomingUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.AdcomingModel) as AdcomingModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new AdcomingUI(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: dbf393f35eff5477da2f9c69a02c3822
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3ec7125d0333e284db6729a02dd964b0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AddViewCtrl : BaseCtrl
|
||||
{
|
||||
public static AddViewCtrl Instance { get; private set; }
|
||||
|
||||
private AddViewModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.AddViewModel) as AddViewModel;
|
||||
}
|
||||
|
||||
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: b6058e09514454ec394a1478f2775964
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AddViewModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
// protected override void OnReset()
|
||||
// {
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// #region 读取数据
|
||||
// protected override void OnReadData()
|
||||
// {
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// #region 本地存储
|
||||
// protected override void WriteLocalStorage()
|
||||
// {
|
||||
|
||||
// }
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1b0a4fbab97e64d5b982896192bb6483
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,222 @@
|
||||
using System;
|
||||
using FairyGUI;
|
||||
using Spine.Unity;
|
||||
using System.Collections.Generic;
|
||||
using SGModule.NetKit;
|
||||
using FGUI.ZM_Common_01;
|
||||
using IgnoreOPS;
|
||||
using FGUI.ZM_AddCell_12;
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AddViewUI : BaseUI
|
||||
{
|
||||
private AddViewUICtrl ctrl;
|
||||
private AddViewModel model;
|
||||
private FGUI.ZM_AddCell_12.com_addView ui;
|
||||
public int ad_cool_down = 120;
|
||||
public btn_watchAd btn_WatchAd;
|
||||
private Action closeCallback;
|
||||
private bool isAutoPop = false;
|
||||
|
||||
public AddViewUI(AddViewUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.AddViewUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_AddCell_12";
|
||||
uiInfo.assetName = "com_addView";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.AddViewModel) as AddViewModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameHelper.showGameUI = true;
|
||||
HallManager.Instance.UpdateSecondEvent -= updateWatchCD;
|
||||
|
||||
if (GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
AdExchangeManager.Instance.Destroy();
|
||||
}
|
||||
if (isAutoPop)
|
||||
{
|
||||
GameHelper.CallShowTurn();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_AddCell_12.com_addView;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (args != null)
|
||||
{
|
||||
isAutoPop = (bool)args;
|
||||
}
|
||||
TrackKit.SendEvent(GameHelper.getTrackEvenName(), ADEventTrack.Property.buy_one_show);
|
||||
// var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_node as GGraph, Fx_Type.fx_add, ref closeCallback);
|
||||
// sk.state.SetAnimation(0, "animation", true);
|
||||
|
||||
// ad_cool_down = ConfigSystem.GetCommonConf().exchangeCD;
|
||||
// btn_WatchAd = ui.btn_watch as btn_watchAd;
|
||||
if (GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
AdExchangeManager.Instance.SetWatchAd(IAPPayManager.PRODUCT_SPACE_BONUS, ui.btn_watch as btn_watchAd, SetTextString);
|
||||
ui.pay_type.selectedIndex = 0;
|
||||
|
||||
|
||||
AdExchangeManager.Instance.Start();
|
||||
SetTextString();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.pay_type.selectedIndex = 1;
|
||||
decimal price = (decimal)GameHelper.GetCommonModel().addspace2;
|
||||
ui.btn_max_pay.title = GameHelper.getPrice(price);
|
||||
ui.btn_max_pay.SetClick(() =>
|
||||
{
|
||||
ApplePayClass maxPayData = new ApplePayClass
|
||||
{
|
||||
amount = (int)Math.Round(price * 100),
|
||||
sku = IAPPayManager.PRODUCT_SPACE_BONUS,//IAPPayManager.PRODUCT_SPACE_BONUS,
|
||||
currency = "USD"
|
||||
};
|
||||
MaxPayManager.Instance.Buy(maxPayData);
|
||||
});
|
||||
}
|
||||
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
ui.broad.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.broad.visible = false;
|
||||
}
|
||||
|
||||
InitView();
|
||||
}
|
||||
|
||||
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.IAP_PAY_SUCCESS, pay_success);
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.IAP_PAY_SUCCESS, pay_success);
|
||||
|
||||
}
|
||||
#endregion
|
||||
void pay_success(object str)
|
||||
{
|
||||
string type = (string)str;
|
||||
|
||||
if (type == IAPPayManager.PRODUCT_SPACE_BONUS)
|
||||
{
|
||||
CtrlCloseUI();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.resurgence_close);
|
||||
});
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent += updateWatchCD;
|
||||
InitBroadCast();
|
||||
|
||||
// checkBtnState();
|
||||
|
||||
}
|
||||
|
||||
void updateWatchCD()
|
||||
{
|
||||
broadtime++;
|
||||
BroadCast();
|
||||
}
|
||||
|
||||
public void SetTextString()
|
||||
{
|
||||
var need = AdExchangeManager.Instance.GetCeilingNeedAds(IAPPayManager.PRODUCT_SPACE_BONUS);
|
||||
var myAd = AdExchangeManager.Instance.GetLookRewardADNum();
|
||||
|
||||
ui.tips.SetVar("num", need.ToString()).FlushVars();
|
||||
ui.ads.SetVar("num", myAd.ToString()).FlushVars();
|
||||
}
|
||||
|
||||
private int broadtime = 1;
|
||||
private List<string> config_name_list = LevelAttemptsModel.config_name_list;
|
||||
private List<string> config_money_list = LevelAttemptsModel.config_money_list;
|
||||
private List<string[]> broad_list = new List<string[]>();
|
||||
private void BroadCast()
|
||||
{
|
||||
if (broadtime % 3 == 0)
|
||||
{
|
||||
(ui.broad as com_broadcast_new).t1.Play(() =>
|
||||
{
|
||||
broad_list.RemoveAt(0);
|
||||
int name_index = UnityEngine.Random.Range(0, config_name_list.Count);
|
||||
int money_index = UnityEngine.Random.Range(0, config_money_list.Count);
|
||||
broad_list.Add(new string[2] { config_name_list[name_index], config_money_list[money_index] });
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
text_list[i].text = Language.GetContentParams("congratulations_des", new[] { broad_list[i][0], broad_list[i][1] });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
private List<GTextField> text_list = new List<GTextField>();
|
||||
private void InitBroadCast()
|
||||
{
|
||||
text_list.Add((ui.broad as com_broadcast_new).text_0);
|
||||
text_list.Add((ui.broad as com_broadcast_new).text_1);
|
||||
text_list.Add((ui.broad as com_broadcast_new).text_2);
|
||||
text_list.Add((ui.broad as com_broadcast_new).text_3);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
|
||||
int name_index = UnityEngine.Random.Range(0, config_name_list.Count);
|
||||
int money_index = UnityEngine.Random.Range(0, config_money_list.Count);
|
||||
broad_list.Add(new string[2] { config_name_list[name_index], config_money_list[money_index] });
|
||||
text_list[i].text = Language.GetContentParams("congratulations_des", new[] { broad_list[i][0], broad_list[i][1] });
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40b42d370a2c34db89da3decb4b3ba0d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AddViewUICtrl : BaseUICtrl
|
||||
{
|
||||
private AddViewUI ui;
|
||||
private AddViewModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.BuyslotUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.BuyslotUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.AddViewModel) as AddViewModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new AddViewUI(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: 4c4feca1f3dc94e0291dbe534b773067
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 03f5040aa3631dd489bb4175ed68336f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AddViewoffCtrl : BaseCtrl
|
||||
{
|
||||
public static AddViewoffCtrl Instance { get; private set; }
|
||||
|
||||
private AddViewoffModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.AddViewoffModel) as AddViewoffModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6254fab7306ab4f54b9ddc37e9f9c554
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AddViewoffModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8927197c6cb1f412d83d93ded8cf1589
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,233 @@
|
||||
|
||||
using FairyGUI;
|
||||
using SGModule.NetKit;
|
||||
using Spine.Unity;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using IgnoreOPS;
|
||||
using FGUI.ZM_Common_01;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AddViewoffUI : BaseUI
|
||||
{
|
||||
private AddViewoffUICtrl ctrl;
|
||||
private AddViewoffModel model;
|
||||
private FGUI.ZM_AddCell_12.com_addView_off ui;
|
||||
private Action closeCallback;
|
||||
private bool isAutoPop = false;
|
||||
|
||||
public AddViewoffUI(AddViewoffUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.AddViewoffUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_AddCell_12";
|
||||
uiInfo.assetName = "com_addView_off";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.AddViewoffModel) as AddViewoffModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameHelper.showGameUI = true;
|
||||
HallManager.Instance.UpdateSecondEvent -= updateWatchCD;
|
||||
if (GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
AdExchangeManager.Instance.Destroy();
|
||||
}
|
||||
closeCallback?.Invoke();
|
||||
if (isAutoPop)
|
||||
{
|
||||
GameHelper.CallShowTurn();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_AddCell_12.com_addView_off;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (args != null)
|
||||
{
|
||||
isAutoPop = (bool)args;
|
||||
}
|
||||
|
||||
TrackKit.SendEvent(GameHelper.getTrackEvenName(), ADEventTrack.Property.BuyOneOffShow);
|
||||
|
||||
// ad_cool_down = ConfigSystem.GetCommonConf().exchangeCD;
|
||||
// btn_WatchAd = ui.btn_watch as btn_watchAd;
|
||||
if (GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
// AdExchangeManager.Instance.SetWatchAd(PurchasingManager.GetPaySku(PayType.buy_one_off), ui.btn_watch as btn_watchAd, SetTextString);
|
||||
// ui.pay_type.selectedIndex = 0;
|
||||
// ui.text_old_price.text = GameHelper.GetCommonModel().addspace + "ADs";
|
||||
// btn_watchAd btn = ui.btn_watch as btn_watchAd;
|
||||
//
|
||||
// AdExchangeManager.Instance.Start();
|
||||
// SetTextString();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.pay_type.selectedIndex = 1;
|
||||
ui.text_old_price.text = GameHelper.getPrice((decimal)GameHelper.GetCommonModel().addspace2);
|
||||
decimal price = (decimal)GameHelper.GetCommonModel().AddDiscount2;
|
||||
ui.btn_max_pay.title = GameHelper.getPrice(price);
|
||||
ui.btn_max_pay.SetClick(() =>
|
||||
{
|
||||
// ApplePayClass maxPayData = new ApplePayClass
|
||||
// {
|
||||
// amount = (int)Math.Round(price * 100),
|
||||
// sku = PurchasingManager.GetPaySku(PayType.buy_one_off),
|
||||
// currency = "USD"
|
||||
// };
|
||||
// MaxPayManager.Instance.Buy(maxPayData);
|
||||
});
|
||||
}
|
||||
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
ui.broad.visible = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.broad.visible = false;
|
||||
}
|
||||
|
||||
InitView();
|
||||
InitBroadCast();
|
||||
}
|
||||
|
||||
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.IAP_PAY_SUCCESS, pay_success);
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.IAP_PAY_SUCCESS, pay_success);
|
||||
|
||||
}
|
||||
#endregion
|
||||
void pay_success(object str)
|
||||
{
|
||||
string type = (string)str;
|
||||
|
||||
// if (type == PurchasingManager.GetPaySku(PayType.buy_one_off))
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Close);
|
||||
// SaveData.GetSaveObject().have_slot = true;
|
||||
// SaveData.SaveDataFunc();
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Slot_refresh);
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.resurgence_close);
|
||||
// CtrlCloseUI();
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
// var tAnimation = FXManager.Instance.SetFx<SkeletonAnimation>(ui.tip_parent, Fx_Type.Fx_AddBoxTip, ref _closeCallback);
|
||||
// tAnimation.state.AddAnimation(0, "animation", true, 0);
|
||||
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.resurgence_close);
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent += updateWatchCD;
|
||||
// updateWatchCD();
|
||||
|
||||
// checkBtnState();
|
||||
|
||||
}
|
||||
void updateWatchCD()
|
||||
{
|
||||
ui.text_time.text = CommonHelper.TimeFormat((int)SaveData.GetSaveObject().addview_off_time - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
|
||||
broadtime++;
|
||||
BroadCast();
|
||||
}
|
||||
|
||||
public void SetTextString()
|
||||
{
|
||||
// var need = AdExchangeManager.Instance.GetCeilingNeedAds(PurchasingManager.GetPaySku(PayType.buy_one_off));
|
||||
// var myAd = AdExchangeManager.Instance.GetLookRewardADNum();
|
||||
//
|
||||
// ui.tips.SetVar("num", need.ToString()).FlushVars();
|
||||
// ui.ads.SetVar("num", myAd.ToString()).FlushVars();
|
||||
}
|
||||
|
||||
private int broadtime = 1;
|
||||
private List<string> config_name_list = LevelAttemptsModel.config_name_list;
|
||||
private List<string> config_money_list = LevelAttemptsModel.config_money_list;
|
||||
private List<string[]> broad_list = new List<string[]>();
|
||||
private void BroadCast()
|
||||
{
|
||||
if (broadtime % 3 == 0)
|
||||
{
|
||||
(ui.broad as com_broadcast_new).t1.Play(() =>
|
||||
{
|
||||
broad_list.RemoveAt(0);
|
||||
int name_index = UnityEngine.Random.Range(0, config_name_list.Count);
|
||||
int money_index = UnityEngine.Random.Range(0, config_money_list.Count);
|
||||
broad_list.Add(new string[2] { config_name_list[name_index], config_money_list[money_index] });
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
text_list[i].text = "Congratulations,User [color=#ad4800][size=36]" + broad_list[i][0] + "[/size][/color] !After purchasing the +1 Block Pack,play [color=#ad4800]" + broad_list[i][1] + "[/color] matcher to clear the level!";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
private List<GTextField> text_list = new List<GTextField>();
|
||||
private void InitBroadCast()
|
||||
{
|
||||
text_list.Add((ui.broad as com_broadcast_new).text_0);
|
||||
text_list.Add((ui.broad as com_broadcast_new).text_1);
|
||||
text_list.Add((ui.broad as com_broadcast_new).text_2);
|
||||
text_list.Add((ui.broad as com_broadcast_new).text_3);
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
|
||||
int name_index = UnityEngine.Random.Range(0, config_name_list.Count);
|
||||
int money_index = UnityEngine.Random.Range(0, config_money_list.Count);
|
||||
broad_list.Add(new string[2] { config_name_list[name_index], config_money_list[money_index] });
|
||||
text_list[i].text = "Congratulations,User [color=#ad4800][size=36]" + broad_list[i][0] + "[/size][/color] !After purchasing the +1 Block Pack,play [color=#ad4800]" + broad_list[i][1] + "[/color] matcher to clear the level!";
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95a4ab1450a704a8a86208f20b15f859
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AddViewoffUICtrl : BaseUICtrl
|
||||
{
|
||||
private AddViewoffUI ui;
|
||||
private AddViewoffModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.AddViewoffUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.AddViewoffUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.AddViewoffModel) as AddViewoffModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new AddViewoffUI(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: 0482db053a1ce45d989a2e4a715dff81
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 40fe4d3512e982147aaf39f9475a8e7a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AddviewnewCtrl : BaseCtrl
|
||||
{
|
||||
public static AddviewnewCtrl Instance { get; private set; }
|
||||
|
||||
private AddviewnewModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.AddviewnewModel) as AddviewnewModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4cc0dc1a5313d412a83b8e39a7efb8fc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AddviewnewModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 046c52d08595a4040a001d8004b8875c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,245 @@
|
||||
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using SGModule.Net;
|
||||
using System;
|
||||
using Spine.Unity;
|
||||
using SGModule.NetKit;
|
||||
using IgnoreOPS;
|
||||
using FGUI.ZM_Common_01;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AddviewnewUI : BaseUI
|
||||
{
|
||||
private AddviewnewUICtrl ctrl;
|
||||
private AddviewnewModel model;
|
||||
private FGUI.ZM_AddCell_12.com_addView_new ui;
|
||||
private bool is_off = false;
|
||||
|
||||
public AddviewnewUI(AddviewnewUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.AddviewnewUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_AddCell_12";
|
||||
uiInfo.assetName = "com_addView_new";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.AddviewnewModel) as AddviewnewModel;
|
||||
}
|
||||
private Action closeCallback;
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameHelper.showGameUI = true;
|
||||
HallManager.Instance.UpdateSecondEvent -= updateWatchCD;
|
||||
closeCallback?.Invoke();
|
||||
AdExchangeManager.Instance.Destroy();
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_AddCell_12.com_addView_new;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
// if (ui.btn_watch is btn_watchAd watchAdBtn)
|
||||
// {
|
||||
// CommonTools.GetInstance.InitAdBtnAnim(watchAdBtn.icon_Parent);
|
||||
// }
|
||||
// if (SaveData.GetSaveObject().addview_off_time > GameHelper.GetNowTime()) is_off = true;
|
||||
ui.text_out.text = "x" + GameHelper.GetItemNumber(0);
|
||||
ui.text_back.text = "x" + GameHelper.GetItemNumber(1);
|
||||
ui.text_refresh.text = "x" + GameHelper.GetItemNumber(2);
|
||||
ui.text_level.text = "Level " + GameHelper.GetLevel();
|
||||
TrackKit.SendEvent(GameHelper.getTrackEvenName(), ADEventTrack.Property.kaiju_show);
|
||||
ui.btn_play.SetClick(() =>
|
||||
{
|
||||
GameHelper.gameType = 0;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.OpenGame, false);
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
// ui.btn_watch.GetChild("img_saveingpot").x += 20;
|
||||
// ui.btn_watch.GetChild("img_saveingpot").y -= 33;
|
||||
// ad_cool_down = ConfigSystem.GetCommonConf().exchangeCD;
|
||||
// btn_WatchAd = ui.btn_watch as btn_watchAd;
|
||||
if (GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
if (is_off)
|
||||
{
|
||||
// AdExchangeManager.Instance.SetWatchAd(PurchasingManager.GetPaySku(PayType.buy_one_off), ui.btn_watch as btn_watchAd, () =>
|
||||
// {
|
||||
// TrackKit.SendEvent(GameHelper.getTrackEvenName(), ADEventTrack.Property.kaiju_click);
|
||||
// SetTextString();
|
||||
// });
|
||||
ui.pay_type.selectedIndex = 0;
|
||||
AdExchangeManager.Instance.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
AdExchangeManager.Instance.SetWatchAd(IAPPayManager.PRODUCT_SPACE_BONUS, ui.btn_watch as btn_watchAd, () =>
|
||||
{
|
||||
TrackKit.SendEvent(GameHelper.getTrackEvenName(), ADEventTrack.Property.kaiju_click);
|
||||
SetTextString();
|
||||
});
|
||||
ui.pay_type.selectedIndex = 0;
|
||||
AdExchangeManager.Instance.Start();
|
||||
}
|
||||
|
||||
SetTextString();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.pay_type.selectedIndex = 1;
|
||||
if (is_off)
|
||||
{
|
||||
decimal price = (decimal)GameHelper.GetCommonModel().AddDiscount2;
|
||||
ui.btn_max_pay.title = GameHelper.getPrice(price);
|
||||
ui.btn_max_pay.SetClick(() =>
|
||||
{
|
||||
TrackKit.SendEvent(GameHelper.getTrackEvenName(), ADEventTrack.Property.kaiju_click);
|
||||
// ApplePayClass maxPayData = new ApplePayClass
|
||||
// {
|
||||
// amount = (int)Math.Round(price * 100),
|
||||
// sku = PurchasingManager.GetPaySku(PayType.buy_one_off),
|
||||
// currency = "USD"
|
||||
// };
|
||||
// MaxPayManager.Instance.Buy(maxPayData);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
decimal price = (decimal)GameHelper.GetCommonModel().addspace2;
|
||||
ui.btn_max_pay.title = GameHelper.getPrice(price);
|
||||
ui.btn_max_pay.SetClick(() =>
|
||||
{
|
||||
TrackKit.SendEvent(GameHelper.getTrackEvenName(), ADEventTrack.Property.kaiju_click);
|
||||
ApplePayClass maxPayData = new ApplePayClass()
|
||||
{
|
||||
amount = (int)Math.Round(price * 100),
|
||||
sku = IAPPayManager.PRODUCT_SPACE_BONUS,
|
||||
currency = "USD"
|
||||
};
|
||||
MaxPayManager.Instance.Buy(maxPayData);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
InitView();
|
||||
}
|
||||
|
||||
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.IAP_PAY_SUCCESS, pay_success);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.Sheep_item_refresh, SetItemNumber);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.IAP_PAY_SUCCESS, pay_success);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.Sheep_item_refresh, SetItemNumber);
|
||||
}
|
||||
#endregion
|
||||
void SetItemNumber(object a)
|
||||
{
|
||||
ui.text_out.text = "x" + GameHelper.GetItemNumber(0);
|
||||
ui.text_back.text = "x" + GameHelper.GetItemNumber(1);
|
||||
ui.text_refresh.text = "x" + GameHelper.GetItemNumber(2);
|
||||
}
|
||||
void pay_success(object str)
|
||||
{
|
||||
string type = (string)str;
|
||||
|
||||
// if (type == IAPPayManager.PRODUCT_SPACE_BONUS || type == PurchasingManager.GetPaySku(PayType.buy_one_off))
|
||||
// {
|
||||
// TrackKit.SendEvent(GameHelper.getTrackEvenName(), ADEventTrack.Property.kaiju_success);
|
||||
// SaveData.GetSaveObject().have_slot = true;
|
||||
// SaveData.SaveDataFunc();
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Slot_refresh);
|
||||
// ui.pay_type.selectedIndex = 2;
|
||||
// // SkeletonAnimation addeffect = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_parent1, Fx_Type.fx_addeffect, ref closeCallback);
|
||||
// // addeffect.state.SetAnimation(0, "animation", true);
|
||||
// // SkeletonAnimation addeffect1 = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_parent2, Fx_Type.fx_addarrow, ref closeCallback);
|
||||
// // addeffect1.state.SetAnimation(0, "animation", true);
|
||||
// // CtrlCloseUI();
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
var tAnimation = FXManager.Instance.SetFx<SkeletonAnimation>(ui.btn_up.ani_node, Fx_Type.fx_powerup, ref closeCallback);
|
||||
tAnimation.state.SetAnimation(0, "animation", true);
|
||||
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.OpenGame);
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent += updateWatchCD;
|
||||
ui.btn_addback.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SheepwindowUI_Open, 1);
|
||||
});
|
||||
ui.btn_addout.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SheepwindowUI_Open, 0);
|
||||
});
|
||||
ui.btn_addrefresh.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SheepwindowUI_Open, 2);
|
||||
});
|
||||
// updateWatchCD();
|
||||
|
||||
// checkBtnState();
|
||||
|
||||
}
|
||||
void updateWatchCD()
|
||||
{
|
||||
|
||||
}
|
||||
public void SetTextString()
|
||||
{
|
||||
// int need = 0;
|
||||
// if (is_off) need = AdExchangeManager.Instance.GetCeilingNeedAds(PurchasingManager.GetPaySku(PayType.buy_one_off));
|
||||
// else need = AdExchangeManager.Instance.GetCeilingNeedAds(IAPPayManager.PRODUCT_SPACE_BONUS);
|
||||
// var myAd = AdExchangeManager.Instance.GetLookRewardADNum();
|
||||
//
|
||||
// // ui.tips.SetVar("num", need.ToString()).FlushVars();
|
||||
// ui.ads.SetVar("num", myAd + "/").FlushVars();
|
||||
// ui.ads.SetVar("num1", need.ToString()).FlushVars();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3b62f3687397048a0a4365a156cc3eac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AddviewnewUICtrl : BaseUICtrl
|
||||
{
|
||||
private AddviewnewUI ui;
|
||||
private AddviewnewModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.AddviewnewUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.AddviewnewUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.AddviewnewModel) as AddviewnewModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new AddviewnewUI(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: a375bc5ca46a34c92bc7dfa4c493c980
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0a3a471d4eab4205adfabe3e6e03dfa
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AlbumDetailCtrl : BaseCtrl
|
||||
{
|
||||
public static AlbumDetailCtrl Instance { get; private set; }
|
||||
|
||||
private AlbumDetailModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.AlbumDetailModel) as AlbumDetailModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 742a1554a1ce547a18f4d2fcde5d052a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AlbumDetailModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a5b5cfda3c4d14dc6ab5ea147569f119
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,462 @@
|
||||
|
||||
using FGUI.ZM_Common_01;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using System.Collections.Generic;
|
||||
using FGUI.LG_albums;
|
||||
using FGUI.LG_Common;
|
||||
using SGModule.DataStorage;
|
||||
using DG.Tweening;
|
||||
using SGModule.Common.Extensions;
|
||||
using System.Linq;
|
||||
using SGModule.NetKit;
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AlbumDetailUI : BaseUI
|
||||
{
|
||||
private AlbumDetailUICtrl ctrl;
|
||||
private AlbumDetailModel model;
|
||||
private FGUI.LG_albums.com_albumsDetail ui;
|
||||
|
||||
public AlbumDetailUI(AlbumDetailUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.AlbumDetailUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "LG_albums";
|
||||
uiInfo.assetName = "com_albumsDetail";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.AlbumDetailModel) as AlbumDetailModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
if (loader != null && !loader.isDisposed && loader.texture != null)
|
||||
{
|
||||
loader.texture.Dispose();
|
||||
loader.texture = null;
|
||||
}
|
||||
loader = null;
|
||||
|
||||
if (new_index != -1)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UnlockAlbums, index);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.LG_albums.com_albumsDetail;
|
||||
}
|
||||
private List<LevelUnlock> LevelData;
|
||||
private int new_index = -1;
|
||||
private int index;
|
||||
|
||||
private GLoader loader = new GLoader();
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
index = (int)args;
|
||||
Debug.Log(index);
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
});
|
||||
LevelData = ConfigSystem.GetLevelUnlockConfig();
|
||||
// ui.list_.SetVirtual();
|
||||
// ui.list_.itemRenderer = RendererList;
|
||||
// ui.list_.numItems = GameHelper.GetLevel() - 1;
|
||||
// ui.list_.ScrollToView(new_index);
|
||||
|
||||
RendererList();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
DOVirtual.DelayedCall(0.5f, () =>
|
||||
{
|
||||
// ui.list_.numItems = GameHelper.GetLevel() - 1;
|
||||
RendererList();
|
||||
});
|
||||
|
||||
}
|
||||
// void RendererList(int index, GObject obj)
|
||||
void RendererList()
|
||||
{
|
||||
|
||||
item_albumsDetails item = (item_albumsDetails)ui.com_item;
|
||||
|
||||
loader = item.com_loader.GetChild("loader") as GLoader;
|
||||
|
||||
// if (GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>()))
|
||||
// {
|
||||
// (item.btn_vip as btn_claim_2).have_vip.selectedIndex = 1;
|
||||
|
||||
// }
|
||||
// if (GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>()))
|
||||
// {
|
||||
// (item.btn_watch as btn_claim_1).have_vip.selectedIndex = 1;
|
||||
|
||||
// }
|
||||
|
||||
|
||||
var downloadCoinNum = ConfigSystem.GetCommonConf().CoinsDownload;
|
||||
var btn_down_coin = (FGUI.LG_Common.btn_unlock)item.btn_download_coin;
|
||||
btn_down_coin.title = downloadCoinNum.As<string>();
|
||||
btn_down_coin.down_load.selectedIndex = GameHelper.GetVipLevel() >= 1 ? 0 : 1;
|
||||
|
||||
|
||||
if (GameHelper.GetVipLevel() > 0)
|
||||
{
|
||||
(item.btn_download as FGUI.LG_Common.btn_claim).have_vip.selectedIndex = 1;
|
||||
item.is_vip.selectedIndex = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.is_vip.selectedIndex = 0;
|
||||
}
|
||||
if (index < GameHelper.GetCommonModel().MultiModal - 1)
|
||||
{
|
||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||
item.btn_download.SetClick(() =>
|
||||
{
|
||||
|
||||
if (GameHelper.GetVipLevel() > 0)
|
||||
{
|
||||
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowVideoAd("DownloadImage", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
btn_down_coin.SetClick(() =>
|
||||
{
|
||||
if (GameHelper.Get101() >= downloadCoinNum)
|
||||
{
|
||||
DataMgr.Coin.Value -= downloadCoinNum;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
||||
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
||||
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("no_enough_gold", true);
|
||||
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Levelunlock levelunlock_ = DataMgr.LevelUnlockListNew.Value.FirstOrDefault(x => x.level_ == index + 1);
|
||||
string file_name = "";
|
||||
if (levelunlock_ != null)
|
||||
{
|
||||
if (levelunlock_.type == 0)
|
||||
{
|
||||
if (levelunlock_.config_index >= ConfigSystem.GetFreeImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetFreeImageConfig().Count - 1;
|
||||
FreeImageLibrary _leveldata = ConfigSystem.GetFreeImageConfig()[levelunlock_.config_index];
|
||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||
file_name = _leveldata.Name;
|
||||
}
|
||||
else if (levelunlock_.type == 1)
|
||||
{
|
||||
if (levelunlock_.config_index >= ConfigSystem.GetADImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetADImageConfig().Count - 1;
|
||||
ADImageLibrary _leveldata = ConfigSystem.GetADImageConfig()[levelunlock_.config_index];
|
||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||
file_name = _leveldata.Name;
|
||||
}
|
||||
else if (levelunlock_.type == 2)
|
||||
{
|
||||
if (levelunlock_.config_index >= ConfigSystem.GetSpecialImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetSpecialImageConfig().Count - 1;
|
||||
SpecialImageLibrary _leveldata = ConfigSystem.GetSpecialImageConfig()[levelunlock_.config_index];
|
||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||
file_name = _leveldata.Name;
|
||||
}
|
||||
else if (levelunlock_.type == 3)
|
||||
{
|
||||
if (levelunlock_.config_index >= ConfigSystem.GetVIPImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetVIPImageConfig().Count - 1;
|
||||
VIPImageLibrary _leveldata = ConfigSystem.GetVIPImageConfig()[levelunlock_.config_index];
|
||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||
file_name = _leveldata.Name;
|
||||
}
|
||||
item.btn_download.SetClick(() =>
|
||||
{
|
||||
|
||||
if (GameHelper.GetVipLevel() > 0)
|
||||
{
|
||||
TextureHelper.SaveImageToAlbum(file_name, FolderNames.AlbumName, CtrlCloseUI);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowVideoAd("DownloadImage", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
TextureHelper.SaveImageToAlbum(file_name, FolderNames.AlbumName, CtrlCloseUI);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
btn_down_coin.SetClick(() =>
|
||||
{
|
||||
if (GameHelper.Get101() >= downloadCoinNum)
|
||||
{
|
||||
DataMgr.Coin.Value -= downloadCoinNum;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
||||
TextureHelper.SaveImageToAlbum(file_name, FolderNames.AlbumName, CtrlCloseUI);
|
||||
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("no_enough_gold", true);
|
||||
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||
item.btn_download.SetClick(() =>
|
||||
{
|
||||
|
||||
if (GameHelper.GetVipLevel() > 0)
|
||||
{
|
||||
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowVideoAd("DownloadImage", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
btn_down_coin.SetClick(() =>
|
||||
{
|
||||
if (GameHelper.Get101() >= downloadCoinNum)
|
||||
{
|
||||
DataMgr.Coin.Value -= downloadCoinNum;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
||||
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
||||
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("no_enough_gold", true);
|
||||
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// if (LevelData[index].LeveType == 0)
|
||||
// {
|
||||
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/");
|
||||
// item.type.selectedIndex = 0;
|
||||
// }
|
||||
// else if (LevelData[index].LeveType == 1) //特殊关
|
||||
// {
|
||||
// if (DataMgr.LevelUnlockList.Value.Contains(index))
|
||||
// {
|
||||
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/");
|
||||
// item.type.selectedIndex = 0;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item.type.selectedIndex = 1;
|
||||
// item.btn_pay.title = LevelData[index].PassCoins.ToString();
|
||||
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, (s) =>
|
||||
// {
|
||||
// TextureHelper.SetImageBlur(item.com_loader.GetChild("loader") as GLoader);
|
||||
// }, "LevelAlbums/");
|
||||
// item.btn_pay.SetClick(() =>
|
||||
// {
|
||||
// if (DataMgr.Coin.Value >= LevelData[index].PassCoins)
|
||||
// {
|
||||
// new_index = index;
|
||||
// DataMgr.Coin.Value -= LevelData[index].PassCoins;
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
// DataMgr.LevelUnlockList.Value.Add(index);
|
||||
// GameHelper.ShowTips("Unlocked!");
|
||||
// DataMgr.LevelUnlockList.Save();
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||
// CtrlCloseUI();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// GameHelper.ShowTips("Not enough golds");
|
||||
// }
|
||||
// });
|
||||
// item.btn_watch.SetClick(() =>
|
||||
// {
|
||||
// if (GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>()))
|
||||
// {
|
||||
// new_index = index;
|
||||
// DataMgr.LevelUnlockList.Value.Add(index);
|
||||
// GameHelper.ShowTips("Unlocked!");
|
||||
// DataMgr.LevelUnlockList.Save();
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||
// CtrlCloseUI();
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// GameHelper.ShowVideoAd("UnlockSpecialLevel", isSuccess =>
|
||||
// {
|
||||
// if (isSuccess)
|
||||
// {
|
||||
// new_index = index;
|
||||
// DataMgr.LevelUnlockList.Value.Add(index);
|
||||
// GameHelper.ShowTips("Unlocked!");
|
||||
// DataMgr.LevelUnlockList.Save();
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||
// CtrlCloseUI();
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
// }
|
||||
// else if (LevelData[index].LeveType == 2)//vip关
|
||||
// {
|
||||
// if (DataMgr.LevelUnlockList.Value.Contains(index))
|
||||
// {
|
||||
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/");
|
||||
// item.type.selectedIndex = 0;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item.type.selectedIndex = 2;
|
||||
// item.btn_pay.title = LevelData[index].PassCoins.ToString();
|
||||
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, (s) =>
|
||||
// {
|
||||
// TextureHelper.SetImageBlur(item.com_loader.GetChild("loader") as GLoader);
|
||||
// }, "LevelAlbums/");
|
||||
// item.btn_pay.SetClick(() =>
|
||||
// {
|
||||
// if (DataMgr.Coin.Value >= LevelData[index].PassCoins)
|
||||
// {
|
||||
// new_index = index;
|
||||
// DataMgr.Coin.Value -= LevelData[index].PassCoins;
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
// DataMgr.LevelUnlockList.Value.Add(index);
|
||||
// GameHelper.ShowTips("Unlocked!");
|
||||
// DataMgr.LevelUnlockList.Save();
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||
// CtrlCloseUI();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// GameHelper.ShowTips("Not enough golds");
|
||||
// }
|
||||
// });
|
||||
// item.btn_vip.SetClick(() =>
|
||||
// {
|
||||
// if (GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>()))
|
||||
// {
|
||||
// new_index = index;
|
||||
// DataMgr.LevelUnlockList.Value.Add(index);
|
||||
// GameHelper.ShowTips("Unlocked!");
|
||||
// DataMgr.LevelUnlockList.Save();
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||
// CtrlCloseUI();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// uiCtrlDispatcher.Dispatch(UICtrlMsg.VipClubViewUI_Open, 2);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// }
|
||||
|
||||
// if (item.type.selectedIndex == 0)
|
||||
// {
|
||||
// if (GameHelper.GetVipPrivilege(Subscription.FreeDownImage.As<int>()))
|
||||
// {
|
||||
// (item.btn_download as FGUI.LG_Common.btn_claim).have_vip.selectedIndex = 1;
|
||||
// item.is_vip.selectedIndex = 1;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// item.is_vip.selectedIndex = 0;
|
||||
// }
|
||||
// }
|
||||
// else if (item.type.selectedIndex == 1)
|
||||
// {
|
||||
// if (GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>()))
|
||||
// {
|
||||
// item.is_vip.selectedIndex = 1;
|
||||
// }
|
||||
// else item.is_vip.selectedIndex = 0;
|
||||
|
||||
// }
|
||||
// else if (item.type.selectedIndex == 2)
|
||||
// {
|
||||
// if (GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>()))
|
||||
// {
|
||||
// item.is_vip.selectedIndex = 1;
|
||||
// }
|
||||
// else item.is_vip.selectedIndex = 0;
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47ef18a651dc245c587515925adba37d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AlbumDetailUICtrl : BaseUICtrl
|
||||
{
|
||||
private AlbumDetailUI ui;
|
||||
private AlbumDetailModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.AlbumDetailUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.AlbumDetailUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.AlbumDetailModel) as AlbumDetailModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new AlbumDetailUI(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: a0ae060ce359f4428b4c82fd96f6f2c0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 835af6bef1d644831a65b4e33ba7fa24
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AlubumCtrl : BaseCtrl
|
||||
{
|
||||
public static AlubumCtrl Instance { get; private set; }
|
||||
|
||||
private AlubumModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.AlubumModel) as AlubumModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: afb7ba0a285a24cf6a2b59cbad176778
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AlubumModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a84f029a2173e4a74b9b57cdd492a693
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,431 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using FairyGUI;
|
||||
using FGUI.LG_albums;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AlubumUI : BaseUI
|
||||
{
|
||||
private AlubumUICtrl ctrl;
|
||||
private AlubumModel model;
|
||||
private com_albums ui;
|
||||
private long[] UpDatatime;
|
||||
|
||||
public AlubumUI(AlubumUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.AlubumUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "LG_albums";
|
||||
uiInfo.assetName = "com_albums";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
//初始化页面逻辑
|
||||
private void InitView(object a = null)
|
||||
{
|
||||
UpDatatime = new long[LevelData.Count];
|
||||
ImageName = new string[LevelData.Count];
|
||||
ui.list_albums.itemRenderer = RendererList;
|
||||
ui.list_albums.numItems = LevelData.Count;
|
||||
|
||||
InitScroll();
|
||||
}
|
||||
|
||||
private void SetItemData(object obj = null)
|
||||
{
|
||||
UpDatatime[(int)obj] = 0;
|
||||
ui.list_albums.RefreshVirtualList();
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
GLoaderPool.Instance.Init(null, 24, 312, 310);
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
foreach (var t in loader_list)
|
||||
if (t != null && !t.isDisposed && t.texture != null)
|
||||
{
|
||||
t.texture.Dispose();
|
||||
t.texture = null;
|
||||
}
|
||||
|
||||
// 1. 解除 UI 对 Loader 的引用
|
||||
for (var i = 0; i < ui.list_albums.numChildren; i++)
|
||||
{
|
||||
var item = ui.list_albums.GetChildAt(i) as item_albums;
|
||||
if (item != null && item.com_loader.loader != null) item.com_loader.loader = null; // 清掉 GLoader 引用
|
||||
}
|
||||
|
||||
activeLoaders.Clear();
|
||||
_fileIsExist.Clear();
|
||||
|
||||
GLoaderPool.Instance.DisposeAll();
|
||||
|
||||
TextureHelper.ClearMaterialPool();
|
||||
|
||||
// 强制卸载未使用的资源
|
||||
// Resources.UnloadUnusedAssets();
|
||||
// MemoryManager.CleanMemoryMonitor();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as com_albums;
|
||||
}
|
||||
|
||||
private List<LevelUnlock> LevelData;
|
||||
|
||||
private readonly List<GLoader> loader_list = new();
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
_throttle = new Throttle(1f);
|
||||
|
||||
LevelData = ConfigSystem.GetLevelUnlockConfig();
|
||||
ui.list_albums.SetVirtual();
|
||||
ui.btn_close1.SetClick(() => { CtrlCloseUI(); });
|
||||
InitView();
|
||||
}
|
||||
|
||||
|
||||
private const int MaxVisibleCount = 18; // 一屏显示18个
|
||||
private const int PreloadCount = 3; // 上下各预加载一屏
|
||||
private readonly Dictionary<int, GLoader> activeLoaders = new();
|
||||
private readonly Dictionary<int, bool> _fileIsExist = new();
|
||||
|
||||
private Throttle _throttle;
|
||||
|
||||
private void InitScroll()
|
||||
{
|
||||
// ui.list_albums.scrollPane.onScroll.Add(OnScrollUpdate);
|
||||
ui.list_albums.scrollPane.onScrollEnd.Add(OnScrollEndCB); // 保留结束时的整理
|
||||
|
||||
OnScrollEnd();
|
||||
}
|
||||
|
||||
private void OnScrollUpdate()
|
||||
{
|
||||
_throttle.Execute(UpdateVisibleAndPreload);
|
||||
}
|
||||
|
||||
private void OnScrollEndCB()
|
||||
{
|
||||
// UpdateVisibleAndPreload();
|
||||
|
||||
OnScrollEnd();
|
||||
|
||||
// Debug.Log("更新一次");
|
||||
}
|
||||
|
||||
private void UpdateVisibleAndPreload()
|
||||
{
|
||||
// Debug.Log("[UpdateVisibleAndPreload]--------111111--------- ");
|
||||
// if (LevelData == null || LevelData.Count == 0) return;
|
||||
|
||||
// var firstVisibleIndex = ui.list_albums.GetFirstChildInView();
|
||||
// var lastVisibleIndex = Mathf.Min(firstVisibleIndex + MaxVisibleCount - 1, ui.list_albums.numItems - 1);
|
||||
|
||||
// var startIndex = Mathf.Max(0, firstVisibleIndex - PreloadCount);
|
||||
// var endIndex = Mathf.Min(ui.list_albums.numItems - 1, lastVisibleIndex + PreloadCount);
|
||||
|
||||
// // 回收超出范围 loader
|
||||
// var keysToRemove = new List<int>();
|
||||
// foreach (var kv in activeLoaders)
|
||||
// {
|
||||
// var idx = kv.Key;
|
||||
// if (idx < startIndex || idx > endIndex)
|
||||
// {
|
||||
// GLoaderPool.Instance.ReturnLoader(kv.Value);
|
||||
// var oldItem = ui.list_albums.GetChildAt(idx) as item_albums;
|
||||
// if (oldItem != null) oldItem.com_loader.loader = null;
|
||||
// keysToRemove.Add(idx);
|
||||
// }
|
||||
// }
|
||||
|
||||
// foreach (var k in keysToRemove) activeLoaders.Remove(k);
|
||||
|
||||
|
||||
// // 分配 loader 并加载图片
|
||||
// for (var i = startIndex; i <= endIndex; i++)
|
||||
// {
|
||||
// if (activeLoaders.ContainsKey(i)) continue;
|
||||
|
||||
// var item = ui.list_albums.GetChildAt(i) as item_albums;
|
||||
// if (item == null) continue;
|
||||
|
||||
// if (item.com_loader.loader != null && !item.com_loader.loader.isDisposed)
|
||||
// GLoaderPool.Instance.ReturnLoader(item.com_loader.loader);
|
||||
|
||||
// var loader = GLoaderPool.Instance.GetLoader();
|
||||
// item.com_loader.loader = loader;
|
||||
// item.com_loader.AddChild(loader);
|
||||
// loader.SetSize(item.com_loader.loader.width, item.com_loader.loader.height);
|
||||
|
||||
// _fileIsExist.TryGetValue(i, out var value);
|
||||
// if (!value)
|
||||
// {
|
||||
// var localPath = Path.Combine(TextureHelper.getResPath(), LevelData[i].Name + ".jpg");
|
||||
|
||||
// if (File.Exists(localPath))
|
||||
// {
|
||||
// _fileIsExist[i] = true;
|
||||
// Debug.Log($"[SetImgLoader] 本地存在,直接加载 {LevelData[i].Name}");
|
||||
// CrazyAsyKit.StartCoroutine(TextureHelper.LoadTexture(LevelData[i].Name, loader, null,
|
||||
// "LevelAlbums/"));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// _fileIsExist[i] = false;
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// CrazyAsyKit.StartCoroutine(TextureHelper.LoadTexture(LevelData[i].Name, loader, null,
|
||||
// "LevelAlbums/"));
|
||||
// }
|
||||
|
||||
// activeLoaders[i] = loader;
|
||||
// }
|
||||
// Debug.Log($"[ScrollUpdate] active loaders={activeLoaders.Count}, pool={GLoaderPool.Instance.GetPoolCount()}, inUse={GLoaderPool.Instance.GetInUseCount()}");
|
||||
}
|
||||
|
||||
private void OnScrollEnd()
|
||||
{
|
||||
for (int i = 0; i < UpDatatime.Length; i++)
|
||||
{
|
||||
UpDatatime[i] = 0;
|
||||
// ImageName[i] = "";
|
||||
}
|
||||
|
||||
// DOVirtual.DelayedCall(0.1f, () =>
|
||||
// {
|
||||
ui.list_albums.RefreshVirtualList();
|
||||
// });
|
||||
|
||||
// if (LevelData == null || LevelData.Count == 0) return;
|
||||
|
||||
// var firstVisibleIndex = ui.list_albums.GetFirstChildInView();
|
||||
// var lastVisibleIndex = Mathf.Min(firstVisibleIndex + MaxVisibleCount - 1, ui.list_albums.numItems - 1);
|
||||
|
||||
// var startIndex = Mathf.Max(0, firstVisibleIndex - PreloadCount);
|
||||
// var endIndex = Mathf.Min(ui.list_albums.numItems - 1, lastVisibleIndex + PreloadCount);
|
||||
|
||||
// // Debug.Log($"[ScrollEnd] start index={startIndex} end index={endIndex}");
|
||||
|
||||
|
||||
// var tasks = new List<(GLoader loader, string fileName, Action<NTexture> callback, string folder)>();
|
||||
// // 分配 loader 并加载图片
|
||||
// for (var i = startIndex; i <= endIndex; i++)
|
||||
// {
|
||||
// _fileIsExist.TryGetValue(i, out var value);
|
||||
|
||||
// if (value) continue;
|
||||
|
||||
// if (GameHelper.GetLevel() < i + 1) continue;
|
||||
|
||||
// var item = ui.list_albums.GetChildAt(i) as item_albums;
|
||||
// if (item == null) continue;
|
||||
// if (item.com_loader.loader != null && !item.com_loader.loader.isDisposed)
|
||||
// GLoaderPool.Instance.ReturnLoader(item.com_loader.loader);
|
||||
// var loader = GLoaderPool.Instance.GetLoader();
|
||||
// item.com_loader.loader = loader;
|
||||
// item.com_loader.AddChild(loader);
|
||||
// loader.SetSize(item.com_loader.loader.width, item.com_loader.loader.height);
|
||||
|
||||
// var idx = i;
|
||||
// tasks.Add((loader, LevelData[i].Name, NTexture =>
|
||||
// {
|
||||
// if (NTexture != null) _fileIsExist[idx] = true;
|
||||
// }, "LevelAlbums/"));
|
||||
|
||||
// activeLoaders[i] = loader;
|
||||
// }
|
||||
|
||||
// if (tasks.Count > 0) TextureHelper.SetImgLoaders(tasks);
|
||||
}
|
||||
|
||||
private string[] ImageName;
|
||||
|
||||
private void RendererList(int index, GObject obj)
|
||||
{
|
||||
// Debug.Log("Render list" );
|
||||
|
||||
// Debug.Log(JsonConvert.SerializeObject(LevelData[index]));
|
||||
|
||||
item_albums item = (item_albums)obj;
|
||||
item.text_num.text = (index + 1).ToString();
|
||||
if (index < GameHelper.GetCommonModel().MultiModal - 1)
|
||||
{
|
||||
item.type_.selectedIndex = 0;
|
||||
if (GameHelper.GetLevel() > index + 1)
|
||||
{
|
||||
item.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.AlbumDetailUI_Open, index); });
|
||||
}
|
||||
else
|
||||
{
|
||||
item.SetClick(() => { GameHelper.ShowTips("lv_unlock", true); });
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Levelunlock levelunlock_ = DataMgr.LevelUnlockListNew.Value.FirstOrDefault(x => x.level_ == index + 1);
|
||||
if (levelunlock_ != null)
|
||||
{
|
||||
item.type_.selectedIndex = levelunlock_.type;
|
||||
}
|
||||
else item.type_.selectedIndex = 0;
|
||||
if (GameHelper.GetLevel() > index + 1)
|
||||
{
|
||||
item.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.AlbumDetailUI_Open, index); });
|
||||
}
|
||||
else
|
||||
{
|
||||
item.SetClick(() => { GameHelper.ShowTips("lv_unlock", true); });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (GameHelper.GetNowTime() < UpDatatime[index] + 1) return;
|
||||
UpDatatime[index] = GameHelper.GetNowTime();
|
||||
// if (!activeLoaders.ContainsValue(item.com_loader.loader)) activeLoaders[index] = item.com_loader.loader;
|
||||
if (!loader_list.Contains(item.com_loader.GetChild("loader") as GLoader))
|
||||
loader_list.Add(item.com_loader.GetChild("loader") as GLoader);
|
||||
|
||||
|
||||
if (index < GameHelper.GetCommonModel().MultiModal - 1)
|
||||
{
|
||||
if (GameHelper.GetLevel() > index + 1)
|
||||
{
|
||||
item.isUnlock.selectedIndex = 1;
|
||||
if (item.com_loader.loader.texture == null ||
|
||||
item.com_loader.loader.texture.nativeTexture.name != LevelData[index].Name)
|
||||
{
|
||||
// item.isUnlock.selectedIndex = 0;
|
||||
// if (item.com_loader.loader.texture != null)
|
||||
// {
|
||||
// item.com_loader.loader.texture.Dispose(); // 释放 GPU 资源
|
||||
// item.com_loader.loader.texture = null; // 断开引用
|
||||
// }
|
||||
|
||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name,
|
||||
(a) => { Debug.Log(item.com_loader.loader.texture.nativeTexture.name); }, "LevelAlbums/", FolderNames.AlbumName);
|
||||
|
||||
ImageName[index] = LevelData[index].Name;
|
||||
}
|
||||
|
||||
item.touchable = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.isUnlock.selectedIndex = 0;
|
||||
// item.touchable = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Levelunlock levelunlock_ = DataMgr.LevelUnlockListNew.Value.FirstOrDefault(x => x.level_ == index + 1);
|
||||
|
||||
if (GameHelper.GetLevel() > index + 1)
|
||||
{
|
||||
if (levelunlock_ != null)
|
||||
{
|
||||
item.isUnlock.selectedIndex = 1;
|
||||
|
||||
if (item.com_loader.loader.texture == null || item.com_loader.loader.texture.nativeTexture.name != ImageName[index])
|
||||
{
|
||||
|
||||
if (levelunlock_.type == 0)
|
||||
{
|
||||
if (levelunlock_.config_index >= ConfigSystem.GetFreeImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetFreeImageConfig().Count - 1;
|
||||
FreeImageLibrary _leveldata = ConfigSystem.GetFreeImageConfig()[levelunlock_.config_index];
|
||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||
ImageName[index] = LevelData[index].Name;
|
||||
}
|
||||
else if (levelunlock_.type == 1)
|
||||
{
|
||||
if (levelunlock_.config_index >= ConfigSystem.GetADImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetADImageConfig().Count - 1;
|
||||
ADImageLibrary _leveldata = ConfigSystem.GetADImageConfig()[levelunlock_.config_index];
|
||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||
ImageName[index] = LevelData[index].Name;
|
||||
}
|
||||
else if (levelunlock_.type == 2)
|
||||
{
|
||||
if (levelunlock_.config_index >= ConfigSystem.GetSpecialImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetSpecialImageConfig().Count - 1;
|
||||
SpecialImageLibrary _leveldata = ConfigSystem.GetSpecialImageConfig()[levelunlock_.config_index];
|
||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||
ImageName[index] = LevelData[index].Name;
|
||||
}
|
||||
else if (levelunlock_.type == 3)
|
||||
{
|
||||
if (levelunlock_.config_index >= ConfigSystem.GetVIPImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetVIPImageConfig().Count - 1;
|
||||
VIPImageLibrary _leveldata = ConfigSystem.GetVIPImageConfig()[levelunlock_.config_index];
|
||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||
ImageName[index] = LevelData[index].Name;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
item.isUnlock.selectedIndex = 1;
|
||||
if (item.com_loader.loader.texture == null || item.com_loader.loader.texture.nativeTexture.name != LevelData[index].Name)
|
||||
{
|
||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||
ImageName[index] = LevelData[index].Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// item.touchable = false;
|
||||
item.isUnlock.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.UnlockAlbums, SetItemData);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.UnlockAlbums, SetItemData);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8211638a3a24a4f0f9e093343198e8ef
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class AlubumUICtrl : BaseUICtrl
|
||||
{
|
||||
private AlubumUI ui;
|
||||
private AlubumModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.AlubumUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.AlubumUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.AlubumModel) as AlubumModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new AlubumUI(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: a1c15e9bbddc64e5ca24ec7c564207a5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b3a59974b3d5f6d49b4e54ed7605922c
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class BuyPropCtrl : BaseCtrl
|
||||
{
|
||||
public static BuyPropCtrl Instance { get; private set; }
|
||||
|
||||
private BuyPropModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.BuyPropModel) as BuyPropModel;
|
||||
}
|
||||
|
||||
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: 58e27508a01b144eab047fc0579e3520
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class BuyPropModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
// protected override void OnReset()
|
||||
// {
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// #region 读取数据
|
||||
// protected override void OnReadData()
|
||||
// {
|
||||
// }
|
||||
// #endregion
|
||||
|
||||
// #region 本地存储
|
||||
// protected override void WriteLocalStorage()
|
||||
// {
|
||||
|
||||
// }
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6f1d88ea5dfa34e1a927e5bef7f9c714
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,153 @@
|
||||
using IgnoreOPS;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class BuyPropUI : BaseUI
|
||||
{
|
||||
private BuyPropUICtrl ctrl;
|
||||
private BuyPropModel model;
|
||||
private FGUI.ZM_Prop_09.com_prop ui;
|
||||
private int state_ = 0;
|
||||
|
||||
public BuyPropUI(BuyPropUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.BuyPropUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Prop_09";
|
||||
uiInfo.assetName = "com_prop";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.BuyPropModel) as BuyPropModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameHelper.showGameUI = true;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Prop_09.com_prop;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
state_ = (int)args;
|
||||
ui.prop.selectedIndex = state_;
|
||||
ui.btn_buy.GetChild("text_gold").text = GameHelper.Get101Str(ConfigSystem.GetCommonConf().Purchaseprops);
|
||||
ui.btn_buy.SetClick(buyItem);
|
||||
setBtnState(state_);
|
||||
InitView();
|
||||
|
||||
}
|
||||
void buyItem()
|
||||
{
|
||||
if (state_ == 0)
|
||||
{
|
||||
|
||||
}
|
||||
else if (state_ == 1)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
else if (state_ == 2)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
if (GameHelper.CheckGoldNumber(ConfigSystem.GetCommonConf().Purchaseprops))
|
||||
{
|
||||
GameHelper.AddGoldNumber(-ConfigSystem.GetCommonConf().Purchaseprops);
|
||||
int numbers = GameHelper.GetItemNumber(state_);
|
||||
numbers++;
|
||||
GameHelper.SetItemNumber(state_, numbers);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Sheep_item_refresh);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
GameHelper.ShowTips("purchase_succ", true);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("no_enough_gold", true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
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_back.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SheepwindowUI_Close);
|
||||
});
|
||||
|
||||
// ui.btn_buy0.SetClick(() =>
|
||||
// {
|
||||
// state_ = 0;
|
||||
// ui.prop.selectedIndex = 0;
|
||||
// setBtnState(0);
|
||||
// });
|
||||
// ui.btn_buy1.SetClick(() =>
|
||||
// {
|
||||
// state_ = 1;
|
||||
|
||||
// ui.prop.selectedIndex = 1;
|
||||
// setBtnState(1);
|
||||
|
||||
// });
|
||||
// ui.btn_buy2.SetClick(() =>
|
||||
// {
|
||||
// state_ = 2;
|
||||
|
||||
// ui.prop.selectedIndex = 2;
|
||||
// setBtnState(2);
|
||||
|
||||
// });
|
||||
}
|
||||
|
||||
private void setBtnState(int index)
|
||||
{
|
||||
// ui.btn_buy0.tab_choose.selectedIndex = index == 0 ? 1 : 0;
|
||||
// ui.btn_buy1.tab_choose.selectedIndex = index == 1 ? 1 : 0;
|
||||
// ui.btn_buy2.tab_choose.selectedIndex = index == 2 ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d07e071d35d5041feaf834faa7cac3a0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class BuyPropUICtrl : BaseUICtrl
|
||||
{
|
||||
private BuyPropUI ui;
|
||||
private BuyPropModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.SheepwindowUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.SheepwindowUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.BuyPropModel) as BuyPropModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new BuyPropUI(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: b85f17625775040eb85b386d6c9c5c79
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7ae1c12b0a549456eb262fd44fbb31df
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class ChatCtrl : BaseCtrl
|
||||
{
|
||||
public static ChatCtrl Instance { get; private set; }
|
||||
|
||||
private ChatModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.ChatModel) as ChatModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4f85819b166c34048b8b0e9ca525fe8e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class ChatModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f469f84c20ba64b5994e844b29a7f2fe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,335 @@
|
||||
|
||||
using FGUI.ZM_Common_01;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using IgnoreOPS;
|
||||
using Newtonsoft.Json;
|
||||
using System.Linq;
|
||||
using FGUI.LG_AIchat;
|
||||
using DG.Tweening;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class ChatUI : BaseUI
|
||||
{
|
||||
private ChatUICtrl ctrl;
|
||||
private ChatModel model;
|
||||
private FGUI.LG_AIchat.com_chat ui;
|
||||
|
||||
public ChatUI(ChatUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.ChatUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "LG_AIchat";
|
||||
uiInfo.assetName = "com_chat";
|
||||
uiInfo.layerType = UILayerType.Normal;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.ChatModel) as ChatModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
ChatHelper.chat_red_list[chat_index] = false;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.RefreshRedDot);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.LG_AIchat.com_chat;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
// ChatHelper.GetMessage(1);
|
||||
// ChatHelper.ResetMessage(1);
|
||||
if (args != null) chat_index = (int)args;
|
||||
if (DataMgr.ChatData.Value == null)
|
||||
{
|
||||
DataMgr.ChatData.Value = new List<ChatItem>();
|
||||
}
|
||||
|
||||
if (Screen.safeArea.y != 0)
|
||||
{
|
||||
ui.group_.y += Screen.safeArea.y - 15;
|
||||
}
|
||||
Debug.Log(JsonConvert.SerializeObject(DataMgr.ChatData.Value));
|
||||
ui.btn_close.SetClick(CtrlCloseUI);
|
||||
ui.type.selectedIndex = chat_index;
|
||||
InitView();
|
||||
ui.btn_photo.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowTips("launching_soon", true);
|
||||
});
|
||||
ui.btn_video.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowTips("launching_soon", true);
|
||||
});
|
||||
}
|
||||
public static bool IsSameDay(long timestamp)
|
||||
{
|
||||
// 假设时间戳是 Unix 时间戳(秒),如果是毫秒记得除以 1000
|
||||
DateTime inputTime = DateTimeOffset.FromUnixTimeSeconds(timestamp).DateTime;
|
||||
DateTime now = DateTimeOffset.FromUnixTimeSeconds(GameHelper.GetNowTime()).DateTime;
|
||||
|
||||
// 比较年月日是否一致
|
||||
return inputTime.Date == now.Date;
|
||||
}
|
||||
|
||||
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.LiveChange, addNewItem);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.AddChatNum, setChatNum);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.Gold_refresh, SetTopCurr);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.LiveChange, addNewItem);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.AddChatNum, setChatNum);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.Gold_refresh, SetTopCurr);
|
||||
}
|
||||
public void SetTopCurr(object a = null)
|
||||
{
|
||||
Debug.Log("??????????");
|
||||
var btn_gold = ui.btn_gold as com_gold;
|
||||
btn_gold.text_gold.text = $"{DataMgr.Coin.Value:N0}";
|
||||
|
||||
|
||||
|
||||
}
|
||||
private void addNewItem(object a = null)
|
||||
{
|
||||
_ChatItem = DataMgr.ChatData.Value.FirstOrDefault(c => c.role == ChatType.GetType(chat_index));
|
||||
if (_ChatItem.content_list.Count > list_count)
|
||||
{
|
||||
if (have_inputani && ChatHelper.unshow_message[chat_index] <= 0)
|
||||
{
|
||||
ui.list_.RemoveChildAt(list_count);
|
||||
have_inputani = false;
|
||||
}
|
||||
// else if (have_inputani && ChatHelper.unshow_message[chat_index] > 0)
|
||||
// {
|
||||
|
||||
// }
|
||||
for (int i = list_count; i < _ChatItem.content_list.Count; i++)
|
||||
{
|
||||
if (_ChatItem.content_list[i].type == 1)
|
||||
{
|
||||
item_chatText_left com_msg = (item_chatText_left)UIPackage.CreateObject("LG_AIchat", "item_chatText_left");
|
||||
com_msg.text_content.text = _ChatItem.content_list[i].text_content;
|
||||
if (chat_index == 0) com_msg.head.url = "ui://tksc66j2ljeg27";
|
||||
else if (chat_index == 1) com_msg.head.url = "ui://tksc66j2ljeg25";
|
||||
else if (chat_index == 2) com_msg.head.url = "ui://tksc66j2ljeg20";
|
||||
if (ChatHelper.unshow_message[chat_index] <= 0 || (!have_inputani)) ui.list_.AddChild(com_msg);
|
||||
else ui.list_.AddChildAt(com_msg, ui.list_.numChildren - 1);
|
||||
}
|
||||
}
|
||||
|
||||
// if (ChatHelper.unshow_message[chat_index] > 0)
|
||||
// {
|
||||
// item_chatText_left com_msg_ = (item_chatText_left)UIPackage.CreateObject("LG_AIchat", "item_chatText_left");
|
||||
// com_msg_.t0.Play(-1, 0, null);
|
||||
// if (chat_index == 0) com_msg_.head.url = "ui://tksc66j2ljeg27";
|
||||
// else if (chat_index == 1) com_msg_.head.url = "ui://tksc66j2ljeg25";
|
||||
// else if (chat_index == 2) com_msg_.head.url = "ui://tksc66j2ljeg20";
|
||||
// ui.list_.AddChild(com_msg_);
|
||||
// have_inputani = true;
|
||||
// }
|
||||
|
||||
list_count = _ChatItem.content_list.Count;
|
||||
ui.list_.ScrollToView(list_count - 1);
|
||||
}
|
||||
}
|
||||
private void setChatNum(object a = null)
|
||||
{
|
||||
|
||||
if (DataMgr.ChatFreeNumber.Value != 0)
|
||||
{
|
||||
ui.have_free.selectedIndex = 1;
|
||||
ui.text_remainfreeNum.text = "Free:" + DataMgr.ChatFreeNumber.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.have_free.selectedIndex = 0;
|
||||
ui.text_remainNum.text = ":" + DataMgr.ChatNumber.Value;
|
||||
}
|
||||
if (DataMgr.ChatFreeNumber.Value <= 0 && DataMgr.ChatNumber.Value <= 0) ui.btn_send.title = "Get More";
|
||||
else ui.btn_send.title = "Send";
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
private ChatItem _ChatItem;
|
||||
private int chat_index = 2;
|
||||
private int list_count = 0;
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
Debug.Log(DataMgr.ChatData.Value);
|
||||
SetTopCurr();
|
||||
_ChatItem = DataMgr.ChatData.Value.FirstOrDefault(c => c.role == ChatType.GetType(chat_index));
|
||||
Debug.Log(JsonConvert.SerializeObject(_ChatItem));
|
||||
if (DataMgr.ChatRecoverDays.Value != DateTime.Now.Day)
|
||||
{
|
||||
DataMgr.ChatFreeNumber.Value = GameHelper.GetCommonModel().FreeMessages;
|
||||
DataMgr.ChatRecoverDays.Value = DateTime.Now.Day;
|
||||
}
|
||||
setChatNum();
|
||||
if (_ChatItem != null)
|
||||
{
|
||||
_ChatItem.content_list.RemoveAll(item => !IsSameDay(item.chat_time));
|
||||
if (_ChatItem.content_list.Count > 100)
|
||||
{
|
||||
_ChatItem.content_list.RemoveRange(0, _ChatItem.content_list.Count - 100);
|
||||
}
|
||||
DataMgr.ChatData.Save();
|
||||
list_count = _ChatItem.content_list.Count;
|
||||
Debug.Log(list_count + "..................");
|
||||
for (int i = 0; i < _ChatItem.content_list.Count; i++)
|
||||
{
|
||||
if (_ChatItem.content_list[i].type == 0)
|
||||
{
|
||||
item_chatText_right com_msg = (item_chatText_right)UIPackage.CreateObject("LG_AIchat", "item_chatText_right");
|
||||
com_msg.text_content.text = _ChatItem.content_list[i].text_content;
|
||||
GameHelper.SetSelfAvatar(com_msg.btn_head.load_avatar, DataMgr.PlayerAvatarId.Value);
|
||||
ui.list_.AddChild(com_msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
item_chatText_left com_msg = (item_chatText_left)UIPackage.CreateObject("LG_AIchat", "item_chatText_left");
|
||||
com_msg.text_content.text = _ChatItem.content_list[i].text_content;
|
||||
if (chat_index == 0) com_msg.head.url = "ui://tksc66j2ljeg27";
|
||||
else if (chat_index == 1) com_msg.head.url = "ui://tksc66j2ljeg25";
|
||||
else if (chat_index == 2) com_msg.head.url = "ui://tksc66j2ljeg20";
|
||||
ui.list_.AddChild(com_msg);
|
||||
}
|
||||
}
|
||||
if (list_count > 3) ui.list_.ScrollToView(list_count - 1);
|
||||
ChatHelper.CheckReply();
|
||||
}
|
||||
else
|
||||
{
|
||||
ChatHelper.GetMessage(chat_index);
|
||||
DOVirtual.DelayedCall(1, () =>
|
||||
{
|
||||
ChatHelper.CheckReply();
|
||||
});
|
||||
}
|
||||
|
||||
// DataMgr.ChatData.Value = "";
|
||||
ui.btn_send.SetClick(() =>
|
||||
{
|
||||
if (DataMgr.ChatFreeNumber.Value > 0 || DataMgr.ChatNumber.Value > 0)
|
||||
{
|
||||
if (ui.input_message.text.IsNullOrWhiteSpace())
|
||||
{
|
||||
GameHelper.ShowTips("message_tips", true);
|
||||
return;
|
||||
}
|
||||
Debug.Log(ui.input_message.text.Length);
|
||||
if (ui.input_message.text.Length > 200)
|
||||
{
|
||||
GameHelper.ShowTips("character_limit", true);
|
||||
return;
|
||||
}
|
||||
if (DataMgr.ChatFreeNumber.Value > 0)
|
||||
{
|
||||
DataMgr.ChatFreeNumber.Value--;
|
||||
}
|
||||
else DataMgr.ChatNumber.Value--;
|
||||
setChatNum();
|
||||
ChatHelper.SendMessage(chat_index, ui.input_message.text);
|
||||
|
||||
list_count++;
|
||||
DOVirtual.DelayedCall(4, () =>
|
||||
{
|
||||
Debug.Log("重复一次");
|
||||
ChatHelper.CheckReply();
|
||||
});
|
||||
|
||||
if (have_inputani)
|
||||
{
|
||||
ui.list_.RemoveChildAt(ui.list_.numItems - 1);
|
||||
|
||||
}
|
||||
|
||||
|
||||
item_chatText_right com_msg = (item_chatText_right)UIPackage.CreateObject("LG_AIchat", "item_chatText_right");
|
||||
com_msg.text_content.text = ui.input_message.text;
|
||||
GameHelper.SetSelfAvatar(com_msg.btn_head.load_avatar, DataMgr.PlayerAvatarId.Value);
|
||||
ui.list_.AddChild(com_msg);
|
||||
|
||||
item_chatText_left com_msg_ = (item_chatText_left)UIPackage.CreateObject("LG_AIchat", "item_chatText_left");
|
||||
com_msg_.t0.Play(-1, 0, null);
|
||||
if (chat_index == 0) com_msg_.head.url = "ui://tksc66j2ljeg27";
|
||||
else if (chat_index == 1) com_msg_.head.url = "ui://tksc66j2ljeg25";
|
||||
else if (chat_index == 2) com_msg_.head.url = "ui://tksc66j2ljeg20";
|
||||
ui.list_.AddChild(com_msg_);
|
||||
|
||||
have_inputani = true;
|
||||
|
||||
|
||||
if (_ChatItem == null)
|
||||
{
|
||||
_ChatItem = new ChatItem()
|
||||
{
|
||||
role = ChatType.GetType(chat_index),
|
||||
content_list = new List<ChatText>(),
|
||||
};
|
||||
DataMgr.ChatData.Value.Add(_ChatItem);
|
||||
}
|
||||
_ChatItem.content_list.Add(new ChatText()
|
||||
{
|
||||
type = 0,
|
||||
text_content = ui.input_message.text,
|
||||
chat_time = GameHelper.GetNowTime(),
|
||||
});
|
||||
DataMgr.ChatData.Save();
|
||||
ui.input_message.text = "";
|
||||
ui.list_.ScrollToView(ui.list_.numItems - 1);
|
||||
|
||||
DOVirtual.DelayedCall(1, () =>
|
||||
{
|
||||
ChatHelper.CheckReply();
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.ChatNumberUI_Open);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
private bool have_inputani = false;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 58ebdba9853c84405a4a4b497e81179c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class ChatUICtrl : BaseUICtrl
|
||||
{
|
||||
private ChatUI ui;
|
||||
private ChatModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.ChatUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.ChatUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.ChatModel) as ChatModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new ChatUI(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: c8deb89af60a64834a3b0153598b0040
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 629a0c9ec1d9a4579b355feaea8e9413
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9c1da44915f974e1ebf15a69a3ba17a9
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
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 BallKingdomCrush
|
||||
{
|
||||
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 BallKingdomCrush
|
||||
{
|
||||
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.Normal;
|
||||
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 BallKingdomCrush
|
||||
{
|
||||
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:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 26b8d964c1371440687330e82a4e8728
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class ChatUnlockCtrl : BaseCtrl
|
||||
{
|
||||
public static ChatUnlockCtrl Instance { get; private set; }
|
||||
|
||||
private ChatUnlockModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.ChatUnlockModel) as ChatUnlockModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7c093fabf4fa34bf4a1fb3482d8f9761
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class ChatUnlockModel : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47d86987ec02a450ea21d30862f75ef1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,93 @@
|
||||
|
||||
using FGUI.ZM_Common_01;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using Spine.Unity;
|
||||
using System;
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class ChatUnlockUI : BaseUI
|
||||
{
|
||||
private ChatUnlockUICtrl ctrl;
|
||||
private ChatUnlockModel model;
|
||||
private FGUI.LG_Unlock.com_chatUnlock ui;
|
||||
|
||||
public ChatUnlockUI(ChatUnlockUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.ChatUnlockUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "LG_Unlock";
|
||||
uiInfo.assetName = "com_chatUnlock";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.ChatUnlockModel) as ChatUnlockModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
closeCallback?.Invoke();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.LG_Unlock.com_chatUnlock;
|
||||
}
|
||||
|
||||
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 Action closeCallback;
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
SkeletonAnimation ske_pot = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_parent, Fx_Type.fx_chatphone, ref closeCallback);
|
||||
ske_pot.state.SetAnimation(0, "animation", true);
|
||||
|
||||
SkeletonAnimation ske_pot1 = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_parent2, Fx_Type.fx_chatvideo, ref closeCallback);
|
||||
ske_pot1.state.SetAnimation(0, "animation", true);
|
||||
|
||||
SkeletonAnimation ske_pot2 = FXManager.Instance.SetFx<SkeletonAnimation>(ui.ani_assitant, Fx_Type.fx_assitant, ref closeCallback);
|
||||
ske_pot1.state.SetAnimation(0, "animation", true);
|
||||
|
||||
ui.btn_close.SetClick(CtrlCloseUI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d75d7fcc65bbb4bd9bea1bbe54ce9bdd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,73 @@
|
||||
|
||||
|
||||
namespace BallKingdomCrush
|
||||
{
|
||||
public class ChatUnlockUICtrl : BaseUICtrl
|
||||
{
|
||||
private ChatUnlockUI ui;
|
||||
private ChatUnlockModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.ChatUnlockUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.ChatUnlockUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.ChatUnlockModel) as ChatUnlockModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new ChatUnlockUI(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: e758e321c0de44349be76c88070b8e85
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf8752ba62de0944699341c95ac0fdc8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user