提交项目
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class H5Ctrl : BaseCtrl
|
||||
{
|
||||
public static H5Ctrl Instance { get; private set; }
|
||||
|
||||
private H5Model 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,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 43cf0cd292124f14186365ccfd627260
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class H5Model : BaseModel
|
||||
{
|
||||
public decimal show102;
|
||||
|
||||
#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: 46ac5145624b7c547b6b99f003bfe1bb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,555 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using FutureCore;
|
||||
using FairyGUI;
|
||||
using FGUI.ZM_H5_15;
|
||||
using DG.Tweening;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using IgnoreOPS;
|
||||
// using IgnoreOPS;
|
||||
namespace ZooMatch
|
||||
{
|
||||
public class H5UI : BaseUI
|
||||
{
|
||||
private H5UICtrl ctrl;
|
||||
private H5Model model;
|
||||
public FGUI.ZM_H5_15.com_webview ui;
|
||||
|
||||
private Action closeCallBack;
|
||||
|
||||
public H5UI(H5UICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.H5UI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
bool isScrolling;
|
||||
|
||||
|
||||
private bool isTimeOut = false;
|
||||
|
||||
|
||||
private decimal scrollOutTime;
|
||||
|
||||
|
||||
private bool isLoadFinish;
|
||||
|
||||
|
||||
private bool isCurrentTaskFinish;
|
||||
|
||||
|
||||
private bool isCurrentTimeTask;
|
||||
|
||||
|
||||
private bool isAddFinger;
|
||||
|
||||
private long openTime;
|
||||
|
||||
private int iconClickCount;
|
||||
|
||||
private int flyClickCount;
|
||||
|
||||
private int flyNeedClickCount = 0;
|
||||
|
||||
private int currentTabIndex;
|
||||
|
||||
private decimal makeupTaskH5NeedTime;
|
||||
|
||||
|
||||
private Tween bubbleMoveTween;
|
||||
|
||||
private List<Vector3> movePointList = new List<Vector3>();
|
||||
//private CountDownKit countDownKit;
|
||||
private int sendH5point = 0;
|
||||
private SaveingPotClass saveing_makeupTaskData;
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_H5_15";
|
||||
uiInfo.assetName = "com_webview";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
uiInfo.isTickUpdate = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.H5Model) as H5Model;
|
||||
}
|
||||
public Tween delayedCall;
|
||||
protected override void OnClose()
|
||||
{
|
||||
|
||||
//WebThroughUtil.WebThroughDisable(H5WebThroughType.OnlineH5, ui.btn_icon);
|
||||
//HallManager.Instance.SetInH5(false);
|
||||
// StopFly();
|
||||
// countDownKit?.OnDestroy();
|
||||
|
||||
OnStatisticH5Time();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.showBroadCast);
|
||||
|
||||
delayedCall.Kill();
|
||||
WebviewManager.Instance.setInH5View(false);
|
||||
WebviewManager.Instance.ShowH5View(false);
|
||||
if (GameHelper.is_first_login)
|
||||
{
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RainPlayUI_Open, true);
|
||||
GameHelper.is_first_login = false;
|
||||
}
|
||||
}
|
||||
private void OnStatisticH5Time()
|
||||
{
|
||||
var time = GameHelper.GetNowTime() - openTime;
|
||||
PreferencesMgr.Instance.H5StayTime += (int)time;
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_H5_15.com_webview;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
saveing_makeupTaskData = SaveData.GetSaveobject().saveingpot_history[SaveData.GetSaveobject().saveingpot_history.Count - 1];
|
||||
if (Screen.safeArea.y != 0)
|
||||
{//刘海屏
|
||||
// ui.com_top.y += Screen.safeArea.y;
|
||||
// ui.btn_out.y += Screen.safeArea.y;
|
||||
// ui.btn_close.y += Screen.safeArea.y;
|
||||
}
|
||||
if (!GameHelper.IsGiftSwitch() && GameHelper.GetCommonModel().WVswitch == 1)
|
||||
{
|
||||
ui.com_top.conect.visible = false;
|
||||
ui.btn_out.visible = false;
|
||||
}
|
||||
|
||||
WebviewManager.Instance.setInH5View(true);
|
||||
// delayedCall = DOVirtual.DelayedCall(0.3f, () =>
|
||||
// {
|
||||
WebviewManager.Instance.ShowH5View(true);
|
||||
// });
|
||||
InitData();
|
||||
InitView();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.hideBroadCast);
|
||||
// if (!GameHelper.IsGiftSwitch())
|
||||
// {
|
||||
// ui.com_top.visible = ui.btn_out.visible = false;
|
||||
// }
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
openTime = GameHelper.GetNowTime();
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
//UICtrlDispatcher.Instance.AddListener(SkinInfo.MakeupConfirmUI_Close, SetMakeup);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.RefreshMakeupData, SetMakeup);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.resetH5progress, resetTime);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.Update102, SetMakeup);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
//UICtrlDispatcher.Instance.RemoveListener(UICtrlMsg.MakeupConfirmUI_Close, SetMakeup);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.RefreshMakeupData, SetMakeup);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.resetH5progress, resetTime);
|
||||
GameDispatcher.Instance.RemoveListener(GameMsg.Update102, SetMakeup);
|
||||
}
|
||||
#endregion
|
||||
void resetTime(object a = null)
|
||||
{
|
||||
iconTime = 0;
|
||||
}
|
||||
decimal iconTime = 0;
|
||||
private decimal updateTime;
|
||||
public override void OnUpdate()
|
||||
{
|
||||
if (iconTime < ConfigSystem.GetConfig<CommonModel>().ThroughRewardCD)
|
||||
{
|
||||
iconTime += (decimal)Time.deltaTime;
|
||||
UpdateIcon();
|
||||
}
|
||||
CheckShowFly();
|
||||
|
||||
updateTime += (decimal)Time.deltaTime;
|
||||
|
||||
// if (makeupTaskH5NeedTime > 0 && PreferencesMgr.Instance.MakeupTaskH5Time < makeupTaskH5NeedTime)
|
||||
// {
|
||||
if (updateTime >= 1)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
updateTime = 600;
|
||||
#endif
|
||||
if (PreferencesMgr.Instance.MakeupTaskH5Time > 60 &&
|
||||
((PreferencesMgr.Instance.MakeupTaskH5Time % 60) < 1))
|
||||
{
|
||||
// NetworkKit.BuriedPoint(BuriedPointEvent.h5_event, BuriedPointEvent.h5_event_time, 60);
|
||||
}
|
||||
|
||||
if (sendH5point == 1)
|
||||
{
|
||||
PlayerPrefs.SetInt("sendH5point", 0);
|
||||
sendH5point = 0;
|
||||
}
|
||||
PreferencesMgr.Instance.MakeupTaskH5Time += updateTime;
|
||||
// Debug.Log(PreferencesMgr.Instance.MakeupTaskH5Time);
|
||||
|
||||
if (saveing_makeupTaskData.status == SaveingPotTaskStatus.None)
|
||||
{
|
||||
if (PreferencesMgr.Instance.ExchangeAccount != null)
|
||||
{
|
||||
saveing_makeupTaskData.H5Time += (float)updateTime;
|
||||
}
|
||||
|
||||
}
|
||||
updateTime = 0;
|
||||
}
|
||||
// }
|
||||
// else if (makeupTaskH5NeedTime > 0 && PreferencesMgr.Instance.MakeupTaskH5Time >= makeupTaskH5NeedTime)
|
||||
// {
|
||||
// if (sendH5point == 0)
|
||||
// {
|
||||
// NetworkKit.BuriedPoint(BuriedPointEvent.h5_event, BuriedPointEvent.h5_event_numbers, 1);
|
||||
// sendH5point = 1;
|
||||
// PlayerPrefs.SetInt("sendH5point", 1);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
//初始化页面逻辑
|
||||
private void InitData()
|
||||
{
|
||||
|
||||
// model.show101 = PreferencesMgr.Instance.Currency101;
|
||||
flyNeedClickCount = UnityEngine.Random.Range(ConfigSystem.GetConfig<CommonModel>().flyAdTime[0],
|
||||
ConfigSystem.GetConfig<CommonModel>().flyAdTime[1] + 1);
|
||||
//flyNeedClickCount = 5;
|
||||
|
||||
// if (PreferencesMgr.Instance.MakeupTaskHistory.Count > 0)
|
||||
// {
|
||||
// var taskData = PreferencesMgr.Instance.MakeupTaskHistory.Last();
|
||||
// if (taskData != null)
|
||||
// {
|
||||
// Makeup makeupVo = null;
|
||||
// foreach (var makeup in ConfigSystem.GetConfig<MakeupModel>().dataList)
|
||||
// {
|
||||
// if (makeup.id == taskData.tableId)
|
||||
// {
|
||||
// makeupVo = makeup;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
|
||||
// makeupTaskH5NeedTime = makeupVo.task_need;
|
||||
// }
|
||||
// }
|
||||
|
||||
sendH5point = PlayerPrefs.GetInt("sendH5point", 0);
|
||||
|
||||
|
||||
#if UNITY_EDITOR
|
||||
isLoadFinish = true;
|
||||
#endif
|
||||
}
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// InitIcon();
|
||||
// CheckShowFly();
|
||||
// ui.com_fly.SetClick(OnClickFlyCash);
|
||||
// #endif
|
||||
// SetMakeup();
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
CtrlCloseUI();
|
||||
});
|
||||
|
||||
SetMakeup();
|
||||
WebviewManager.Instance.ShowFlyBtn(true);
|
||||
UpdateIcon();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void UpdateIcon()
|
||||
{
|
||||
float amount = (float)iconTime / ConfigSystem.GetConfig<CommonModel>().ThroughRewardCD;
|
||||
|
||||
|
||||
WebviewManager.Instance.SetIconProgress(amount);
|
||||
// if (iconTime >= ConfigSystem.GetConfig<CommonModel>().ThroughRewardCD)
|
||||
// {
|
||||
// if (!ui.btn_icon.fx_ready.playing)
|
||||
// {
|
||||
// ui.btn_icon.fx_ready.Play();
|
||||
// }
|
||||
|
||||
// ui.btn_icon.cont_state.selectedIndex = btn_icon.State_ready;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ui.btn_icon.fx_ready.Stop();
|
||||
// }
|
||||
}
|
||||
private void OnClickIcon()
|
||||
{
|
||||
//WebThroughUtil.WebThroughClick(H5WebThroughType.OnlineH5, ui.btn_icon);
|
||||
if (iconTime < ConfigSystem.GetConfig<CommonModel>().ThroughRewardCD)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
WebviewManager.Instance.ShowH5View(false);
|
||||
#endif
|
||||
|
||||
float[] cash_array = GameHelper.GetRewardValue(2);
|
||||
|
||||
// var temp = new { is_success = true, cash_number = cash_array[0], rate = cash_array[1], is_level_success = false, is_h5_reward = true };
|
||||
SuccessData temp = new SuccessData();
|
||||
temp.IsWin = true;
|
||||
temp.cash_number = cash_array[0];
|
||||
temp.rate = (int)cash_array[1];
|
||||
temp.IsLevelSuccess = false;
|
||||
temp.IsH5Reward = true;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LevelSuccessUI_Open, temp);
|
||||
|
||||
//UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RewardUI_Open);
|
||||
// var rewardData = new RewardData();
|
||||
|
||||
// var rewardType = 111;
|
||||
// decimal rewardValue = (decimal)GameHelper.GetRewardValue(3)[0];
|
||||
|
||||
// var rewardSingleData = new RewardSingleData(rewardType, rewardValue, RewardOrigin.H5Icon)
|
||||
// {
|
||||
// startPosition = GameHelper.GetUICenterPosition(ui.btn_icon),
|
||||
// endPosition = GameHelper.GetUICenterPosition(ui.com_top.text_num)
|
||||
// };
|
||||
// rewardData.AddReward(rewardSingleData);
|
||||
// rewardData.AddCompleted(isSuccess =>
|
||||
// {
|
||||
// ui.btn_icon.cont_state.selectedIndex = btn_icon.State_none;
|
||||
// iconTime = 0;
|
||||
// SetMakeup();
|
||||
// });
|
||||
// rewardData.condition = RewardCondition.AD;
|
||||
// rewardData.displayType =
|
||||
// RewardDisplayType.Dialog | RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
|
||||
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
|
||||
// GameHelper.addMoney((float)rewardValue);
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.RefreshMakeupData);
|
||||
|
||||
|
||||
iconTime = 0;
|
||||
// SetMakeup();
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior, BuriedPointEvent.annular_get_number, 1);
|
||||
}
|
||||
|
||||
private void CheckShowFly()
|
||||
{
|
||||
var nowTime = GameHelper.GetNowTime();
|
||||
var leftTime = (int)(PreferencesMgr.Instance.AdCashFlyShowTime - nowTime);
|
||||
|
||||
ui.com_fly.visible = false;
|
||||
ui.com_fly.visible = leftTime <= 0;
|
||||
if (leftTime > 0)
|
||||
{
|
||||
WebviewManager.Instance.ShowFlyBtn(false);
|
||||
isFlyShow = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//StartFly();
|
||||
if (!isFlyShow) WebviewManager.Instance.ShowFlyBtn(true);
|
||||
isFlyShow = true;
|
||||
|
||||
}
|
||||
}
|
||||
private bool isFlyShow = false;
|
||||
private void StartFly()
|
||||
{
|
||||
|
||||
|
||||
var bubbleGo = ui.com_fly.displayObject.gameObject;
|
||||
bubbleMoveTween = bubbleGo.transform
|
||||
.DOLocalPath(movePointList.ToArray(), 10)
|
||||
.SetEase(Ease.Linear)
|
||||
.OnComplete(StartFly)
|
||||
.SetAutoKill(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void OnClickFlyCash()
|
||||
{
|
||||
PreferencesMgr.Instance.AdCashFlyShowTime =
|
||||
GameHelper.GetNowTime() + ConfigSystem.GetConfig<CommonModel>().flyCD;
|
||||
var rewardData = new RewardData();
|
||||
|
||||
var singleValue =
|
||||
(decimal)Math.Round(
|
||||
UnityEngine.Random.Range(ConfigSystem.GetConfig<CommonModel>().flyReward[0],
|
||||
ConfigSystem.GetConfig<CommonModel>().flyReward[1]), 2);
|
||||
|
||||
|
||||
decimal rewardValue;
|
||||
|
||||
|
||||
if (flyClickCount >= flyNeedClickCount)
|
||||
{
|
||||
flyClickCount = -1;
|
||||
//var rate = GameHelper.GetVideoRate();
|
||||
rewardValue = singleValue;
|
||||
GameHelper.ShowVideoAd("reward_fly", isCompleted =>
|
||||
{
|
||||
if (isCompleted)
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.RefreshMakeupData);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
rewardValue = singleValue;
|
||||
}
|
||||
|
||||
var startPosition = GameHelper.GetUICenterPosition(ui.com_fly);
|
||||
var endPosition = GameHelper.GetUICenterPosition(ui.com_top.text_num);
|
||||
|
||||
var rewardSingleData = new RewardSingleData(102, rewardValue, RewardOrigin.H5Fly101)
|
||||
{
|
||||
startPosition = startPosition,
|
||||
endPosition = new Vector2(endPosition.x - 150, endPosition.y - 106)
|
||||
};
|
||||
|
||||
rewardData.AddReward(rewardSingleData);
|
||||
rewardData.displayType = RewardDisplayType.RewardFly | RewardDisplayType.ValueChange;
|
||||
rewardData.AddCompleted(isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
flyClickCount++;
|
||||
}
|
||||
|
||||
SetMakeup();
|
||||
});
|
||||
//GameHelper.addMoney((float)rewardValue);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.RefreshMakeupData);
|
||||
CheckShowFly();
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Set101(decimal cash = -1)
|
||||
{
|
||||
// if (cash < 0)
|
||||
// {
|
||||
// cash = PreferencesMgr.Instance.Currency102;
|
||||
// }
|
||||
|
||||
// ui.com_top.text_num.text = "$"+ PreferencesMgr.Instance.Currency102;
|
||||
}
|
||||
|
||||
public void OnLoadFinish()
|
||||
{
|
||||
isLoadFinish = true;
|
||||
}
|
||||
|
||||
public void OnLoadH5Progress(int progress)
|
||||
{
|
||||
}
|
||||
|
||||
private void SetMakeup(object a = null)
|
||||
{
|
||||
var com_box = ui.com_top;
|
||||
|
||||
com_box.text_num.text = GameHelper.Get102Str(PreferencesMgr.Instance.Currency102);
|
||||
|
||||
DOVirtual.Float(0, (float)PreferencesMgr.Instance.Currency102, 1,
|
||||
value => { com_box.text_num.text = GameHelper.Get102Str((decimal)value); });
|
||||
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
if (PreferencesMgr.Instance.MakeupTaskHistory.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var makeupTaskData = PreferencesMgr.Instance.MakeupTaskHistory.Last();
|
||||
var vo = ConfigSystem.GetConfig<MakeupModel>().GetData(makeupTaskData.tableId);
|
||||
if (vo == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var leftCash = (double)Math.Max(vo.item_need - PreferencesMgr.Instance.Currency102, 0);
|
||||
com_box.text_more.SetVar("money", GameHelper.Get102Str((decimal)leftCash)).FlushVars();
|
||||
com_box.pb_num.max = vo.item_need;
|
||||
com_box.pb_num.TweenValue(vo.item_need - leftCash, 0.1f);
|
||||
var value = Math.Min((double)PreferencesMgr.Instance.Currency102, com_box.pb_num.max);
|
||||
var pbTxt = com_box.pb_num.GetChild("title");
|
||||
pbTxt.text =
|
||||
$"{GameHelper.Get102Str((decimal)value)}/{GameHelper.Get102Str((decimal)com_box.pb_num.max)}";
|
||||
|
||||
ui.btn_out.SetClick(() =>
|
||||
{
|
||||
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
WebviewManager.Instance.ShowH5View(false);
|
||||
#endif
|
||||
// if (GameHelper.CanGuide() && !GuideCtrl.Instance.IsFinishGuide(1))
|
||||
// {
|
||||
// GuideCtrl.Instance.Dispatch("ClickButton");
|
||||
// }
|
||||
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.MakeupConfirmUI_Open, makeupTaskData);
|
||||
|
||||
// MainTabUI.getIns().OnGameTab(0);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void ClickBtn(string name)
|
||||
{
|
||||
// // Debug.Log("[UNITY] Click btn: " + name);
|
||||
// FGUIHelper.PlayClickSound();
|
||||
if (name == "flyBtn")
|
||||
{
|
||||
OnClickFlyCash();
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior, BuriedPointEvent.collect_fly_number, 1);
|
||||
//NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior,BuriedPointEvent.collect_fly_people,1);
|
||||
}
|
||||
else if (name == "rewardBtn")
|
||||
{
|
||||
OnClickIcon();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ad24594c8d4ef004b80ba1dc807439d3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,81 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
namespace ZooMatch
|
||||
|
||||
{
|
||||
public class H5UICtrl : BaseUICtrl
|
||||
{
|
||||
private H5UI ui;
|
||||
private H5Model model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.H5UI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.H5UI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.H5Model) as H5Model;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new H5UI(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);
|
||||
gameDispatcher.AddListener(GameMsg.H5ViewClickBtn, OnH5ClickBtn);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
gameDispatcher.RemoveListener(GameMsg.H5ViewClickBtn, OnH5ClickBtn);
|
||||
}
|
||||
void OnH5ClickBtn(object arg)
|
||||
{
|
||||
ui?.ClickBtn((string)arg);
|
||||
}
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3dedf5472daa9b148aa10e439406185b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user