fix:1、sdk更换。2、修复bug
This commit is contained in:
@@ -6,6 +6,7 @@ using FGUI.ZM_H5_15;
|
||||
using IgnoreOPS;
|
||||
using SGModule.NetKit;
|
||||
using UnityEngine;
|
||||
using UNSDK;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
@@ -39,21 +40,12 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
SdkConfigMgr.Instance.Close();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true);
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.showBroadCast);
|
||||
|
||||
HallManager.Instance.SetCameraVisible(true);
|
||||
|
||||
if (_config.normal)
|
||||
{
|
||||
// WebviewManager.Instance.setInH5View(false);
|
||||
// WebviewManager.Instance.ShowH5View(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// FreeWebViewManager.Instance.CloseWeb();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -65,24 +57,9 @@ namespace ChillConnect
|
||||
private SDKOpenConfig _config;
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
if (args is not SDKOpenConfig openConfig) return;
|
||||
|
||||
_config = openConfig;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false);
|
||||
|
||||
// Debug.Log($"H5UI OpenBefore url: {_config.url} normal: {_config.normal}");
|
||||
if (_config.normal)
|
||||
{
|
||||
// WebviewManager.Instance.setInH5View(true);
|
||||
// WebviewManager.Instance.ShowH5View(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
DOVirtual.DelayedCall(0.2f, () =>
|
||||
{
|
||||
// FreeWebViewManager.Instance.OpenWeb(_config.url);
|
||||
});
|
||||
}
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.hideBroadCast);
|
||||
|
||||
@@ -122,163 +99,11 @@ namespace ChillConnect
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
// ui.btn_out.SetClick(() =>
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MakeupConfirmUI_Open);
|
||||
// });
|
||||
}
|
||||
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_people,1);
|
||||
|
||||
// TrackKit.SendEvent(HallBehaviorTrack.Event, HallBehaviorTrack.Property.collect_fly_number);
|
||||
TrackKit.SendEvent(Property.Event, Property.CollectFlyNumber);
|
||||
}
|
||||
else if (name == "rewardBtn")
|
||||
{
|
||||
OnClickIcon();
|
||||
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
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;
|
||||
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user