提交项目
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 ZooMatch
|
||||
{
|
||||
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 ZooMatch
|
||||
{
|
||||
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 ZooMatch
|
||||
{
|
||||
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.PackrewardUI_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 ZooMatch
|
||||
{
|
||||
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 ZooMatch
|
||||
{
|
||||
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 ZooMatch
|
||||
{
|
||||
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,149 @@
|
||||
using System;
|
||||
using FGUI.ZM_Common_01;
|
||||
using FairyGUI;
|
||||
namespace ZooMatch
|
||||
{
|
||||
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;
|
||||
|
||||
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())
|
||||
{
|
||||
AdRedeemManager.Instance.Destroy();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_AddCell_12.com_addView;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.buy_one_show, 1);
|
||||
|
||||
// ad_cool_down = ConfigSystem.GetConfig<CommonModel>().exchangeCD;
|
||||
// btn_WatchAd = ui.btn_watch as btn_watchAd;
|
||||
if (GameHelper.IsAdModelOfPay())
|
||||
{
|
||||
AdRedeemManager.Instance.SetWatchAd(AdRedeemManager.buy_one, ui.btn_watch as btn_watchAd, SetTextString);
|
||||
ui.pay_type.selectedIndex = 0;
|
||||
|
||||
|
||||
AdRedeemManager.Instance.Start();
|
||||
SetTextString();
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.pay_type.selectedIndex = 1;
|
||||
decimal price = (decimal)GameHelper.GetCommonModel().addspace2;
|
||||
ui.btn_max_pay.title = GameHelper.Get102Str(price);
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) (ui.btn_max_pay.GetChild("img_saveingpot") as GImage).visible = true;
|
||||
ui.btn_max_pay.SetClick(() =>
|
||||
{
|
||||
MaxPayClass maxPayData = new MaxPayClass
|
||||
{
|
||||
amount = (int)Math.Round(price * 100),
|
||||
sku = MaxPayManager.buy_one,
|
||||
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.apple_pay_success, pay_success);
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.apple_pay_success, pay_success);
|
||||
|
||||
}
|
||||
#endregion
|
||||
void pay_success(object str)
|
||||
{
|
||||
string type = (string)str;
|
||||
|
||||
if (type == AdRedeemManager.buy_one)
|
||||
{
|
||||
CtrlCloseUI();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
// HallManager.Instance.UpdateSecondEvent += updateWatchCD;
|
||||
// updateWatchCD();
|
||||
|
||||
// checkBtnState();
|
||||
|
||||
}
|
||||
|
||||
public void SetTextString()
|
||||
{
|
||||
var need = AdRedeemManager.Instance.GetCeilingNeedAds(AdRedeemManager.buy_one);
|
||||
var myAd = AdRedeemManager.Instance.GetLookRewardADNum();
|
||||
|
||||
ui.tips.SetVar("num", need.ToString()).FlushVars();
|
||||
ui.ads.SetVar("num", myAd + "/" + need).FlushVars();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 ZooMatch
|
||||
{
|
||||
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: 7cd26590d486545e1a3136932bbad927
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class BroadcastCtrl : BaseCtrl
|
||||
{
|
||||
public static BroadcastCtrl Instance { get; private set; }
|
||||
|
||||
private BroadcastModel model;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 575f1d3d71a8445bc8d960a3f33d8bc1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class BroadcastModel : BaseModel
|
||||
{
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2362fee130b6f4067b943f44ba629113
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,214 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using FutureCore;
|
||||
using FairyGUI;
|
||||
|
||||
using System;
|
||||
using DG.Tweening;
|
||||
using Spine.Unity;
|
||||
using ZooMatch;
|
||||
using FGUI.ZM_Common_01;
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class BroadcastUI : BaseUI
|
||||
{
|
||||
private BroadcastUICtrl ctrl;
|
||||
private BroadcastModel model;
|
||||
private FGUI.ZM_Common_01.com_broadcast1 ui;
|
||||
|
||||
public BroadcastUI(BroadcastUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.BroadcastUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Common_01";
|
||||
uiInfo.assetName = "com_broadcast1";
|
||||
uiInfo.layerType = UILayerType.Top;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = false;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Common_01.com_broadcast1;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
InitView();
|
||||
//ui.y = 241;
|
||||
|
||||
if (UIManager.Instance.IsExistUI(UIConst.RainPlayUI))
|
||||
{
|
||||
Setbuttom();
|
||||
}
|
||||
else
|
||||
{
|
||||
Settop();
|
||||
}
|
||||
// ui.visible = false;
|
||||
// if (Screen.safeArea.y != 0)
|
||||
// {//刘海屏
|
||||
// ui.y += Screen.safeArea.y;
|
||||
// }
|
||||
text_ui = ui.broad_cast_text;
|
||||
|
||||
ui.btn_record.SetClick(OpenRecord);
|
||||
ui.broad_cast_text.btn_broad.SetClick(OpenRecord);
|
||||
|
||||
if (ConfigSystem.GetConfig<exBrPoolModel>() == null) return;
|
||||
config_name_list = ConfigSystem.GetConfig<exBrPoolModel>().config_name_list;
|
||||
config_money_list = ConfigSystem.GetConfig<exBrPoolModel>().config_money_list;
|
||||
GameDispatcher.Instance.AddListener(GameMsg.hideBroadCast, hideEvent);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.showBroadCast, showEvent);
|
||||
UICtrlDispatcher.Instance.AddListener(UICtrlMsg.MainUI_Open, Settop);
|
||||
UICtrlDispatcher.Instance.AddListener(UICtrlMsg.RainPlayUI_Open, Setbuttom);
|
||||
}
|
||||
|
||||
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 int time_count = 11;
|
||||
private com_broadcast_text1 text_ui;
|
||||
private List<string> config_name_list;
|
||||
private List<string> config_money_list;
|
||||
private bool main_ui_show = true;
|
||||
//初始化页面逻辑
|
||||
|
||||
private Action closeCallback = null;
|
||||
private void InitView()
|
||||
{
|
||||
HallManager.Instance.UpdateSecondEvent += timeEvent;
|
||||
|
||||
|
||||
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.broad_cast_text.bg_panel, Fx_Type.fx_broad, ref closeCallback);
|
||||
sk.state.SetAnimation(0, "animation", true);
|
||||
}
|
||||
|
||||
private void OpenRecord()
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RecordViewUI_Open);
|
||||
}
|
||||
private void hideEvent(object sender = null)
|
||||
{
|
||||
Debug.Log("hide");
|
||||
main_ui_show = false;
|
||||
ui.visible = false;
|
||||
}
|
||||
private void showEvent(object sender = null)
|
||||
{
|
||||
Debug.Log("show");
|
||||
main_ui_show = true;
|
||||
ui.visible = true;
|
||||
}
|
||||
private void Settop(object sender = null)
|
||||
{
|
||||
ui.group_.y = 415;
|
||||
if (Screen.safeArea.y != 0)
|
||||
{//刘海屏
|
||||
ui.group_.y += Screen.safeArea.y;
|
||||
}
|
||||
}
|
||||
private void Setbuttom(object sender = null)
|
||||
{
|
||||
//ui.group_.y = GRoot.inst.height - 300;
|
||||
ui.group_.y = 378;
|
||||
if (Screen.safeArea.y != 0)
|
||||
{//刘海屏
|
||||
ui.group_.y += Screen.safeArea.y;
|
||||
}
|
||||
}
|
||||
void timeEvent()
|
||||
{
|
||||
time_count++;
|
||||
// if (time_count > 30)
|
||||
// {
|
||||
// time_count = 0;
|
||||
// var name_index = UnityEngine.Random.Range(0, config_name_list.Count);
|
||||
// var money_index = UnityEngine.Random.Range(0, config_money_list.Count);
|
||||
// if (main_ui_show)
|
||||
// {
|
||||
// ui.visible = true;
|
||||
// }
|
||||
// Debug.Log(text_ui.cast_text.text);
|
||||
// text_ui.cast_text.text = String.Format(text_ui.hide_text.text, config_name_list[name_index],
|
||||
// config_money_list[money_index], DateTimeManager.Instance.GetCurrDateTime());
|
||||
// text_ui.cast_text.x = 686;
|
||||
// Tweener tweener = DOTween.To(() => text_ui.cast_text.x,
|
||||
// x => text_ui.cast_text.x = x, -1300, 10);
|
||||
|
||||
// }
|
||||
|
||||
// time_count = 0;
|
||||
|
||||
|
||||
//Debug.Log($"barry broad time count======== {time_count}");
|
||||
if (time_count > 20)
|
||||
{
|
||||
time_count = 0;
|
||||
var name_index = UnityEngine.Random.Range(0, config_name_list.Count);
|
||||
var money_index = UnityEngine.Random.Range(0, config_money_list.Count);
|
||||
Debug.Log(text_ui.cast_text.text);
|
||||
|
||||
string name = config_name_list[name_index];
|
||||
if (name.Length > 4)
|
||||
{
|
||||
name = name[..4] + "...";
|
||||
}
|
||||
string broad_text = String.Format(text_ui.hide_text.text, name,
|
||||
"$" + config_money_list[money_index], DateTimeManager.Instance.GetCurrDateTime());
|
||||
text_ui.cast_text.text = broad_text;
|
||||
// Tweener tweener = DOTween.To(() => ui.broad.x,
|
||||
// x => ui.broad.x = x, 200, 0.5f);
|
||||
ui.t0.Play();
|
||||
|
||||
DOVirtual.DelayedCall(3.5f, () =>
|
||||
{
|
||||
// Tweener tweener = DOTween.To(() => ui.broad.x,
|
||||
// x => ui.broad.x = x, 1080, 0.5f);
|
||||
ui.t1.Play();
|
||||
});
|
||||
string str = name + "-" + config_money_list[money_index] + "-" + DateTimeManager.Instance.GetCurrDateTime();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.updateRecordList, str);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d9a4125b4c0c64c94857a7ac85479526
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,77 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace ZooMatch
|
||||
|
||||
{
|
||||
public class BroadcastUICtrl : BaseUICtrl
|
||||
{
|
||||
private BroadcastUI ui;
|
||||
private BroadcastModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.BroadcastUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.BroadcastUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.BroadcastModel) as BroadcastModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new BroadcastUI(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: 35a4fff4d50cc4404951bdbed6e43b22
|
||||
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 ZooMatch
|
||||
{
|
||||
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 ZooMatch
|
||||
{
|
||||
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,157 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
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 = false;
|
||||
}
|
||||
|
||||
#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.GetConfig<CommonModel>().Purchaseprops);
|
||||
ui.btn_buy.SetClick(buyItem);
|
||||
setBtnState(state_);
|
||||
InitView();
|
||||
|
||||
ui.t0.Play();
|
||||
}
|
||||
void buyItem()
|
||||
{
|
||||
if (state_ == 0)
|
||||
{
|
||||
|
||||
}
|
||||
else if (state_ == 1)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
else if (state_ == 2)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
if (GameHelper.CheckGoldNumber(ConfigSystem.GetConfig<CommonModel>().Purchaseprops))
|
||||
{
|
||||
GameHelper.AddGoldNumber(-ConfigSystem.GetConfig<CommonModel>().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("The purchase was successful", true);
|
||||
ui.t1.Play(()=>{
|
||||
CtrlCloseUI();
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("Not enough gold");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
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(() =>
|
||||
{
|
||||
ui.t1.Play(() =>{
|
||||
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 ZooMatch
|
||||
{
|
||||
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: cf8752ba62de0944699341c95ac0fdc8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class ChoosePropCtrl : BaseCtrl
|
||||
{
|
||||
public static ChoosePropCtrl Instance { get; private set; }
|
||||
|
||||
private ChoosePropModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.ChoosePropModel) as ChoosePropModel;
|
||||
}
|
||||
|
||||
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: 30f4147b6a9f34f8a98d5bbc0a788e6d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class ChoosePropModel : 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: 24f4458949b044bf5ad0e021638528e0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,190 @@
|
||||
using FairyGUI;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class ChoosePropUI : BaseUI
|
||||
{
|
||||
private ChoosePropUICtrl ctrl;
|
||||
private ChoosePropModel model;
|
||||
private FGUI.ZM_Prop_09.com_choose ui;
|
||||
|
||||
public ChoosePropUI(ChoosePropUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.ChoosePropUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Prop_09";
|
||||
uiInfo.assetName = "com_choose";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.ChoosePropModel) as ChoosePropModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Prop_09.com_choose;
|
||||
}
|
||||
|
||||
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()
|
||||
{
|
||||
// Debug.Log(GameHelper.GetLevelstate());
|
||||
int state = GameHelper.GetLevelstate();
|
||||
int need_gold = ConfigSystem.GetConfig<CommonModel>().RevivalCoins;
|
||||
ui.btn_gold_buy.GetChild("text_gold").text = GameHelper.Get101Str(need_gold);
|
||||
|
||||
initProp(state);
|
||||
|
||||
ui.btn_thanks.SetClick(() =>
|
||||
{
|
||||
float[] cash_array = GameHelper.GetRewardValue(2);
|
||||
var temp = new SuccessData();
|
||||
temp.IsWin = false;
|
||||
temp.cash_number = cash_array[0];
|
||||
temp.IsLevelSuccess = true;
|
||||
temp.IsH5Reward = false;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
|
||||
|
||||
});
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
|
||||
float[] cash_array = GameHelper.GetRewardValue(2);
|
||||
var temp = new SuccessData();
|
||||
temp.IsWin = false;
|
||||
temp.cash_number = cash_array[0];
|
||||
temp.IsLevelSuccess = true;
|
||||
temp.IsH5Reward = false;
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void initProp(int state)
|
||||
{
|
||||
int need_gold = ConfigSystem.GetConfig<CommonModel>().RevivalCoins;
|
||||
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) (ui.btn_ad.GetChild("img_saveingpot") as GImage).visible = true;
|
||||
if (state == 3)
|
||||
{
|
||||
ui.state.selectedIndex = ui._State_all_;
|
||||
ui.btn_ad.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowVideoAd("reward_lobby", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
GameHelper.SetLevelstate(1);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Remake_state, true);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
ui.btn_gold_buy.SetClick(() =>
|
||||
{
|
||||
if (GameHelper.CheckGoldNumber(need_gold))
|
||||
{
|
||||
GameHelper.AddGoldNumber(-need_gold);
|
||||
GameHelper.SetLevelstate(2);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Remake_state, true);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("Not enough gold");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
else if (state == 2)
|
||||
{
|
||||
ui.state.selectedIndex = ui._State_ad;
|
||||
ui.btn_ad.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowVideoAd("reward_lobby", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
GameHelper.SetLevelstate(0);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Remake_state, true);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else if (state == 1)
|
||||
{
|
||||
ui.state.selectedIndex = ui._State_gold;
|
||||
ui.btn_gold_buy.SetClick(() =>
|
||||
{
|
||||
if (GameHelper.CheckGoldNumber(need_gold))
|
||||
{
|
||||
GameHelper.AddGoldNumber(-need_gold);
|
||||
GameHelper.SetLevelstate(0);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Remake_state, true);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("Not enough gold");
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05d11be9302224ba99cc14d10974266f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class ChoosePropUICtrl : BaseUICtrl
|
||||
{
|
||||
private ChoosePropUI ui;
|
||||
private ChoosePropModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.ChoosePropUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.ChoosePropUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.ChoosePropModel) as ChoosePropModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new ChoosePropUI(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: d012c092edd6c41a2bbbed3c72ca2bfe
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b05bab87ee5860d45b1e0e643cda6b64
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88b71acc77eae444ca3b0a7275fa9c88
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,44 @@
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class FXWndCtrl : BaseCtrl
|
||||
{
|
||||
public static FXWndCtrl Instance { get; private set; }
|
||||
|
||||
private FXWndModel model;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
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,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ba389480d8644e5bb9fae2d8eb324f0
|
||||
timeCreated: 1671086538
|
||||
@@ -0,0 +1,51 @@
|
||||
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class FXWndModel : 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,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c48389d259bf411e80143844af2b2591
|
||||
timeCreated: 1671086538
|
||||
@@ -0,0 +1,192 @@
|
||||
using System;
|
||||
using DG.Tweening;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using Spine.Unity;
|
||||
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class FXWndUI : BaseUI
|
||||
{
|
||||
private FXWndUICtrl ctrl;
|
||||
private FXWndModel model;
|
||||
private FGUI.ZM_Fx_502.com_FX ui;
|
||||
|
||||
private Transform parTrf;
|
||||
|
||||
public FXWndUI(FXWndUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.FXWndUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Fx_502";
|
||||
uiInfo.assetName = "com_FX";
|
||||
uiInfo.layerType = UILayerType.Animation;
|
||||
}
|
||||
|
||||
public void PlayFx(FxPlayData fxPlayData)
|
||||
{
|
||||
FxPlayData data = fxPlayData;
|
||||
GameObject arg = null;
|
||||
Transform trf = null;
|
||||
Action recFx = null;
|
||||
if (data.isParticleSystem)
|
||||
{
|
||||
ParticleSystem system = FXManager.Instance.GetFx<ParticleSystem>(data.fxType);
|
||||
system.Play();
|
||||
arg = system.gameObject;
|
||||
trf = system.transform;
|
||||
recFx = delegate { FXManager.Instance.RecFx<ParticleSystem>(data.fxType, system); };
|
||||
}
|
||||
else
|
||||
{
|
||||
SkeletonAnimation system = FXManager.Instance.GetFx<SkeletonAnimation>(data.fxType);
|
||||
trf = system.transform;
|
||||
arg = system.gameObject;
|
||||
recFx = delegate { FXManager.Instance.RecFx<SkeletonAnimation>(data.fxType, system); };
|
||||
}
|
||||
|
||||
trf.SetParent(parTrf);
|
||||
arg.SetLayer("UI");
|
||||
Action cb = SetSortingOrder(arg);
|
||||
data.endEvent += (e) => cb?.Invoke();
|
||||
|
||||
Vector3 startPot = GameHelper.FguiPotToUnityTrfLocalPot(data.startPot);
|
||||
|
||||
trf.localPosition = startPot;
|
||||
trf.localScale = Vector3.one * data.size;
|
||||
trf.localEulerAngles = Vector3.zero;
|
||||
fxPlayData.startEvent?.Invoke(arg);
|
||||
|
||||
DOVirtual.DelayedCall(data.duration, () =>
|
||||
{
|
||||
data.endEvent?.Invoke(arg);
|
||||
|
||||
|
||||
recFx?.Invoke();
|
||||
|
||||
FxPlayData.Release(data);
|
||||
});
|
||||
}
|
||||
|
||||
private Action SetSortingOrder(GameObject obj)
|
||||
{
|
||||
Action action = null;
|
||||
Renderer[] renders = obj.GetComponentsInChildren<Renderer>();
|
||||
foreach (Renderer render in renders)
|
||||
{
|
||||
if (render != null)
|
||||
{
|
||||
render.sortingOrder += 300;
|
||||
action += () => { render.sortingOrder -= 300; };
|
||||
}
|
||||
}
|
||||
|
||||
return action;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Fx_502.com_FX;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
parTrf = ui.displayObject.cachedTransform;
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
public class FxPlayData
|
||||
{
|
||||
private static ObjectPool<FxPlayData> _Pool = new ObjectPool<FxPlayData>();
|
||||
|
||||
public static FxPlayData Get(Fx_Type fx_Type, float _duration, Vector2 _pot)
|
||||
{
|
||||
FxPlayData data = _Pool.Get();
|
||||
if (_pot == Vector2.zero)
|
||||
{
|
||||
data.startPot = GRoot.inst.size / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
data.startPot = _pot;
|
||||
}
|
||||
|
||||
if (_duration == 0)
|
||||
{
|
||||
data.duration = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
data.duration = _duration;
|
||||
}
|
||||
|
||||
data.fxType = fx_Type;
|
||||
return data;
|
||||
}
|
||||
|
||||
public static void Release(FxPlayData data)
|
||||
{
|
||||
data.duration = 0;
|
||||
data.startEvent = null;
|
||||
data.endEvent = null;
|
||||
data.isParticleSystem = true;
|
||||
data.startPot = Vector2.zero;
|
||||
_Pool.Release(data);
|
||||
}
|
||||
|
||||
public float duration;
|
||||
|
||||
public Fx_Type fxType;
|
||||
|
||||
public bool isParticleSystem = true;
|
||||
|
||||
public Vector2 startPot;
|
||||
|
||||
public Action<GameObject> startEvent;
|
||||
|
||||
public Action<GameObject> endEvent;
|
||||
|
||||
public int size = 100;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 57addc9545404bc9b81d1ffbe0d02508
|
||||
timeCreated: 1671086538
|
||||
@@ -0,0 +1,95 @@
|
||||
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class FXWndUICtrl : BaseUICtrl
|
||||
{
|
||||
private FXWndUI ui;
|
||||
private FXWndModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.FXWndUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.FXWndUI_Close;
|
||||
|
||||
private bool isOpen = false;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null || ui.isClose)
|
||||
{
|
||||
ui = new FXWndUI(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);
|
||||
uiCtrlDispatcher.AddListener(UICtrlMsg.PlayUIFX, PlayFx);
|
||||
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
uiCtrlDispatcher.RemoveListener(UICtrlMsg.PlayUIFX, PlayFx);
|
||||
}
|
||||
|
||||
private void PlayFx(object obj)
|
||||
{
|
||||
if (!isOpen)
|
||||
{
|
||||
OpenUI();
|
||||
}
|
||||
FxPlayData fxType = (FxPlayData)obj;
|
||||
ui.PlayFx(fxType);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e43875b511c04a81a511ab1a4bdb6c5c
|
||||
timeCreated: 1671086538
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a6026fb838906f2419772b0ca9f743fa
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class FirstRewardCtrl : BaseCtrl
|
||||
{
|
||||
public static FirstRewardCtrl Instance { get; private set; }
|
||||
|
||||
private FirstRewardModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.FirstRewardModel) as FirstRewardModel;
|
||||
}
|
||||
|
||||
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: 2b10e7a12f76b4e9c9389034c3bcee2c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class FirstRewardModel : 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: 139c7e95f3a174f9f996d4aaf7465f2c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,159 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
// using FGUI.G002_main;
|
||||
using Spine.Unity;
|
||||
using DG.Tweening;
|
||||
using FGUI.ZM_Lobby_03;
|
||||
using FGUI.ZM_Common_01;
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class FirstRewardUI : BaseUI
|
||||
{
|
||||
private FirstRewardUICtrl ctrl;
|
||||
private FirstRewardModel model;
|
||||
private FGUI.ZM_Lobby_03.com_first_award ui;
|
||||
private Action closeCallback;
|
||||
private Action open_sign;
|
||||
private bool is_get = false;
|
||||
public FirstRewardUI(FirstRewardUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.FirstRewardUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Lobby_03";
|
||||
uiInfo.assetName = "com_first_award";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
model = ModuleManager.Instance.GetModel(ModelConst.FirstRewardModel) as FirstRewardModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
closeCallback();
|
||||
//open_sign();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Lobby_03.com_first_award;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (Screen.safeArea.y != 0)
|
||||
{//刘海屏
|
||||
ui.money.y += Screen.safeArea.y;
|
||||
}
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
//open_sign = (System.Action)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.money.GetChild("text_gold").text = $"{PreferencesMgr.Instance.Currency101:N0}";
|
||||
ui.money.GetChild("btn_cash").visible = false;
|
||||
com_money money = ui.money as com_money;
|
||||
money.btn_cash.visible = false;
|
||||
money.number_text.text = GameHelper.Get102Str();
|
||||
|
||||
ui.text_num.text = "$" + ConfigSystem.GetConfig<CommonModel>().InitialNum.ToString();
|
||||
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.spine_parent, Fx_Type.fx_first_reward, ref closeCallback);
|
||||
sk.state.SetAnimation(0, "newbie_reward_an01", false);
|
||||
sk.state.Complete += (a) =>
|
||||
{
|
||||
sk.state.SetAnimation(0, "newbie_reward_an02", true);
|
||||
ui.btn_getreward.SetClick(() =>
|
||||
{
|
||||
ui.btn_getreward.visible = false;
|
||||
sk.state.SetAnimation(0, "newbie_reward_an03", false);
|
||||
sk.state.Complete += (a) =>
|
||||
{
|
||||
ui.state.selectedIndex = com_first_award.State_page;
|
||||
};
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
ui.btn_get.SetClick(GetReward);
|
||||
ui.btn_close.SetClick(GetReward);
|
||||
}
|
||||
private void GetReward()
|
||||
{
|
||||
|
||||
com_money money = ui.money as com_money;
|
||||
|
||||
if (is_get) return;
|
||||
is_get = true;
|
||||
|
||||
|
||||
var start = GameHelper.GetUICenterPosition(ui.img_money);
|
||||
var end = GameHelper.GetUICenterPosition(ui.money.GetChild("icon"));
|
||||
|
||||
int awardNum = ConfigSystem.GetConfig<CommonModel>().InitialNum;
|
||||
|
||||
var rewardData = new RewardData();
|
||||
|
||||
var rewardSingleData = new RewardSingleData(102, awardNum, RewardOrigin.AdTask)
|
||||
{
|
||||
startPosition = start,
|
||||
endPosition = new Vector2(end.x - 150, end.y - 136)
|
||||
};
|
||||
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
rewardData.displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
|
||||
rewardData.AddCompleted(success =>
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
GameHelper.AddGoldNumber(50);
|
||||
var startNum = PreferencesMgr.Instance.Currency102 - awardNum;
|
||||
DOVirtual.Float((float)startNum, (float)PreferencesMgr.Instance.Currency102, 1,
|
||||
value => { money.number_text.text = GameHelper.Get102Str((decimal)value); });
|
||||
PlayerPrefs.SetInt("FirstReward", 1);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UpdateCurrency102);
|
||||
DOVirtual.DelayedCall(1.5f, () =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.FirstRewardUI_Close);
|
||||
});
|
||||
}
|
||||
});
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10ed78edd8a4f471d8230502a75e04f5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class FirstRewardUICtrl : BaseUICtrl
|
||||
{
|
||||
private FirstRewardUI ui;
|
||||
private FirstRewardModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.FirstRewardUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.FirstRewardUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.FirstRewardModel) as FirstRewardModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new FirstRewardUI(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: 943432b7abe7d41eb9b023894a945fcf
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 47eb9299e68a4344a901834dacddbf41
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GameLoginCtrl : BaseCtrl
|
||||
{
|
||||
public static GameLoginCtrl Instance { get; private set; }
|
||||
|
||||
private GameLoginModel model;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5089dfe313b4fc64c92cf29d58609006
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GameLoginModel : BaseModel
|
||||
{
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b46e3ae2b0959c14ba484e8ead2dc449
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,156 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
using System.Collections;
|
||||
using DG.Tweening;
|
||||
using FGUI.ZM_Login_05;
|
||||
using FGUI.ZM_Game_04;
|
||||
using UnityEngine;
|
||||
|
||||
// using FGUI.A000_common;
|
||||
|
||||
public class GameLoginUI : BaseUI
|
||||
{
|
||||
private GameLoginUICtrl ctrl;
|
||||
private GameLoginModel model;
|
||||
private FGUI.ZM_Login_05.com_login_page ui;
|
||||
|
||||
public GameLoginUI(GameLoginUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.GameLoginUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Login_05";
|
||||
uiInfo.assetName = "com_login_page";
|
||||
uiInfo.layerType = UILayerType.Normal;
|
||||
}
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
netFbloadBindLogin?.Kill();
|
||||
CommonHelper.FadeOut(ui);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenBgUI_Close);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Login_05.com_login_page;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
InitView();
|
||||
|
||||
var reqData = new RespLoginFunnelData
|
||||
{
|
||||
type = "enterButtonShow",
|
||||
payload = ""
|
||||
};
|
||||
NetworkKit.PostFunnelLogin(reqData);
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
CommonHelper.FadeIn(ui);
|
||||
}
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
}
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
ui.btn_login.SetClick(OnClickBtn, true);
|
||||
|
||||
App.HideLoadingUI();
|
||||
((com_login_privacy)ui.text_privacy_user).text_privacy_user.SetClick(OnClickPrivacy);
|
||||
((com_login_privacy)ui.text_privacy_user).text_privacy_user.onClickLink.Add((content) =>
|
||||
{
|
||||
switch (content.data)
|
||||
{
|
||||
case "link_href":
|
||||
OnClickTerms();
|
||||
break;
|
||||
case "link_href1":
|
||||
OnClickPrivacy();
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Action closeCallback = null;
|
||||
// var meteor = FXManager.Instance.SetFx<SkeletonAnimation>(ui.pla1, Fx_Type.meteor, ref closeCallback);
|
||||
// meteor.state.SetAnimation(0, "liziguang1", true);
|
||||
|
||||
// var login = FXManager.Instance.SetFx<SkeletonAnimation>(ui.pla, Fx_Type.login, ref closeCallback);
|
||||
// login.state.SetAnimation(0, "animation", true);
|
||||
|
||||
// var lantern = FXManager.Instance.SetFx<SkeletonAnimation>(ui.pla1, Fx_Type.lantern, ref closeCallback);
|
||||
// lantern.state.SetAnimation(0, "deng", true);
|
||||
|
||||
ui.btn_space.SetClick(OnclickSpace);
|
||||
ui.btn_error.SetClick(OnClickError);
|
||||
#if ZooMatchRelease
|
||||
ui.btn_space.visible = false;
|
||||
ui.btn_error.visible = false;
|
||||
#endif
|
||||
}
|
||||
private void OnclickSpace()
|
||||
{
|
||||
// Debug.Log("OnclickSpace");
|
||||
#if !UNITY_EDITOR
|
||||
MaxSdk.ShowMediationDebugger();
|
||||
#endif
|
||||
}
|
||||
int []test = new int[5];
|
||||
private void OnClickError()
|
||||
{
|
||||
|
||||
try
|
||||
{
|
||||
Debug.Log("barry This is a runtime error for testing purposes.");
|
||||
test[10] = 1;
|
||||
// throw new System.Exception($"This is a runtime error for testing purposes. click num = {}");
|
||||
}
|
||||
catch (System.Exception ex)
|
||||
{
|
||||
Debug.LogError(ex.Message);
|
||||
}
|
||||
}
|
||||
|
||||
private Tween netFbloadBindLogin;
|
||||
|
||||
public void OnClickBtn()
|
||||
{
|
||||
var reqData = new RespLoginFunnelData
|
||||
{
|
||||
type = "enterButtonClick",
|
||||
payload = ""
|
||||
};
|
||||
NetworkKit.PostFunnelLogin(reqData);
|
||||
|
||||
CtrlDispatcher.Instance.Dispatch(CtrlMsg.Game_Start);
|
||||
CtrlCloseUI();
|
||||
}
|
||||
|
||||
private void OnClickPrivacy()
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 0);
|
||||
}
|
||||
|
||||
private void OnClickTerms()
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6e6a93efe97683744a3a2ae64d433320
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,60 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GameLoginUICtrl : BaseUICtrl
|
||||
{
|
||||
private GameLoginUI ui;
|
||||
private GameLoginModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.GameLoginUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.GameLoginUI_Close;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new GameLoginUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
|
||||
ui = null;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 760e515e19f493145b362fec54a155fa
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cf3f4b14d5de1420e87a8f5c0a7d8232
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,19 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GameMenuCtrl : BaseCtrl
|
||||
{
|
||||
public static GameMenuCtrl Instance { get; private set; }
|
||||
|
||||
private GameMenuModel model;
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc874adbeb7dc4277adacd0caec10231
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GameMenuModel : BaseModel
|
||||
{
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 534b2234c4d8f4ca396b651aca10bc54
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,94 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
using System;
|
||||
using FairyGUI;
|
||||
using UnityEngine;
|
||||
using System.Globalization;
|
||||
using IgnoreOPS;
|
||||
|
||||
public class GameMenuUI : BaseUI
|
||||
{
|
||||
private GameMenuUICtrl ctrl;
|
||||
private GameMenuModel model;
|
||||
private FGUI.ZM_Game_04.com_game_menu ui;
|
||||
|
||||
private string content;
|
||||
|
||||
private bool isTerm;
|
||||
|
||||
public GameMenuUI(GameMenuUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.GameMenuUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Game_04";
|
||||
uiInfo.assetName = "com_game_menu";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = false;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Game_04.com_game_menu;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (args != null)
|
||||
{
|
||||
isTerm = (bool)args;
|
||||
}
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
ui?.show.Play();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
void HideAnim()
|
||||
{
|
||||
ui.hide.Play(() =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
});
|
||||
}
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
ui.SetClick(() => { HideAnim(); });
|
||||
ui.btn_exit.SetClick(() =>
|
||||
{
|
||||
HideAnim();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.ExitGame);
|
||||
});
|
||||
|
||||
ui.btn_settings.SetClick(() =>
|
||||
{
|
||||
HideAnim();
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MenuUI_Open);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4c89cb67a1dee49d89456c2f107500d8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,67 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GameMenuUICtrl : BaseUICtrl
|
||||
{
|
||||
private GameMenuUI ui;
|
||||
private GameMenuModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.GameMenuUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.GameMenuUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
|
||||
ui = null;
|
||||
}
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new GameMenuUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
#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);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: df3db200512334b5e9b4850547bd7318
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dbdbd9b75e6442f4db4775807b75fdd6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,41 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GameResultCtrl : BaseCtrl
|
||||
{
|
||||
public static GameResultCtrl Instance { get; private set; }
|
||||
|
||||
private GameResultModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bf30effd1c1cf4ee7965a785597ebb5a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GameResultModel : 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: 1a82cc7895b244916bf94ffb2678b292
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,444 @@
|
||||
using UnityEngine;
|
||||
using DG.Tweening;
|
||||
using System;
|
||||
using FGUI.ZM_Common_01;
|
||||
using FairyGUI;
|
||||
using System.Linq;
|
||||
using Spine.Unity;
|
||||
using IgnoreOPS;
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GameResultUI : BaseUI
|
||||
{
|
||||
private GameResultUICtrl ctrl;
|
||||
private GameResultModel model;
|
||||
private FGUI.ZM_GameResult_08.com_end ui;
|
||||
private bool IsWin;
|
||||
private bool IsLevelSuccess;
|
||||
private bool IsH5Reward;
|
||||
|
||||
private float AwardGoldNum = 20;
|
||||
private Action closeCallback;
|
||||
|
||||
private int AwardRate = 1;
|
||||
|
||||
public GameResultUI(GameResultUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.GameResultUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_GameResult_08";
|
||||
uiInfo.assetName = "com_end";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.GameResultModel) as GameResultModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameHelper.SetCloseResult(false);
|
||||
closeCallback?.Invoke();
|
||||
HallManager.Instance.UpdateSecondEvent -= timeEvent;
|
||||
if (IsLevelSuccess && !GameHelper.is_first_login) UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.OpenGameUI_Open, IsWin);
|
||||
if (IsH5Reward)
|
||||
{
|
||||
WebviewManager.Instance.ShowH5View(true);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.resetH5progress);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_GameResult_08.com_end;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) (ui.btn_mult.GetChild("img_saveingpot") as GImage).visible = true;
|
||||
var data = args as SuccessData;
|
||||
IsH5Reward = data.IsH5Reward;
|
||||
IsLevelSuccess = data.IsLevelSuccess;
|
||||
|
||||
if (GameHelper.IsGiftSwitch() && IsLevelSuccess && !IsH5Reward) {
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Open);
|
||||
|
||||
GameHelper.PlayGameTimeEvent(1, () => {
|
||||
GameHelper.RequestGameConfig();
|
||||
});
|
||||
} else {
|
||||
GameHelper.SetCloseResult(true);
|
||||
}
|
||||
|
||||
|
||||
if (Screen.safeArea.y != 0)
|
||||
{
|
||||
// ui.btn_gold.y += Screen.safeArea.y;
|
||||
ui.top_money.y += Screen.safeArea.y;
|
||||
ui.tips.y += Screen.safeArea.y;
|
||||
}
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent += timeEvent;
|
||||
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
ui.switchgift.selectedIndex = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.switchgift.selectedIndex = 0;
|
||||
}
|
||||
|
||||
// AwardNum = data.cash_number;
|
||||
IsWin = data.IsWin;
|
||||
if (IsWin)
|
||||
{
|
||||
if (AudioManager.Instance.IsOpenEffect)
|
||||
{
|
||||
AudioManager.Instance.PlayDynamicEffect(AudioConst.Victoriously);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (IsWin)
|
||||
{
|
||||
ui.win_lose.selectedIndex = ui._Win_lose_win;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.win_lose.selectedIndex = ui._Win_lose_lose;
|
||||
}
|
||||
|
||||
ui.btn_restart.SetClick(() =>
|
||||
{
|
||||
if (!GameHelper.GetCloseResult()) return;
|
||||
|
||||
GameHelper.addInterAdnumber();
|
||||
if (!IsWin) GameHelper.SetLevelstate(3);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Close);
|
||||
});
|
||||
ui.top_money.GetChild("number_text").text = GameHelper.Get102Str();
|
||||
ui.top_money.GetChild("btn_cash").visible = false;
|
||||
|
||||
float cash_number = data.cash_number;
|
||||
|
||||
if (IsWin)
|
||||
{
|
||||
AwardRate = data.rate;
|
||||
ui.btn_mult.GetChild("title").text = "Claim X" + AwardRate;
|
||||
var sk0 = FXManager.Instance.SetFx<SkeletonAnimation>(baseUI.GetChild("congra_parent") as GGraph, Fx_Type.fx_wins, ref closeCallback);
|
||||
sk0.state.SetAnimation(0, "7rihuodong2", false);
|
||||
|
||||
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(baseUI.GetChild("bg_parent") as GGraph, Fx_Type.fx_win, ref closeCallback);
|
||||
sk.state.SetAnimation(0, "out", true);
|
||||
|
||||
|
||||
}
|
||||
|
||||
InitView();
|
||||
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
if (IsWin) ui.text_award.text = GameHelper.Get102Str((decimal)cash_number);
|
||||
else
|
||||
{
|
||||
ui.text_award.text = GameHelper.Get102Str(PreferencesMgr.Instance.Currency102);
|
||||
ui.top_money.visible = false;
|
||||
}
|
||||
|
||||
ui.btn_mult.SetClick(() =>
|
||||
{
|
||||
if (!GameHelper.GetCloseResult()) return;
|
||||
|
||||
GameHelper.ShowVideoAd("reward_lobby", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
|
||||
{
|
||||
ui.com_cash.btn_cash.SetClick(() => { });
|
||||
ui.btn_claim.SetClick(() => { });
|
||||
ui.btn_mult.SetClick(() => { });
|
||||
float reward = cash_number * AwardRate;
|
||||
GetReward(reward);
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.RefreshMakeupData);
|
||||
}
|
||||
});
|
||||
});
|
||||
ui.btn_claim.SetClick(() =>
|
||||
{
|
||||
if (!GameHelper.GetCloseResult()) return;
|
||||
|
||||
ui.com_cash.btn_cash.SetClick(() => { });
|
||||
ui.btn_claim.SetClick(() => { });
|
||||
ui.btn_mult.SetClick(() => { });
|
||||
DOVirtual.DelayedCall(2f, () =>
|
||||
{
|
||||
GameHelper.addInterAdnumber();
|
||||
});
|
||||
GetReward(cash_number);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.RefreshMakeupData);
|
||||
|
||||
});
|
||||
|
||||
var name_index = UnityEngine.Random.Range(0, ConfigSystem.GetConfig<exBrPoolModel>().config_name_list.Count);
|
||||
var money_index = UnityEngine.Random.Range(0, ConfigSystem.GetConfig<exBrPoolModel>().config_money_list.Count);
|
||||
|
||||
System.DateTime oldtime = System.DateTime.Now.AddSeconds(-UnityEngine.Random.Range(1 * 3600, 2 * 3600));
|
||||
// Debug.Log(ConfigSystem.GetConfig<exBrPoolModel>().config_name_list[name_index]);
|
||||
ui.com_cash.broad.cast_text.text = string.Format("Congratulations, [color=#e3a13a]{0}[/color] withdraw [color=#83c93c]{1} [/color]dollars", ConfigSystem.GetConfig<exBrPoolModel>().config_name_list[name_index],
|
||||
ConfigSystem.GetConfig<exBrPoolModel>().config_money_list[money_index]);
|
||||
|
||||
var makeupTaskData = PreferencesMgr.Instance.MakeupTaskHistory.Last();
|
||||
var vo = ConfigSystem.GetConfig<MakeupModel>().GetData(makeupTaskData.tableId);
|
||||
|
||||
|
||||
ui.com_cash.btn_cash.SetClick(() =>
|
||||
{
|
||||
if (!GameHelper.GetCloseResult()) return;
|
||||
|
||||
ui.com_cash.btn_cash.SetClick(() => { });
|
||||
ui.btn_claim.SetClick(() => { });
|
||||
ui.btn_mult.SetClick(() => { });
|
||||
if (IsWin)
|
||||
{
|
||||
DOVirtual.DelayedCall(2f, () =>
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MakeupConfirmUI_Open, makeupTaskData);
|
||||
GameHelper.addInterAdnumber();
|
||||
|
||||
});
|
||||
GetReward(cash_number);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.RefreshMakeupData);
|
||||
}
|
||||
else
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MakeupConfirmUI_Open, makeupTaskData);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Close);
|
||||
}
|
||||
});
|
||||
|
||||
ui.top_money.GetChild("btn_cashout").SetClick(() =>
|
||||
{
|
||||
ui.com_cash.btn_cash.FireClick(false, true);
|
||||
});
|
||||
|
||||
if (GameHelper.GetLevel() <= vo.levels_need)
|
||||
{
|
||||
ui.com_cash.cash_text.text = "Withdrawals can be made through level " + vo.levels_need;
|
||||
ui.com_cash.progress.width = 632f * (GameHelper.GetLevel() - 1) / vo.levels_need;
|
||||
ui.com_cash.progress_text.text = (GameHelper.GetLevel() - 1) + "/" + vo.levels_need;
|
||||
}
|
||||
else if ((float)PreferencesMgr.Instance.Currency102 < vo.item_need)
|
||||
{
|
||||
ui.com_cash.cash_text.text = "Collect " + GameHelper.Get102Str(vo.item_need) + " to cash out";
|
||||
if ((float)PreferencesMgr.Instance.Currency102 > vo.item_need)
|
||||
{
|
||||
ui.com_cash.progress.width = 632;
|
||||
ui.com_cash.progress_text.text = GameHelper.Get102Str(vo.item_need) + "/" + GameHelper.Get102Str(vo.item_need);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.com_cash.progress.width = 632 * ((float)PreferencesMgr.Instance.Currency102 / vo.item_need);
|
||||
ui.com_cash.progress_text.text = GameHelper.Get102Str(PreferencesMgr.Instance.Currency102) + "/" + GameHelper.Get102Str(vo.item_need);
|
||||
}
|
||||
|
||||
// Debug.Log((float)PreferencesMgr.Instance.Currency102);
|
||||
}
|
||||
else if ((float)PreferencesMgr.Instance.MakeupTaskH5Time < vo.task_need)
|
||||
{
|
||||
ui.com_cash.cash_text.text = "Cumulataive " + (vo.task_need / 60) + @" minutes in ""Hall"" to cash out";
|
||||
if ((float)PreferencesMgr.Instance.MakeupTaskH5Time > vo.task_need)
|
||||
{
|
||||
ui.com_cash.progress.width = 632;
|
||||
ui.com_cash.progress_text.text = (vo.task_need / 60) + "/" + (vo.task_need / 60);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.com_cash.progress.width = 632 * ((float)PreferencesMgr.Instance.MakeupTaskH5Time / vo.task_need);
|
||||
ui.com_cash.progress_text.text = Math.Round(((float)(PreferencesMgr.Instance.MakeupTaskH5Time / 60)), 2) + "/" + (vo.task_need / 60);
|
||||
}
|
||||
|
||||
}
|
||||
else if (makeupTaskData.videoCount < vo.ad_need)
|
||||
{
|
||||
|
||||
ui.com_cash.cash_text.text = "Watch " + vo.ad_need + " Reward Ads to cash out";
|
||||
if (makeupTaskData.videoCount > vo.ad_need)
|
||||
{
|
||||
ui.com_cash.progress.width = 632;
|
||||
ui.com_cash.progress_text.text = vo.ad_need + "/" + vo.ad_need;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.com_cash.progress.width = 632 * ((float)makeupTaskData.videoCount / vo.ad_need);
|
||||
ui.com_cash.progress_text.text = makeupTaskData.videoCount + "/" + vo.ad_need;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.com_cash.cash_text.text = "Watch " + vo.ad_need + " Reward Ads to cash out";
|
||||
if (makeupTaskData.videoCount > vo.ad_need)
|
||||
{
|
||||
ui.com_cash.progress.width = 632;
|
||||
ui.com_cash.progress_text.text = vo.ad_need + "/" + vo.ad_need;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.com_cash.progress.width = 632 * ((float)makeupTaskData.videoCount / vo.ad_need);
|
||||
ui.com_cash.progress_text.text = makeupTaskData.videoCount + "/" + vo.ad_need;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
ui.text_award.text = AwardGoldNum.ToString();
|
||||
ui.btn_gold.GetChild("text_gold").text = $"{PreferencesMgr.Instance.Currency101:N0}";
|
||||
|
||||
ui.btn_mult.SetClick(() =>
|
||||
{
|
||||
if (!GameHelper.GetCloseResult()) return;
|
||||
|
||||
GameHelper.ShowVideoAd("reward_lobby", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
|
||||
{
|
||||
ui.btn_claim.SetClick(() => { });
|
||||
ui.btn_mult.SetClick(() => { });
|
||||
|
||||
GetReward(AwardGoldNum * AwardRate, 101);
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
}
|
||||
});
|
||||
});
|
||||
ui.btn_claim.SetClick(() =>
|
||||
{
|
||||
if (!GameHelper.GetCloseResult()) return;
|
||||
|
||||
ui.btn_claim.SetClick(() => { });
|
||||
ui.btn_mult.SetClick(() => { });
|
||||
|
||||
GetReward(AwardGoldNum, 101);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void GetReward(float awardNum, int id = 102)
|
||||
{
|
||||
var startObj = id == 102 ? ui.btn_mult : ui.btn_claim;
|
||||
var endObj = id == 102 ? ui.top_money : ui.btn_gold;
|
||||
|
||||
var pos = GameHelper.GetUICenterPosition(endObj);
|
||||
|
||||
var rewardData = new RewardData();
|
||||
var rewardSingleData = new RewardSingleData(id, (decimal)awardNum, RewardOrigin.Play)
|
||||
{
|
||||
startPosition = GameHelper.GetUICenterPosition(startObj),
|
||||
endPosition = new Vector2(pos.x - 260, pos.y - 136)
|
||||
};
|
||||
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
rewardData.displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
|
||||
rewardData.AddCompleted(success =>
|
||||
{
|
||||
if (success)
|
||||
{
|
||||
RefreshAwardNum((decimal)awardNum, id);
|
||||
|
||||
DOVirtual.DelayedCall(1.5f, () =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
});
|
||||
}
|
||||
});
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
}
|
||||
|
||||
private void RefreshAwardNum(decimal num = -1, int id = 102)
|
||||
{
|
||||
if (num < 0)
|
||||
{
|
||||
num = id == 102 ? PreferencesMgr.Instance.Currency102 : PreferencesMgr.Instance.Currency101;
|
||||
}
|
||||
var btnCoin = ui.btn_gold as com_gold;
|
||||
var money = ui.top_money as com_money;
|
||||
|
||||
GTextField gTextField = id == 102 ? money.number_text : btnCoin.text_gold;
|
||||
CommonHelper.ShowNumAnim(gTextField, num, id);
|
||||
}
|
||||
|
||||
private int time_count = 0;
|
||||
|
||||
void timeEvent()
|
||||
{
|
||||
time_count++;
|
||||
|
||||
if (time_count > 3)
|
||||
{
|
||||
time_count = 0;
|
||||
ui.com_cash.broad.t0.Play(() =>
|
||||
{
|
||||
var name_index = UnityEngine.Random.Range(0, ConfigSystem.GetConfig<exBrPoolModel>().config_name_list.Count);
|
||||
var money_index = UnityEngine.Random.Range(0, ConfigSystem.GetConfig<exBrPoolModel>().config_money_list.Count);
|
||||
|
||||
|
||||
|
||||
|
||||
System.DateTime oldtime = System.DateTime.Now.AddSeconds(-UnityEngine.Random.Range(1 * 3600, 2 * 3600));
|
||||
ui.com_cash.broad.cast_text.text = string.Format("Congratulations, [color=#e3a13a]{0}[/color] withdraw [color=#83c93c]{1} [/color]dollars ", ConfigSystem.GetConfig<exBrPoolModel>().config_name_list[name_index],
|
||||
ConfigSystem.GetConfig<exBrPoolModel>().config_money_list[money_index]);
|
||||
//, oldtime.Hour + ":" + (oldtime.Minute > 10 ? oldtime.Minute : "0" + oldtime.Minute)
|
||||
ui.com_cash.broad.t1.Play();
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd55f74e693624c269d3d70e211b2e6a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,83 @@
|
||||
using DG.Tweening;
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GameResultUICtrl : BaseUICtrl
|
||||
{
|
||||
private GameResultUI ui;
|
||||
private GameResultModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.LevelSuccessUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.LevelSuccessUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.GameResultModel) as GameResultModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
private object m_data = null;
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new GameResultUI(this);
|
||||
ui.Open(args);
|
||||
} else {
|
||||
m_data ??= args;
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
ui = null;
|
||||
|
||||
if (m_data != null) {
|
||||
DOVirtual.DelayedCall(0.2f, ()=>{
|
||||
OpenUI(m_data);
|
||||
m_data = 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: 8e11350d8494e4786a5913ed38689cbc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3d4c902793000af4d9f134414c660f48
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GetTaskRewardCtrl : BaseCtrl
|
||||
{
|
||||
public static GetTaskRewardCtrl Instance { get; private set; }
|
||||
|
||||
private GetTaskRewardModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.GetTaskRewardModel) as GetTaskRewardModel;
|
||||
}
|
||||
|
||||
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: 87ee97ded9a294cd39e08c80f08dd72d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GetTaskRewardModel : 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: 4ecff54cb7d2546328d5e92f9f89abad
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,112 @@
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
using Spine.Unity;
|
||||
using System;
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GetTaskRewardUI : BaseUI
|
||||
{
|
||||
private GetTaskRewardUICtrl ctrl;
|
||||
private GetTaskRewardModel model;
|
||||
private FGUI.ZM_Tasks_13.com_task_reward ui;
|
||||
|
||||
public GetTaskRewardUI(GetTaskRewardUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.GetTaskRewardUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Tasks_13";
|
||||
uiInfo.assetName = "com_task_reward";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.GetTaskRewardModel) as GetTaskRewardModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
closeCallback?.Invoke();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Tasks_13.com_task_reward;
|
||||
}
|
||||
private Action closeCallback;
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(baseUI.GetChild("bg_parent") as GGraph, Fx_Type.fx_win, ref closeCallback);
|
||||
sk.state.SetAnimation(0, "out", true);
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) (ui.btn_mult.GetChild("img_saveingpot") as GImage).visible = true;
|
||||
InitView();
|
||||
// Debug.Log(args);
|
||||
int number = (int)args;
|
||||
ui.text_award.text = number.ToString();
|
||||
ui.btn_claim.SetClick(() =>
|
||||
{
|
||||
GameHelper.addInterAdnumber();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetTaskReward, false);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.GetTaskRewardUI_Close);
|
||||
});
|
||||
ui.btn_mult.SetClick(() =>
|
||||
{
|
||||
GameHelper.ShowVideoAd("reward_lobby", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetTaskReward, true);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.GetTaskRewardUI_Close);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
if (AudioManager.Instance.IsOpenEffect)
|
||||
{
|
||||
AudioManager.Instance.PlayDynamicEffect(AudioConst.Victoriously);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 68d77870ef81f4afaabf33d1c0470495
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,71 @@
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class GetTaskRewardUICtrl : BaseUICtrl
|
||||
{
|
||||
private GetTaskRewardUI ui;
|
||||
private GetTaskRewardModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.GetTaskRewardUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.GetTaskRewardUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.GetTaskRewardModel) as GetTaskRewardModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new GetTaskRewardUI(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: 89cba9dc9d404422291d75698d7fcb60
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
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