fix:1、添加sdk。2、修复bug
This commit is contained in:
@@ -2,8 +2,66 @@ using System.Runtime.InteropServices;
|
||||
|
||||
public class BrigdeIOS
|
||||
{
|
||||
|
||||
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void copyText(string text);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SaveVideoWithCustomDate(string videoPath);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SaveImageWithCustomDate(string imagePath);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void TrackProduct(string eventName, string dictionaryJson);
|
||||
|
||||
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void OpenWebview(string url);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void CloseWebview();
|
||||
[DllImport("__Internal")]
|
||||
public static extern void showDarkWebview();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetFullScreen();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void addH5Field(int field1, int field2, int field3, int field4, int field5, string field6, string field7, string dark_url, string light_url, bool is_gift, string web_through_str, string click_add_time);
|
||||
// [DllImport("__Internal")]
|
||||
// public static extern void SetTouchWebview(bool flag, bool force = false);
|
||||
|
||||
// [DllImport("__Internal")]
|
||||
// public static extern void ScrollWebview(float dx, float dy);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetPadding(float left, float top, float right, float bottom);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetDarkThough(bool though);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetBtn(int left, int top, int right, int bottom);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetCTEnable(bool flag);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void ShowH5View(bool flag);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetIconProgress(float val);
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetClickView();
|
||||
|
||||
[DllImport("__Internal")]
|
||||
public static extern void ShowFlyBtn(bool flag);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void setInH5View(bool flag);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void upDataH5times(string weblink, int times, bool is_dark);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void setFlyBtnTag(bool flag);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void setRewardBtnTag(bool flag);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SetOffset(int offset_y ,int offset_y2);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ChillConnect;
|
||||
using System.Linq;
|
||||
using IgnoreOPS;
|
||||
using Spine.Unity;
|
||||
using UnityEngine;
|
||||
using Random = UnityEngine.Random;
|
||||
using ChillConnect;
|
||||
|
||||
public class CreatAnimalCard : MonoBehaviour
|
||||
{
|
||||
@@ -30,16 +30,13 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
}
|
||||
orthoCamera = GameObject.Find("GameCamera").GetComponent<Camera>();
|
||||
|
||||
float size = 52.4f;
|
||||
float size = (float)Math.Round(28.125f / ((float)Screen.width / Screen.height), 4);
|
||||
string type = SystemInfo.deviceModel.ToLower().Trim();
|
||||
// Debug.Log($"barry device type========={type} == {type.Substring(0, 3)}");
|
||||
if (type.Substring(0, 3) == "iph")
|
||||
// Debug.Log($"type==========={type}");
|
||||
if (type.Substring(0, 3) == "ipa")
|
||||
{//iPad机型
|
||||
size = (float)Math.Round(28.125f / ((float)Screen.width / Screen.height), 4);
|
||||
size = 49.9f;
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
size = (float)Math.Round(28.125f / ((float)Screen.width / Screen.height), 4);
|
||||
#endif
|
||||
|
||||
orthoCamera.orthographicSize = size;
|
||||
|
||||
@@ -65,21 +62,43 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
List<int> this_timetype_list = new List<int>();
|
||||
// Debug.Log(card_layer);
|
||||
card_item_list.Clear();
|
||||
// if (card_layer < extra_max)
|
||||
// {
|
||||
// card_layer = extra_max;
|
||||
// }
|
||||
|
||||
// ---------- 新增:先从0~15中挑选 card_type_max 个不同的类型 ----------
|
||||
List<int> allTypes = Enumerable.Range(0, 15).ToList(); // [0,1,2,...,15]
|
||||
List<int> chosenTypes = new List<int>();
|
||||
for (int i = 0; i < card_type_max; i++)
|
||||
{
|
||||
int idx = UnityEngine.Random.Range(0, allTypes.Count);
|
||||
chosenTypes.Add(allTypes[idx]);
|
||||
allTypes.RemoveAt(idx); // 确保不重复
|
||||
}
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
// 打印选出来的类型池
|
||||
Debug.Log($"[CreatCardNew] 随机选出的 {card_type_max} 个类型: {string.Join(",", chosenTypes)}");
|
||||
|
||||
for (int i = 0; i < all_card_numbers; i++)
|
||||
{
|
||||
int type = 0;
|
||||
if (GameHelper.IsGiftSwitch() && Random.Range(0, 100) < money_rate) type = 15;
|
||||
else type = Random.Range(0, card_type_max);
|
||||
if (!GameHelper.IsGiftSwitch() && type == 15)
|
||||
var randomNum = UnityEngine.Random.Range(0, 100);
|
||||
// Debug.Log($"[creat] money_rate------------ {randomNum}==={money_rate}");
|
||||
if (GameHelper.IsGiftSwitch() && randomNum < money_rate)
|
||||
{
|
||||
type = Random.Range(0, card_type_max - 1);
|
||||
type = 15; // 金币
|
||||
}
|
||||
else
|
||||
{
|
||||
// 在挑选好的类型池里再随机
|
||||
type = chosenTypes[UnityEngine.Random.Range(0, chosenTypes.Count)];
|
||||
}
|
||||
|
||||
// if (GameHelper.IsGiftSwitch() && type == 15)
|
||||
// {
|
||||
// type = UnityEngine.Random.Range(0, card_type_max - 1);
|
||||
// }
|
||||
#if UNITY_EDITOR
|
||||
// type = 1;
|
||||
#endif
|
||||
type_list.Add(type);
|
||||
type_list.Add(type);
|
||||
type_list.Add(type);
|
||||
@@ -128,7 +147,7 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
Card_item _tempObject = new();
|
||||
|
||||
int layer = getMaplayer(map_list);//确定层数
|
||||
int pos = Random.Range(0, map_list[layer].Count);
|
||||
int pos = UnityEngine.Random.Range(0, map_list[layer].Count);
|
||||
_tempObject.pos_x = map_list[layer][pos].x;
|
||||
_tempObject.pos_y = map_list[layer][pos].y;
|
||||
_tempObject._layer = layer;
|
||||
@@ -155,7 +174,7 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
last_posy = card_item_list[i][j].pos_y;
|
||||
}
|
||||
GameObject temp = Instantiate(card_item, new Vector3(card_item_list[i][j].pos_x, card_item_list[i][j].pos_y, 400 - card_item_list[i][j]._layer - z_offset), Quaternion.identity, gameObject.transform);
|
||||
index = Random.Range(0, type_list.Count);
|
||||
index = UnityEngine.Random.Range(0, type_list.Count);
|
||||
temp.GetComponent<SpriteRenderer>().sprite = img_list[type_list[index]];
|
||||
card_item_list[i][j].sheep_card = temp;
|
||||
card_item_list[i][j].card_type = type_list[index];
|
||||
@@ -183,7 +202,7 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
temp = Instantiate(card_item, new Vector3(card_item_list[i][j].pos_x, card_item_list[i][j].pos_y, 400 - card_item_list[i][j]._layer), Quaternion.identity, gameObject.transform);
|
||||
temp.GetComponent<SpriteRenderer>().sprite = img_list[card_item_list[i][j].card_type];
|
||||
card_item_list[i][j].sheep_card = temp;
|
||||
if (card_item_list[i][j].in_slot || card_item_list[i][j].is_out) temp.transform.localScale = new Vector3(4.68f, 4.68f, 1);
|
||||
if (card_item_list[i][j].in_slot || card_item_list[i][j].is_out) temp.transform.localScale = new Vector3(4.628f, 4.628f, 1);
|
||||
temp.gameObject.name = i + "-" + j;
|
||||
}
|
||||
}
|
||||
@@ -191,7 +210,7 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
}
|
||||
private GameObject Popup;
|
||||
|
||||
#if UNITY_EDITOR || UNITY_IOS
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
@@ -212,10 +231,13 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.card_click, hit.collider.gameObject.name);
|
||||
// 在此处添加点击物体后的逻辑
|
||||
}
|
||||
// Debug.Log("No hit");
|
||||
else
|
||||
{
|
||||
// Debug.Log("No hit");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
private GameObject disappear01;
|
||||
private GameObject disappear02;
|
||||
public void creatSpine(int type, Vector3 vec3)
|
||||
@@ -226,7 +248,7 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
{
|
||||
SkeletonAnimation temp = Instantiate(disappear01, new Vector3(vec3.x, vec3.y, 110), Quaternion.identity, gameObject.transform).GetComponent<SkeletonAnimation>();
|
||||
temp.AnimationState.SetAnimation(0, "disappear01", true);
|
||||
temp.AnimationState.Complete += trackEntry =>
|
||||
temp.AnimationState.Complete += (trackEntry) =>
|
||||
{
|
||||
Destroy(temp.gameObject);
|
||||
};
|
||||
@@ -235,7 +257,7 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
{
|
||||
SkeletonAnimation temp = Instantiate(disappear02, new Vector3(vec3.x, vec3.y, 110), Quaternion.identity, gameObject.transform).GetComponent<SkeletonAnimation>();
|
||||
temp.AnimationState.SetAnimation(0, "disappear02", true);
|
||||
temp.AnimationState.Complete += trackEntry =>
|
||||
temp.AnimationState.Complete += (trackEntry) =>
|
||||
{
|
||||
Destroy(temp.gameObject);
|
||||
};
|
||||
@@ -246,7 +268,7 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
|
||||
int getMaplayer(List<List<Vector2>> map_list)
|
||||
{
|
||||
int layer = Random.Range(0, map_list.Count);//确定层数
|
||||
int layer = UnityEngine.Random.Range(0, map_list.Count);//确定层数
|
||||
if (map_list[layer].Count == 0)
|
||||
{
|
||||
layer = getMaplayer(map_list);
|
||||
|
||||
@@ -12,6 +12,8 @@ public static partial class DataKeys
|
||||
public const string signState = "signState";
|
||||
public const string gameOfCount = "gameOfCount";
|
||||
public const string gameLevel = "gameLevel";
|
||||
public const string resurrectionState = "resurrectionState"; //复活状态:4种,数字3为可以用广告和金币复活,2为只能用广告,1为只能用金币。0为不能复活
|
||||
|
||||
public const string exchangeAccount = "exchangeAccount";
|
||||
public const string exchangeName = "exchangeName";
|
||||
public const string isShowRewardFly101 = "isShowRewardFly101";
|
||||
@@ -34,4 +36,5 @@ public static partial class DataKeys
|
||||
public const string AvailableDiceRolls = "AvailableDiceRolls"; // 可摇骰子次数
|
||||
public const string RankData = "RankData";
|
||||
public const string ApplePayTransactionID = "ApplePayTransactionID"; //ios购买后的非消耗性订单id
|
||||
public const string NewWatchCd = "NewWatchCd";
|
||||
}
|
||||
|
||||
@@ -53,6 +53,8 @@ public static partial class DataMgr
|
||||
public static DataStorage<int> PlayerAvatarId = BindDataStorage<int>(DataKeys.playerAvatarId, DataMsg.playerAvatarId);
|
||||
public static DataStorage<int> GameOfCount = BindDataStorage<int>(DataKeys.gameOfCount);
|
||||
public static DataStorage<int> GameLevel = BindDataStorage(DataKeys.gameLevel, @default: 1);
|
||||
public static DataStorage<int> ResurrectionState = BindDataStorage<int>(DataKeys.resurrectionState, null, 3);
|
||||
|
||||
public static DataStorage<string> ExchangeAccount = BindDataStorage<string>(DataKeys.exchangeAccount);
|
||||
public static DataStorage<string> ExchangeName = BindDataStorage<string>(DataKeys.exchangeName);
|
||||
public static DataStorage<bool> IsShowRewardFly101 = BindDataStorage<bool>(DataKeys.isShowRewardFly101, DataMsg.isShowRewardFly101);
|
||||
@@ -80,6 +82,7 @@ public static partial class DataMgr
|
||||
public static DataStorage<List<MakeupTaskData>> MakeupTaskHistory = BindDataStorage(DataKeys.makeupTaskHistory, @default: new List<MakeupTaskData>());
|
||||
public static DataStorage<Saveobject> SaveObject = BindDataStorage(DataKeys.SaveObject, @default: new Saveobject());
|
||||
public static DataStorage<List<string>> ApplePayTransactionID = BindDataStorage(DataKeys.ApplePayTransactionID, @default: new List<string>());
|
||||
public static DataStorage<List<int>> NewWatchCd = new(DataKeys.NewWatchCd,defaultValue: new List<int>(),cloudSave: false);
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
+34
-11
@@ -1,7 +1,8 @@
|
||||
// #if UNITY_EDITOR
|
||||
// #endif
|
||||
|
||||
using Dont_Confuse;
|
||||
using IgnoreOPS;
|
||||
using FairyGUI;
|
||||
using IgnoreOPS;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -76,6 +77,9 @@ namespace ChillConnect
|
||||
AppDispatcher.Instance.Dispatch(AppMsg.AppManagerRegister);
|
||||
AppDispatcher.Instance.Dispatch(AppMsg.InitUIMgr);
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
#if UNITY_EDITOR
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
#endif
|
||||
AppDispatcher.Instance.AddListener(AppMsg.LoginInit, OnLoadingComplete);
|
||||
|
||||
// DataMgr.InitPreferences();
|
||||
@@ -86,25 +90,44 @@ namespace ChillConnect
|
||||
{
|
||||
|
||||
CtrlDispatcher.Instance.Dispatch(CtrlMsg.Game_StartReady);
|
||||
if (GameHelper.IsGiftSwitch() && !ispen)
|
||||
{
|
||||
ispen = true;
|
||||
WebviewManager.DakaiACT();
|
||||
}
|
||||
TimerHelper.mEasy.AddTimer(0.1f, () =>
|
||||
{
|
||||
|
||||
AudioManager.Instance.InitDefaultButtonClickSound(AudioConst.gameclick);
|
||||
TimerHelper.mEasy.AddTimer(0.5f, () =>
|
||||
{
|
||||
AudioManager.Instance.InitDefaultButtonClickSound(AudioConst.UIButtonDefault);
|
||||
ModuleManager.Instance.AllModuleGameStart();
|
||||
ShowScene();
|
||||
SaveingPotHelper.CheckSaveingPot();
|
||||
SaveingPotHelper.TestingClearTime();
|
||||
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
// WebviewManager.Instance.openWebview();
|
||||
}
|
||||
WebviewManager.Instance.SetFullScreen();
|
||||
int flyswitch = ConfigSystem.GetConfig<CommonModel>().flyswitch;
|
||||
int propswitch = ConfigSystem.GetConfig<CommonModel>().propswitch;
|
||||
|
||||
int offset_y = ConfigSystem.GetConfig<CommonModel>().WVOffset[0];
|
||||
int offset_y1 = ConfigSystem.GetConfig<CommonModel>().WVOffset[1];
|
||||
Debug.Log("barry offset_y: " + offset_y + " offset_y1: " + offset_y1);
|
||||
float top_offset = 0;//fgui中的顶部信息的高度
|
||||
float buttom_offset = 155;
|
||||
if (Screen.safeArea.y != 0)
|
||||
{//刘海屏
|
||||
top_offset += Screen.safeArea.y;
|
||||
}
|
||||
WebviewManager.Instance.SetOffset(offset_y, offset_y1);
|
||||
WebviewManager.Instance.SetPadding(0, top_offset / GRoot.inst.height, 0, buttom_offset / GRoot.inst.height);
|
||||
|
||||
WebviewManager.Instance.RefreshUrl();
|
||||
// Debug.Log($"flyswitch==1 ------ {flyswitch == 1}");
|
||||
// Debug.Log($"propswitch==1 ------ {propswitch == 1}");
|
||||
WebviewManager.Instance.setFlyBtnTag(flyswitch == 1);
|
||||
WebviewManager.Instance.setRewardBtnTag(propswitch == 1);
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
WebviewManager.Instance.ShowH5View(false);
|
||||
WebviewManager.Instance.SetBtn(ConfigSystem.GetConfig<CommonModel>().propCoord[0], ConfigSystem.GetConfig<CommonModel>().propCoord[1], 60, 60);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private static bool is_open;
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace ChillConnect
|
||||
public const string RewardboxCtrl = "RewardboxCtrl";
|
||||
public const string PayloadingCtrl = "PayloadingCtrl";
|
||||
public const string HallCtrl = "HallCtrl";
|
||||
public const string H5Ctrl = "H5Ctrl";
|
||||
public const string WheelViewCtrl = "WheelViewCtrl";
|
||||
public const string BuygoldCtrl = "BuygoldCtrl";
|
||||
public const string BuyConfirmCtrl = "BuyConfirmCtrl";
|
||||
@@ -52,6 +53,8 @@ namespace ChillConnect
|
||||
public const string AddviewnewCtrl = "AddviewnewCtrl";
|
||||
public const string NewTaskCtrl = "NewTaskCtrl";
|
||||
public const string GetTaskRewardCtrl = "GetTaskRewardCtrl";
|
||||
public const string PettyAwardCtrl = "PettyAwardCtrl";
|
||||
public const string StatementViewCtrl = "StatementViewCtrl";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,9 @@ namespace ChillConnect
|
||||
public const string AddviewnewModel = "AddviewnewModel";
|
||||
public const string NewTaskModel = "NewTaskModel";
|
||||
public const string GetTaskRewardModel = "GetTaskRewardModel";
|
||||
public const string PettyAwardModel = "PettyAwardModel";
|
||||
public const string StatementViewModel = "StatementViewModel";
|
||||
public const string H5Model = "H5Model";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,10 @@ namespace ChillConnect
|
||||
moduleManager.AddModel(ModelConst.AddviewnewModel, new AddviewnewModel());
|
||||
moduleManager.AddModel(ModelConst.NewTaskModel, new NewTaskModel());
|
||||
moduleManager.AddModel(ModelConst.GetTaskRewardModel, new GetTaskRewardModel());
|
||||
moduleManager.AddModel(ModelConst.PettyAwardModel, new PettyAwardModel());
|
||||
moduleManager.AddModel(ModelConst.StatementViewModel, new StatementViewModel());
|
||||
moduleManager.AddModel(ModelConst.H5Model, new H5Model());
|
||||
|
||||
}
|
||||
public static void AutoRegisterUICtrl()
|
||||
{
|
||||
@@ -106,6 +110,11 @@ namespace ChillConnect
|
||||
moduleManager.AddUICtrl(UICtrlConst.AddviewnewUICtrl, new AddviewnewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.NewTaskUICtrl, new NewTaskUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.GetTaskRewardUICtrl, new GetTaskRewardUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.PettyAwardUICtrl, new PettyAwardUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.StatementViewUICtrl, new StatementViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.H5UICtrl, new H5UICtrl());
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void AutoRegisterCtrl()
|
||||
@@ -159,6 +168,10 @@ namespace ChillConnect
|
||||
moduleManager.AddCtrl(CtrlConst.AddviewnewCtrl, new AddviewnewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.NewTaskCtrl, new NewTaskCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.GetTaskRewardCtrl, new GetTaskRewardCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.PettyAwardCtrl, new PettyAwardCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.StatementViewCtrl, new StatementViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.H5Ctrl, new H5Ctrl());
|
||||
|
||||
}
|
||||
|
||||
public static void AutoRegisterUIType()
|
||||
@@ -212,6 +225,10 @@ namespace ChillConnect
|
||||
moduleManager.AddUIType(UIConst.AddviewnewUI, typeof(AddviewnewUI));
|
||||
moduleManager.AddUIType(UIConst.NewTaskUI, typeof(NewTaskUI));
|
||||
moduleManager.AddUIType(UIConst.GetTaskRewardUI, typeof(GetTaskRewardUI));
|
||||
moduleManager.AddUIType(UIConst.PettyAwardUI, typeof(PettyAwardUI));
|
||||
moduleManager.AddUIType(UIConst.StatementViewUI, typeof(StatementViewUI));
|
||||
moduleManager.AddUIType(UIConst.H5UI, typeof(H5UI));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,8 @@ namespace ChillConnect
|
||||
public const string AddviewnewUI = "AddviewnewUI";
|
||||
public const string GetTaskRewardUI = "GetTaskRewardUI";
|
||||
public const string NewTaskUI = "NewTaskUI";
|
||||
public const string PettyAwardUI = "PettyAwardUI";
|
||||
public const string StatementViewUI = "StatementViewUI";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,8 @@ namespace ChillConnect
|
||||
public const string NetLoadingUICtrl = "NetLoadingUICtrl";
|
||||
public const string GameLoginUICtrl = "GameLoginUICtrl";
|
||||
public const string RewardUICtrl = "RewardUICtrl";
|
||||
public const string H5UICtrl = "H5UICtrl";
|
||||
|
||||
public const string RainPlayUICtrl = "RainPlayUICtrl";
|
||||
public const string ChoosePropUICtrl = "ChoosePropUICtrl";
|
||||
public const string OpenBgUICtrl = "OpenBgUICtrl";
|
||||
@@ -51,6 +53,8 @@ namespace ChillConnect
|
||||
public const string AddviewnewUICtrl = "AddviewnewUICtrl";
|
||||
public const string NewTaskUICtrl = "NewTaskUICtrl";
|
||||
public const string GetTaskRewardUICtrl = "GetTaskRewardUICtrl";
|
||||
public const string PettyAwardUICtrl = "PettyAwardUICtrl";
|
||||
public const string StatementViewUICtrl = "StatementViewUICtrl";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ namespace ChillConnect
|
||||
};
|
||||
ui.btn_removead.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open);
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open);
|
||||
tweer.Pause();
|
||||
});
|
||||
|
||||
|
||||
@@ -119,8 +119,8 @@ namespace ChillConnect
|
||||
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);
|
||||
// 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()
|
||||
@@ -192,8 +192,9 @@ namespace ChillConnect
|
||||
{
|
||||
name = name[..4] + "...";
|
||||
}
|
||||
// text_ui.hide_text.text = GameHelper.getDesByKey("makeup_4");
|
||||
string broad_text = String.Format(GameHelper.getDesByKey("makeup_4"), name, config_money_list[money_index], DateTimeManager.Instance.GetCurrDateTime());
|
||||
// text_ui.hide_text.text = GameHelper.getDesByKey("makeup_4");
|
||||
var money_text = GameHelper.getChString(decimal.Parse(config_money_list[money_index]));
|
||||
string broad_text = String.Format(GameHelper.getDesByKey("makeup_4"), name, money_text, DateTimeManager.Instance.GetCurrDateTime());
|
||||
text_ui.cast_text.text = broad_text;
|
||||
ui.t0.Play();
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
using System;
|
||||
using FGUI.Common_01;
|
||||
using FGUI.Prop_09;
|
||||
using FGUI.store_17;
|
||||
using IgnoreOPS;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
@@ -38,6 +42,7 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameHelper.showGameUI = true;
|
||||
HallManager.Instance.UpdateSecondEvent -= UpdateCd;
|
||||
|
||||
}
|
||||
|
||||
@@ -50,6 +55,7 @@ namespace ChillConnect
|
||||
{
|
||||
|
||||
_price = ConfigSystem.GetConfig<CommonModel>().Purchaseprops;
|
||||
|
||||
|
||||
state_ = (int)args;
|
||||
ui.prop.selectedIndex = state_;
|
||||
@@ -66,6 +72,17 @@ namespace ChillConnect
|
||||
ui.btn_add.SetClick(AddProNum);
|
||||
ui.btn_jian.SetClick(ReduceProNum);
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent += UpdateCd;
|
||||
UpdateCd();
|
||||
|
||||
if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1) ui.img_saveingpot.visible = true;
|
||||
|
||||
|
||||
ui.btn_watch.SetClick(() =>
|
||||
{
|
||||
buyItem();
|
||||
});
|
||||
|
||||
}
|
||||
void buyItem()
|
||||
{
|
||||
@@ -83,25 +100,44 @@ namespace ChillConnect
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (DataMgr.NewWatchCd.Value[state_ + 2] < Convert.ToInt32(GameHelper.GetNowTime()))
|
||||
{
|
||||
GameHelper.ShowVideoAd("reward_prop", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
GameHelper.SetWatchCd(state_ + 2);
|
||||
int numbers = GameHelper.GetItemNumber(state_);
|
||||
numbers++;
|
||||
GameHelper.SetItemNumber(state_, numbers);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Sheep_item_refresh);
|
||||
GameHelper.ShowTips("The purchase was successful", true);
|
||||
|
||||
CtrlCloseUI();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
int price = _price * prop_num;
|
||||
if (GameHelper.CheckGoldNumber(price))
|
||||
{
|
||||
GameHelper.AddGoldNumber(-price);
|
||||
int numbers = GameHelper.GetItemNumber(state_);
|
||||
numbers += prop_num;
|
||||
GameHelper.SetItemNumber(state_, numbers);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Sheep_item_refresh);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
GameHelper.ShowTips("The purchase was successful", true);
|
||||
|
||||
CtrlCloseUI();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("Not enough gold");
|
||||
}
|
||||
|
||||
// int price = _price * prop_num;
|
||||
// if (GameHelper.CheckGoldNumber(price))
|
||||
// {
|
||||
// GameHelper.AddGoldNumber(-price);
|
||||
// int numbers = GameHelper.GetItemNumber(state_);
|
||||
// numbers += prop_num;
|
||||
// GameHelper.SetItemNumber(state_, numbers);
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Sheep_item_refresh);
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
// GameHelper.ShowTips("The purchase was successful", true);
|
||||
//
|
||||
// CtrlCloseUI();
|
||||
//
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// GameHelper.ShowTips("Not enough gold");
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
@@ -130,6 +166,24 @@ namespace ChillConnect
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
private void UpdateCd()
|
||||
{
|
||||
btn_watchAd btnWatch = ui.btn_watch as btn_watchAd;
|
||||
// Debug.Log($"DataMgr.NewWatchCd.Value[state_ + 2]==={DataMgr.NewWatchCd.Value[state_ + 2]}");
|
||||
if (DataMgr.NewWatchCd.Value[state_ + 2] > Convert.ToInt32(GameHelper.GetNowTime()))
|
||||
{
|
||||
btnWatch.enabled = false;
|
||||
btnWatch.can_buy.selectedIndex = 1;
|
||||
btnWatch.btn_text.text = CommonHelper.TimeFormat(DataMgr.NewWatchCd.Value[state_ + 2] - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_watch.enabled = true;
|
||||
btnWatch.can_buy.selectedIndex = 0;
|
||||
btnWatch.watch.text = "Watch AD";
|
||||
}
|
||||
}
|
||||
|
||||
private void AddProNum()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using FGUI.Prop_09;
|
||||
using IgnoreOPS;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
@@ -81,6 +82,7 @@ namespace ChillConnect
|
||||
int need_gold = ConfigSystem.GetConfig<CommonModel>().RevivalCoins;
|
||||
ui.btn_gold_buy.GetChild("text_gold").text = GameHelper.Get101Str(need_gold);
|
||||
|
||||
Debug.Log($"state===================:{state}");
|
||||
initProp(state);
|
||||
|
||||
// ui.btn_thanks.SetClick(() =>
|
||||
@@ -134,7 +136,8 @@ namespace ChillConnect
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
GameHelper.SetLevelstate(1);
|
||||
// GameHelper.SetLevelstate(1);
|
||||
GameHelper.SetLevelstate(0);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Remake_state, true);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
|
||||
}
|
||||
@@ -146,7 +149,8 @@ namespace ChillConnect
|
||||
if (GameHelper.CheckGoldNumber(need_gold))
|
||||
{
|
||||
GameHelper.AddGoldNumber(-need_gold);
|
||||
GameHelper.SetLevelstate(2);
|
||||
// GameHelper.SetLevelstate(2);
|
||||
GameHelper.SetLevelstate(0);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Remake_state, true);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ChoosePropUI_Close);
|
||||
|
||||
@@ -200,7 +200,7 @@ namespace ChillConnect
|
||||
}
|
||||
Debug.Log(ui.input_msg.text);
|
||||
com_msg com_msg = (com_msg)UIPackage.CreateObject("Lobby_03", "com_msg");
|
||||
com_msg.text_msg.text = DataMgr.PlayerName + ":" + ui.input_msg.text;
|
||||
com_msg.text_msg.text = DataMgr.PlayerName.Value + ":" + ui.input_msg.text;
|
||||
list_user_arr.Add(DataMgr.PlayerName.Value);
|
||||
list_content_arr.Add(ui.input_msg.text);
|
||||
PlayerPrefs.SetInt("faq_time", (int)GameHelper.GetNowTime());
|
||||
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using Dont_Confuse;
|
||||
using IgnoreOPS;
|
||||
using FairyGUI;
|
||||
using FGUI.Common_01;
|
||||
using FGUI.GameResult_08;
|
||||
@@ -476,12 +476,12 @@ namespace ChillConnect
|
||||
ui.com_ch.ch_text.text = str;
|
||||
if ((float)DataMgr.Ticket.Value > vo.item_need)
|
||||
{
|
||||
ui.com_ch.progress.width = 590;
|
||||
ui.com_ch.progress.width = 656;
|
||||
ui.com_ch.progress_text.text = GameHelper.Get102Str(vo.item_need) + "/" + GameHelper.Get102Str(vo.item_need);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.com_ch.progress.width = 590 * ((float)DataMgr.Ticket.Value / vo.item_need);
|
||||
ui.com_ch.progress.width = 656 * ((float)DataMgr.Ticket.Value / vo.item_need);
|
||||
ui.com_ch.progress_text.text = GameHelper.Get102Str(DataMgr.Ticket.Value) + "/" + GameHelper.Get102Str(vo.item_need);
|
||||
}
|
||||
|
||||
@@ -492,12 +492,12 @@ namespace ChillConnect
|
||||
// ui.com_ch.ch_text.text = "Cumulataive " + (vo.task_need / 60) + @" minutes in ""Game"" to cash out";
|
||||
// if ((float)DataMgr.MakeupTaskH5Time > vo.task_need)
|
||||
// {
|
||||
// ui.com_ch.progress.width = 590;
|
||||
// ui.com_ch.progress.width = 656;
|
||||
// ui.com_ch.progress_text.text = (vo.task_need / 60) + "/" + (vo.task_need / 60);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// ui.com_ch.progress.width = 590 * ((float)DataMgr.MakeupTaskH5Time / vo.task_need);
|
||||
// ui.com_ch.progress.width = 656 * ((float)DataMgr.MakeupTaskH5Time / vo.task_need);
|
||||
// ui.com_ch.progress_text.text = Math.Round(((float)(DataMgr.MakeupTaskH5Time / 60)), 2) + "/" + (vo.task_need / 60);
|
||||
// }
|
||||
//
|
||||
@@ -509,12 +509,12 @@ namespace ChillConnect
|
||||
ui.com_ch.ch_text.text = str;
|
||||
if (makeupTaskData.videoCount > vo.ad_need)
|
||||
{
|
||||
ui.com_ch.progress.width = 590;
|
||||
ui.com_ch.progress.width = 656;
|
||||
ui.com_ch.progress_text.text = vo.ad_need + "/" + vo.ad_need;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.com_ch.progress.width = 590 * ((float)makeupTaskData.videoCount / vo.ad_need);
|
||||
ui.com_ch.progress.width = 656 * ((float)makeupTaskData.videoCount / vo.ad_need);
|
||||
ui.com_ch.progress_text.text = makeupTaskData.videoCount + "/" + vo.ad_need;
|
||||
}
|
||||
}
|
||||
@@ -522,7 +522,7 @@ namespace ChillConnect
|
||||
{
|
||||
string str = string.Format(GameHelper.getDesByKey("makeup_3"), vo.levels_need);
|
||||
ui.com_ch.ch_text.text = str;
|
||||
ui.com_ch.progress.width = 590 * (GameHelper.GetLevel() - 1) / vo.levels_need;
|
||||
ui.com_ch.progress.width = 656 * (GameHelper.GetLevel() - 1) / vo.levels_need;
|
||||
ui.com_ch.progress_text.text = (GameHelper.GetLevel() - 1) + "/" + vo.levels_need;
|
||||
}
|
||||
else
|
||||
@@ -538,7 +538,7 @@ namespace ChillConnect
|
||||
string str = string.Format(GameHelper.getDesByKey("makeup_2"), vo1.item_need);
|
||||
ui.com_ch.ch_text.text = str;
|
||||
|
||||
ui.com_ch.progress.width = 590f * ((float)(DataMgr.Ticket.Value - vo.item_need) / vo1.item_need);
|
||||
ui.com_ch.progress.width = 656f * ((float)(DataMgr.Ticket.Value - vo.item_need) / vo1.item_need);
|
||||
ui.com_ch.progress_text.text = GameHelper.Get102Str((DataMgr.Ticket.Value - vo.item_need)) + "/" + GameHelper.Get102Str(vo1.item_need);
|
||||
|
||||
|
||||
@@ -551,12 +551,12 @@ namespace ChillConnect
|
||||
ui.com_ch.ch_text.text = str;
|
||||
if (makeupTaskData.videoCount > vo1.ad_need)
|
||||
{
|
||||
ui.com_ch.progress.width = 590f;
|
||||
ui.com_ch.progress.width = 656f;
|
||||
ui.com_ch.progress_text.text = vo1.ad_need + "/" + vo1.ad_need;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.com_ch.progress.width = 590f * ((float)makeupTaskData.videoCount / vo1.ad_need);
|
||||
ui.com_ch.progress.width = 656f * ((float)makeupTaskData.videoCount / vo1.ad_need);
|
||||
ui.com_ch.progress_text.text = makeupTaskData.videoCount + "/" + vo1.ad_need;
|
||||
}
|
||||
}
|
||||
@@ -564,7 +564,7 @@ namespace ChillConnect
|
||||
{
|
||||
string str = string.Format(GameHelper.getDesByKey("makeup_3"), vo1.levels_need);
|
||||
ui.com_ch.ch_text.text = str;
|
||||
ui.com_ch.progress.width = 590f * (GameHelper.GetLevel() - 1) / vo1.levels_need;
|
||||
ui.com_ch.progress.width = 656f * (GameHelper.GetLevel() - 1) / vo1.levels_need;
|
||||
ui.com_ch.progress_text.text = (GameHelper.GetLevel() - 1) + "/" + vo1.levels_need;
|
||||
}
|
||||
|
||||
@@ -573,8 +573,18 @@ namespace ChillConnect
|
||||
|
||||
string str = string.Format(GameHelper.getDesByKey("makeup_3"), vo1.levels_need);
|
||||
ui.com_ch.ch_text.text = str;
|
||||
ui.com_ch.progress.width = 590f * (GameHelper.GetLevel() - 1) / vo1.levels_need;
|
||||
ui.com_ch.progress_text.text = (GameHelper.GetLevel() - 1) + "/" + vo1.levels_need;
|
||||
ui.com_ch.progress.width = 656f * (GameHelper.GetLevel() - 1) / vo1.levels_need;
|
||||
if (GameHelper.GetLevel() > vo1.levels_need)
|
||||
{
|
||||
ui.com_ch.progress.width = 656f;
|
||||
ui.com_ch.progress_text.text = vo1.levels_need + "/" + vo1.levels_need;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.com_ch.progress.width = 590f * (GameHelper.GetLevel() - 1) / vo1.levels_need;
|
||||
ui.com_ch.progress_text.text = (GameHelper.GetLevel() - 1) + "/" + vo1.levels_need;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f566f5ae793a4d869aac696880964a5f
|
||||
timeCreated: 1780995558
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
|
||||
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class H5Ctrl : BaseCtrl
|
||||
{
|
||||
public static H5Ctrl Instance { get; private set; }
|
||||
|
||||
private H5Model model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.H5Model) as H5Model;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f0d89ff894a1074494420d446333bfc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class H5Model : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ad9b45c44f492b4a97fc9845e2972a8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,253 @@
|
||||
|
||||
|
||||
|
||||
using FGUI.ZM_H5_15;
|
||||
using IgnoreOPS;
|
||||
using SGModule.NetKit;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class H5UI : BaseUI
|
||||
{
|
||||
private H5UICtrl ctrl;
|
||||
private H5Model model;
|
||||
private com_webview ui;
|
||||
|
||||
public H5UI(H5UICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.H5UI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.H5Model) as H5Model;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.showBroadCast);
|
||||
WebviewManager.Instance.setInH5View(false);
|
||||
WebviewManager.Instance.ShowH5View(false);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_H5_15.com_webview;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
WebviewManager.Instance.setInH5View(true);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.hideBroadCast);
|
||||
// delayedCall = DOVirtual.DelayedCall(0.3f, () =>
|
||||
// {
|
||||
WebviewManager.Instance.ShowH5View(true);
|
||||
|
||||
ui.btn_close.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Close);
|
||||
});
|
||||
InitView();
|
||||
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
// ui.btn_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;
|
||||
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 345404ec69f13b84c9ce0415061b717b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,79 @@
|
||||
|
||||
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
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: 74ecd6e2beb102e4e9eee8ad48c987d6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -84,6 +84,7 @@ namespace ChillConnect
|
||||
ui.top_group.y += 68;
|
||||
ui.left_group.y += 68;
|
||||
ui.right_group.y += 68;
|
||||
ui.btn_money.y += 60;
|
||||
}
|
||||
|
||||
// ui.com_panel.scrollPane.ScrollRight(12,false);
|
||||
@@ -117,6 +118,9 @@ namespace ChillConnect
|
||||
// HallManager.Instance.countTimes = 0;
|
||||
// }
|
||||
GameHelper.IsShowFirstReward();
|
||||
GameHelper.IsShowPettyReward();
|
||||
GameHelper.ShowStatementView();
|
||||
|
||||
|
||||
isClosed = false;
|
||||
|
||||
@@ -187,64 +191,191 @@ namespace ChillConnect
|
||||
|
||||
void CreateGoldtimeList()
|
||||
{
|
||||
// 获取保存对象
|
||||
var saveObject = SaveData.GetSaveObject();
|
||||
|
||||
// 检查_goldtime是否为null或者长度与Paidcoins_list.Count不相等
|
||||
|
||||
if (saveObject == null)
|
||||
{
|
||||
Debug.LogError("[CreateGoldtimeList] SaveData.GetSaveObject() returned null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Paidcoins_list == null || Paidcoins_list.Count == 0)
|
||||
{
|
||||
Debug.LogError("[CreateGoldtimeList] Paidcoins_list is null or empty");
|
||||
return;
|
||||
}
|
||||
|
||||
int goldtimeLength = saveObject._goldtime != null ? saveObject._goldtime.Length : 0;
|
||||
Debug.Log($"barry Paidcoins_list======{Paidcoins_list.Count} {goldtimeLength}");
|
||||
|
||||
if (saveObject._goldtime == null || saveObject._goldtime.Length != Paidcoins_list.Count)
|
||||
{
|
||||
// 重置_goldtime,并创建一个新的数组,长度为Paidcoins_list.Count
|
||||
saveObject._goldtime = new int[Paidcoins_list.Count];
|
||||
Debug.Log($"[CreateGoldtimeList] Initialized _goldtime with length: {Paidcoins_list.Count}");
|
||||
}
|
||||
|
||||
Debug.Log($"barry GetSaveObject._goldtime.Length======{saveObject._goldtime.Length}");
|
||||
}
|
||||
|
||||
private void UpBtnCoin()
|
||||
{
|
||||
int time = SaveData.GetSaveObject()._goldtime[0];
|
||||
var saveObject = SaveData.GetSaveObject();
|
||||
if (saveObject == null)
|
||||
{
|
||||
Debug.LogError("[UpBtnCoin] SaveData.GetSaveObject() returned null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (saveObject._goldtime == null)
|
||||
{
|
||||
Debug.LogError("[UpBtnCoin] saveObject._goldtime is null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (saveObject._goldtime.Length == 0)
|
||||
{
|
||||
Debug.LogError("[UpBtnCoin] saveObject._goldtime length is 0");
|
||||
return;
|
||||
}
|
||||
|
||||
int time = saveObject._goldtime[0];
|
||||
// Debug.Log($"[UpBtnCoin] time value: {time}, _goldtime length: {saveObject._goldtime.Length}");
|
||||
|
||||
if (ui.btn_gold == null)
|
||||
{
|
||||
Debug.LogError("[UpBtnCoin] ui.btn_gold is null");
|
||||
return;
|
||||
}
|
||||
|
||||
com_gold btn_gold = ui.btn_gold as com_gold;
|
||||
if (btn_gold == null)
|
||||
{
|
||||
Debug.LogError("[UpBtnCoin] ui.btn_gold cast to com_gold failed");
|
||||
return;
|
||||
}
|
||||
|
||||
if (btn_gold.state == null)
|
||||
{
|
||||
Debug.LogError("[UpBtnCoin] btn_gold.state is null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Paidcoins_list == null)
|
||||
{
|
||||
Debug.LogError("[UpBtnCoin] Paidcoins_list is null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Paidcoins_list.Count == 0)
|
||||
{
|
||||
Debug.LogError("[UpBtnCoin] Paidcoins_list count is 0");
|
||||
return;
|
||||
}
|
||||
|
||||
// Debug.Log($"[UpBtnCoin] Paidcoins_list count: {Paidcoins_list.Count}, receive_CD: {Paidcoins_list[0].receive_CD}");
|
||||
|
||||
if (time + Paidcoins_list[0].receive_CD < GameHelper.GetNowTime())
|
||||
{
|
||||
btn_gold.state.selectedIndex = 2;
|
||||
ui.btn_shop.red.visible = true;
|
||||
if (ui.btn_shop != null && ui.btn_shop.red != null)
|
||||
{
|
||||
ui.btn_shop.red.visible = true;
|
||||
// Debug.Log("[UpBtnCoin] Set btn_shop.red.visible = true");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_gold.state.selectedIndex = 1;
|
||||
ui.btn_shop.red.visible = false;
|
||||
if (ui.btn_shop != null && ui.btn_shop.red != null)
|
||||
{
|
||||
ui.btn_shop.red.visible = false;
|
||||
}
|
||||
}
|
||||
checkThreeGift();
|
||||
|
||||
time_count++;
|
||||
ui.btn_sign.red.visible = signRed();
|
||||
|
||||
if (ui.btn_sign != null && ui.btn_sign.red != null)
|
||||
{
|
||||
ui.btn_sign.red.visible = signRed();
|
||||
}
|
||||
|
||||
if (!GameHelper.IsGiftSwitch())
|
||||
{
|
||||
// Debug.Log("[UpBtnCoin] Gift switch is disabled, returning early");
|
||||
return;
|
||||
}
|
||||
|
||||
if (DataMgr.MakeupTaskHistory.Value == null)
|
||||
{
|
||||
// Debug.LogError("[UpBtnCoin] DataMgr.MakeupTaskHistory.Value is null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (DataMgr.MakeupTaskHistory.Value.Count < 1)
|
||||
{
|
||||
// Debug.LogWarning("[UpBtnCoin] MakeupTaskHistory count is less than 1");
|
||||
return;
|
||||
}
|
||||
|
||||
MakeupTaskData data = DataMgr.MakeupTaskHistory.Value[DataMgr.MakeupTaskHistory.Value.Count - 1];
|
||||
if (data == null)
|
||||
{
|
||||
// Debug.LogError("[UpBtnCoin] MakeupTaskData is null");
|
||||
return;
|
||||
}
|
||||
|
||||
// Debug.Log($"[UpBtnCoin] MakeupTaskData status: {data.status}, ch_time: {data.ch_time}");
|
||||
|
||||
if (data.status != MakeupTaskStatus.Level)
|
||||
{
|
||||
(ui.btn_money as com_money).group_tips.visible = false;
|
||||
var btnMoney = ui.btn_money as com_money;
|
||||
if (btnMoney != null && btnMoney.group_tips != null)
|
||||
{
|
||||
btnMoney.group_tips.visible = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.ch_time > GameHelper.GetNowTime())
|
||||
{
|
||||
(ui.btn_money as com_money).text_time.text = "Only " + CommonHelper.TimeFormat((int)data.ch_time - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
var btnMoney = ui.btn_money as com_money;
|
||||
if (btnMoney != null && btnMoney.text_time != null)
|
||||
{
|
||||
btnMoney.text_time.text = "Only " + CommonHelper.TimeFormat((int)data.ch_time - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
// Debug.Log($"[UpBtnCoin] Updated text_time with remaining time");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
(ui.btn_money as com_money).group_tips.visible = false;
|
||||
var btnMoney = ui.btn_money as com_money;
|
||||
if (btnMoney != null && btnMoney.group_tips != null)
|
||||
{
|
||||
btnMoney.group_tips.visible = false;
|
||||
// Debug.Log("[UpBtnCoin] ch_time expired, hide group_tips");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
time_number++;
|
||||
if (time_number > 15)
|
||||
// Debug.Log($"[UpBtnCoin] time_number: {time_number}");
|
||||
|
||||
var btnMoney2 = ui.btn_money as com_money;
|
||||
if (btnMoney2 != null && btnMoney2.group_tips != null)
|
||||
{
|
||||
(ui.btn_money as com_money).group_tips.visible = true;
|
||||
}
|
||||
if (time_number > 20)
|
||||
{
|
||||
(ui.btn_money as com_money).group_tips.visible = false;
|
||||
time_number = 0;
|
||||
if (time_number > 15)
|
||||
{
|
||||
btnMoney2.group_tips.visible = true;
|
||||
// Debug.Log("[UpBtnCoin] time_number > 15, show group_tips");
|
||||
}
|
||||
if (time_number > 20)
|
||||
{
|
||||
btnMoney2.group_tips.visible = false;
|
||||
time_number = 0;
|
||||
// Debug.Log("[UpBtnCoin] time_number > 20, hide group_tips and reset counter");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int time_number = 0;
|
||||
|
||||
void OnRefreshMakeupData(object obj)
|
||||
@@ -324,37 +455,59 @@ namespace ChillConnect
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.SaveingPotUI_Open);
|
||||
});
|
||||
|
||||
btn_noads.SetClick(() =>
|
||||
|
||||
ui.btn_statement.visible = GameHelper.IsGiftSwitch();
|
||||
ui.btn_statement.SetClick(() =>
|
||||
{
|
||||
if (!SaveData.GetSaveObject().is_get_packreward && !SaveData.GetSaveObject().is_get_removead)
|
||||
{
|
||||
if (btn_noads.GetChild("img_ad").visible)
|
||||
{
|
||||
PackRewardData param = new PackRewardData();
|
||||
param.isAutoPop = false;
|
||||
param.isNeedScroll = true;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open, param);
|
||||
}
|
||||
else
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open);
|
||||
}
|
||||
|
||||
}
|
||||
else if (SaveData.GetSaveObject().is_get_packreward)
|
||||
{
|
||||
PackRewardData param = new PackRewardData();
|
||||
param.isAutoPop = false;
|
||||
param.isNeedScroll = true;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open, param);
|
||||
}
|
||||
else
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open);
|
||||
}
|
||||
GameHelper.showGameUI = false;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.StatementViewUI_Open);
|
||||
});
|
||||
|
||||
ui.btn_petty.visible = GameHelper.IsGiftSwitch();
|
||||
ui.btn_petty.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PettyAwardUI_Open);
|
||||
});
|
||||
|
||||
if (!GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().WVswitch == 0)
|
||||
{
|
||||
ui.btn_wv.visible = false;
|
||||
}
|
||||
|
||||
ui.btn_wv.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Open);
|
||||
});
|
||||
|
||||
// btn_noads.SetClick(() =>
|
||||
// {
|
||||
// if (!SaveData.GetSaveObject().is_get_packreward && !SaveData.GetSaveObject().is_get_removead)
|
||||
// {
|
||||
// if (btn_noads.GetChild("img_ad").visible)
|
||||
// {
|
||||
// PackRewardData param = new PackRewardData();
|
||||
// param.isAutoPop = false;
|
||||
// param.isNeedScroll = true;
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open, param);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// else if (SaveData.GetSaveObject().is_get_packreward)
|
||||
// {
|
||||
// PackRewardData param = new PackRewardData();
|
||||
// param.isAutoPop = false;
|
||||
// param.isNeedScroll = true;
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open, param);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open);
|
||||
// }
|
||||
// GameHelper.showGameUI = false;
|
||||
// });
|
||||
|
||||
if (ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1 && GameHelper.IsGiftSwitch())
|
||||
{
|
||||
@@ -385,17 +538,17 @@ namespace ChillConnect
|
||||
}
|
||||
}
|
||||
|
||||
checkThreeGift();
|
||||
ui.btn_failpack.SetClick(() =>
|
||||
{
|
||||
float progress = showResurgence();
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Open, progress);
|
||||
});
|
||||
// checkThreeGift();
|
||||
// ui.btn_failpack.SetClick(() =>
|
||||
// {
|
||||
// float progress = showResurgence();
|
||||
//
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Open, progress);
|
||||
// });
|
||||
|
||||
ui.btn_three_day.SetClick(() =>
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.ThreeDaysGiftUI_Open);
|
||||
// uiCtrlDispatcher.Dispatch(UICtrlMsg.ThreeDaysGiftUI_Open);
|
||||
});
|
||||
|
||||
ui.btn_battle.SetClick(() =>
|
||||
@@ -405,7 +558,7 @@ namespace ChillConnect
|
||||
|
||||
ui.btn_faq.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.FAQUI_Open);
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.FAQUI_Open);
|
||||
});
|
||||
ui.btn_rank.SetClick(() =>
|
||||
{
|
||||
@@ -432,16 +585,16 @@ namespace ChillConnect
|
||||
ui.btn_task.SetClick(() => { OnClickTask(false); });
|
||||
ui.btn_start.SetClick(() =>
|
||||
{
|
||||
if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().have_slot && (DateTime.Now.Day != PlayerPrefs.GetInt("off_new", 0)))
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddviewnewUI_Open);
|
||||
PlayerPrefs.SetInt("off_new", DateTime.Now.Day);
|
||||
}
|
||||
else if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().have_slot && UnityEngine.Random.Range(0, 100) < ConfigSystem.GetConfig<CommonModel>().BonusInside)
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.AddviewnewUI_Open);
|
||||
}
|
||||
else
|
||||
// if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().have_slot && (DateTime.Now.Day != PlayerPrefs.GetInt("off_new", 0)))
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddviewnewUI_Open);
|
||||
// PlayerPrefs.SetInt("off_new", DateTime.Now.Day);
|
||||
// }
|
||||
// else if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().have_slot && UnityEngine.Random.Range(0, 100) < ConfigSystem.GetConfig<CommonModel>().BonusInside)
|
||||
// {
|
||||
// uiCtrlDispatcher.Dispatch(UICtrlMsg.AddviewnewUI_Open);
|
||||
// }
|
||||
// else
|
||||
OnClickPlay();
|
||||
});
|
||||
ui.btn_setting.SetClick(() =>
|
||||
@@ -481,16 +634,16 @@ namespace ChillConnect
|
||||
btn_play_list[i].state.selectedIndex = 1;
|
||||
btn_play_list[i].SetClick(() =>
|
||||
{
|
||||
if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().have_slot && (DateTime.Now.Day != PlayerPrefs.GetInt("off_new", 0)))
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddviewnewUI_Open);
|
||||
PlayerPrefs.SetInt("off_new", DateTime.Now.Day);
|
||||
}
|
||||
else if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().have_slot && UnityEngine.Random.Range(0, 100) < ConfigSystem.GetConfig<CommonModel>().BonusInside)
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.AddviewnewUI_Open);
|
||||
}
|
||||
else
|
||||
// if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().have_slot && (DateTime.Now.Day != PlayerPrefs.GetInt("off_new", 0)))
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddviewnewUI_Open);
|
||||
// PlayerPrefs.SetInt("off_new", DateTime.Now.Day);
|
||||
// }
|
||||
// else if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().have_slot && UnityEngine.Random.Range(0, 100) < ConfigSystem.GetConfig<CommonModel>().BonusInside)
|
||||
// {
|
||||
// uiCtrlDispatcher.Dispatch(UICtrlMsg.AddviewnewUI_Open);
|
||||
// }
|
||||
// else
|
||||
OnClickPlay();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Dont_Confuse;
|
||||
using IgnoreOPS;
|
||||
using IgnoreOPS;
|
||||
using FairyGUI;
|
||||
using FGUI.Common_01;
|
||||
@@ -54,7 +54,8 @@ namespace ChillConnect
|
||||
HallManager.Instance.UpdateSecondEvent -= upLvWatchAdsBtn;
|
||||
|
||||
GameHelper.showGameUI = true;
|
||||
WebviewManager.ShezhiACT(true);
|
||||
// WebviewManager.ShezhiACT(true);
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
gameDispatcher.Dispatch(GameMsg.MakeUpConfirmUIClosed);
|
||||
|
||||
@@ -62,7 +63,7 @@ namespace ChillConnect
|
||||
{
|
||||
if (UnityEngine.Random.Range(0, 50) < 25)
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.FAQUI_Open);
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.FAQUI_Open);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -87,7 +88,8 @@ namespace ChillConnect
|
||||
DataMgr.MakeupTaskH5Time.Value = 999999999;
|
||||
// DataMgr.Ticket.Value = 999999999; //zhushi
|
||||
|
||||
WebviewManager.ShezhiACT(false);
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
// WebviewManager.ShezhiACT(false);
|
||||
|
||||
makeupTaskData = args as MakeupTaskData;
|
||||
ch_index = makeupTaskData.tableId - 1;
|
||||
@@ -647,6 +649,8 @@ namespace ChillConnect
|
||||
AudioManager.Instance.PlayDynamicEffect(AudioConst.MakeupDone);
|
||||
makeupTaskData.SetStatus(MakeupTaskStatus.Task);
|
||||
DataMgr.MakeupTaskHistory.Save();
|
||||
DataMgr.Ticket.Value -= vo.item_need;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Update102);
|
||||
// OnTask();
|
||||
InitView();
|
||||
});
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
CommonHelper.FadeOut(ui);
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -67,6 +67,7 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
CommonHelper.FadeIn(ui);
|
||||
|
||||
// if (args != null)
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace ChillConnect
|
||||
int three_gift_got_index = SaveData.GetSaveObject().three_gift_got_index;
|
||||
if (isAutoPop && (three_gift_got_index <= (int)rewardState.day3))
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.ThreeDaysGiftUI_Open);
|
||||
// uiCtrlDispatcher.Dispatch(UICtrlMsg.ThreeDaysGiftUI_Open);
|
||||
}
|
||||
GameHelper.CallShowTurn();
|
||||
}
|
||||
@@ -80,6 +80,8 @@ namespace ChillConnect
|
||||
ConfigSystem.GetConfig<PaidgiftModel>().DataList[1].Paid_price = 1;
|
||||
}
|
||||
|
||||
ui.panel_parent.panel.gift.selectedIndex = GameHelper.IsGiftSwitch() ? 1 : 0;
|
||||
|
||||
bool need_scroll = false;
|
||||
|
||||
PackRewardData Datas = args as PackRewardData;
|
||||
@@ -347,8 +349,8 @@ namespace ChillConnect
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.Log(AdRedeemManager.Instance.GetLookRewardADNum());
|
||||
Debug.Log(ConfigSystem.GetConfig<PaidgiftModel>().DataList[0].Paid_price);
|
||||
// Debug.Log(AdRedeemManager.Instance.GetLookRewardADNum());
|
||||
// Debug.Log(ConfigSystem.GetConfig<PaidgiftModel>().DataList[0].Paid_price);
|
||||
if (AdRedeemManager.Instance.GetLookRewardADNum() >= ConfigSystem.GetConfig<PaidgiftModel>().DataList[0].Paid_price)
|
||||
{
|
||||
(ui.panel_parent.panel.btn_buypack as btn_watchAd).enabled = true;
|
||||
|
||||
@@ -45,6 +45,7 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
GameHelper.showGameUI = true;
|
||||
HallManager.Instance.UpdateSecondEvent -= upData;
|
||||
|
||||
@@ -57,6 +58,7 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
if (Screen.safeArea.y != 0)
|
||||
{
|
||||
// ui.bg.y += 68;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Dont_Confuse;
|
||||
using IgnoreOPS;
|
||||
using FairyGUI;
|
||||
using FGUI.Setting_07;
|
||||
using IgnoreOPS;
|
||||
@@ -45,7 +45,8 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.ShezhiACT(true);
|
||||
// WebviewManager.ShezhiACT(true);
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -60,7 +61,7 @@ namespace ChillConnect
|
||||
// {
|
||||
// ui.title.y += Screen.safeArea.y;
|
||||
// }
|
||||
WebviewManager.ShezhiACT(false);
|
||||
// WebviewManager.ShezhiACT(false);
|
||||
_selectIndex = DataMgr.PlayerAvatarId.Value;
|
||||
|
||||
InitView();
|
||||
@@ -69,6 +70,7 @@ namespace ChillConnect
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
// CommonHelper.FadeIn(ui);
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
ui.show.Play();
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7afed3bc6e245aaba4279f3747e8ca2
|
||||
timeCreated: 1780552707
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class PettyAwardCtrl : BaseCtrl
|
||||
{
|
||||
public static PettyAwardCtrl Instance { get; private set; }
|
||||
|
||||
private PettyAwardModel model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.PettyAwardModel) as PettyAwardModel;
|
||||
}
|
||||
|
||||
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: 1261358ce7a049afb16f4553810bd5bf
|
||||
timeCreated: 1766046260
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class PettyAwardModel : 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: 92b7e778079e4302b93e51da320ec76c
|
||||
timeCreated: 1766046260
|
||||
@@ -0,0 +1,300 @@
|
||||
using System;
|
||||
using IgnoreOPS;
|
||||
using UnityEngine;
|
||||
using Spine.Unity;
|
||||
using Newtonsoft.Json;
|
||||
using SGModule.NetKit;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class PettyAwardUI : BaseUI
|
||||
{
|
||||
private PettyAwardUICtrl ctrl;
|
||||
private PettyAwardModel model;
|
||||
private FGUI.ZM_Petty.com_petty_award ui;
|
||||
private Action closeCallback;
|
||||
private Action open_sign;
|
||||
private bool is_get = false;
|
||||
public PettyAwardUI(PettyAwardUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.PettyAwardUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ZM_Petty";
|
||||
uiInfo.assetName = "com_petty_award";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
model = ModuleManager.Instance.GetModel(ModelConst.PettyAwardModel) as PettyAwardModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
closeCallback?.Invoke();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ZM_Petty.com_petty_award;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
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 int _mLastState;
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
_mLastState = SaveData.GetSaveObject().PettyState;
|
||||
Debug.Log($"PettyState============: {SaveData.GetSaveObject().PettyState}");
|
||||
var num = GameHelper.GetCommonModel().SmallReward;
|
||||
ui.com_get_panel.text_reward.text = $"{GameHelper.Get102Str(num)} USD";
|
||||
|
||||
|
||||
ui.com_get_panel.btn_get.SetClick(GotoEnterAccount);
|
||||
ui.btn_close.SetClick(()=>
|
||||
{
|
||||
if (ui.state.selectedIndex == 4)
|
||||
{
|
||||
GotoEnterAccount();
|
||||
}
|
||||
else
|
||||
{
|
||||
CtrlCloseUI();
|
||||
}
|
||||
});
|
||||
|
||||
if (_mLastState == 0)
|
||||
{
|
||||
var sk = FXManager.Instance.SetFx<SkeletonAnimation>(ui.anim, Fx_Type.fx_petty_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_gerAward.SetClick(() =>
|
||||
{
|
||||
ui.btn_gerAward.visible = false;
|
||||
sk.state.SetAnimation(0, "newbie_reward_an03", false);
|
||||
sk.state.Complete += (a) =>
|
||||
{
|
||||
ui.state.selectedIndex = 1;
|
||||
SaveData.GetSaveObject().PettyState = 1;
|
||||
ui.anim.visible = false;
|
||||
};
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
GotoPanel(_mLastState);
|
||||
}
|
||||
}
|
||||
|
||||
private void GotoPanel(int index)
|
||||
{
|
||||
switch (index)
|
||||
{
|
||||
case 1:
|
||||
ui.state.selectedIndex = 1;
|
||||
break;
|
||||
case 2:
|
||||
ui.state.selectedIndex = 2;
|
||||
GotoEnterAccount();
|
||||
break;
|
||||
case 3:
|
||||
ui.state.selectedIndex = 3;
|
||||
GotoDetail();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void GotoEnterAccount()
|
||||
{
|
||||
ui.state.selectedIndex = 2;
|
||||
SaveData.GetSaveObject().PettyState = 2;
|
||||
if (!SaveData.GetSaveObject().PettyAccount.IsNullOrWhiteSpace())
|
||||
{
|
||||
ui.com_account.com_email.enter_email.text = SaveData.GetSaveObject().PettyAccount;
|
||||
}
|
||||
if (!SaveData.GetSaveObject().PettyFirstName.IsNullOrWhiteSpace())
|
||||
{
|
||||
ui.com_account.com_first_name.enter_first_name.text = SaveData.GetSaveObject().PettyFirstName;
|
||||
}
|
||||
if (!SaveData.GetSaveObject().PettyLastName.IsNullOrWhiteSpace())
|
||||
{
|
||||
ui.com_account.com_last_name.enter_last_name.text = SaveData.GetSaveObject().PettyLastName;
|
||||
}
|
||||
|
||||
ui.com_account.btn_confirm.SetClick(ConfirmClick);
|
||||
}
|
||||
|
||||
private void ConfirmClick()
|
||||
{
|
||||
var account = ui.com_account.com_email.enter_email.text.Replace(" ", "");
|
||||
if (account == "")
|
||||
{
|
||||
GameHelper.ShowTips("Please enter the correct account information", true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GameHelper.CheckAccountValidly(account))
|
||||
{
|
||||
GameHelper.ShowTips("Please enter the correct account information", true);
|
||||
return;
|
||||
}
|
||||
|
||||
var fname = ui.com_account.com_first_name.enter_first_name.text.Replace(" ", "");
|
||||
if (!GameHelper.CheckNameValidly(fname))
|
||||
{
|
||||
GameHelper.ShowTips("Please enter the correct account information", true);
|
||||
return;
|
||||
}
|
||||
|
||||
var lname = ui.com_account.com_last_name.enter_last_name.text.Replace(" ", "");
|
||||
if (!GameHelper.CheckNameValidly(lname) && !AppConst.isPt())
|
||||
{
|
||||
GameHelper.ShowTips("Please enter the correct account information", true);
|
||||
return;
|
||||
}
|
||||
|
||||
SaveData.GetSaveObject().PettyAccount = account;
|
||||
SaveData.GetSaveObject().PettyFirstName = fname;
|
||||
SaveData.GetSaveObject().PettyLastName = lname;
|
||||
|
||||
GotoSecondConfirm(account, fname, lname);
|
||||
|
||||
}
|
||||
|
||||
private void GotoSecondConfirm( string account, string fname, string lname)
|
||||
{
|
||||
ui.state.selectedIndex = 4;
|
||||
PaymentMsg info = new PaymentMsg
|
||||
{
|
||||
email = account,
|
||||
first_name = fname,
|
||||
last_name = lname
|
||||
};
|
||||
|
||||
ui.com_second_confirm.text_account.SetVar("account", account).FlushVars();
|
||||
ui.com_second_confirm.text_first_name.SetVar("name", fname).FlushVars();
|
||||
ui.com_second_confirm.text_last_name.SetVar("name", lname).FlushVars();
|
||||
|
||||
ui.com_second_confirm.btn_confirm.SetClick(() =>
|
||||
{
|
||||
ui.com_second_confirm.btn_confirm.enabled = false;
|
||||
|
||||
NetApi.PayOutUserInfo<OrderState>(account,
|
||||
fname, lname, (isSuccess, obj) =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
GotoDetail();
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("Failed to save information., please try again");
|
||||
ui.com_second_confirm.btn_confirm.enabled = true;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private void GotoDetail()
|
||||
{
|
||||
ui.state.selectedIndex = 3;
|
||||
SaveData.GetSaveObject().PettyState = 3;
|
||||
|
||||
var pettyAmount = SaveData.GetSaveObject().PettyAmount;
|
||||
if (pettyAmount != 0)
|
||||
{
|
||||
ui.com_detail.text_amount.SetVar("num", GameHelper.Get102Str(pettyAmount)).FlushVars();
|
||||
}
|
||||
else
|
||||
{
|
||||
var num = GameHelper.GetCommonModel().SmallReward;
|
||||
ui.com_detail.text_amount.SetVar("num", GameHelper.Get102Str(num)).FlushVars();
|
||||
SaveData.GetSaveObject().PettyAmount = num;
|
||||
}
|
||||
|
||||
var pettyDateTime = SaveData.GetSaveObject().PettyDateTime;
|
||||
if (!pettyDateTime.IsNullOrWhiteSpace())
|
||||
{
|
||||
ui.com_detail.text_data.SetVar("data", pettyDateTime).FlushVars();
|
||||
}
|
||||
else
|
||||
{
|
||||
var dateTime = DateTime.Now.ToString("yyyy.MM.dd");
|
||||
ui.com_detail.text_data.SetVar("data",dateTime).FlushVars();
|
||||
SaveData.GetSaveObject().PettyDateTime = dateTime;
|
||||
}
|
||||
|
||||
var pettyOrderID = SaveData.GetSaveObject().PettyOrderID;
|
||||
if (!pettyOrderID.IsNullOrWhiteSpace())
|
||||
{
|
||||
ui.com_detail.text_order.SetVar("order", pettyOrderID).FlushVars();
|
||||
}
|
||||
else
|
||||
{
|
||||
string datePart = DateTime.Now.ToString("yyyyMMdd");
|
||||
System.Random random = new System.Random();
|
||||
string randomPart = random.Next(1000, 9999).ToString(); // 生成1000-9999之间的四位数
|
||||
ui.com_detail.text_order.SetVar("order",datePart + randomPart).FlushVars();
|
||||
|
||||
SaveData.GetSaveObject().PettyOrderID = datePart + randomPart;
|
||||
}
|
||||
|
||||
|
||||
ui.com_detail.text_email.SetVar("email",SaveData.GetSaveObject().PettyAccount).FlushVars();
|
||||
|
||||
var pettyDataLimit = SaveData.GetSaveObject().PettyDataLimit;
|
||||
if (pettyDataLimit != 0)
|
||||
{
|
||||
ui.com_detail.text_limit.SetVar("day", pettyDataLimit.ToString()).FlushVars();
|
||||
}else
|
||||
{
|
||||
var day = GameHelper.GetCommonModel().ProcessingTime;
|
||||
ui.com_detail.text_limit.SetVar("day", day.ToString()).FlushVars();
|
||||
SaveData.GetSaveObject().PettyDataLimit = day;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3976c01df34446138c677b09d9acbe64
|
||||
timeCreated: 1766046260
|
||||
@@ -0,0 +1,71 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class PettyAwardUICtrl : BaseUICtrl
|
||||
{
|
||||
private PettyAwardUI ui;
|
||||
private PettyAwardModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.PettyAwardUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.PettyAwardUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.PettyAwardModel) as PettyAwardModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new PettyAwardUI(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,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8acb71d41fef451383c9046c42ba7a9d
|
||||
timeCreated: 1766046260
|
||||
@@ -160,7 +160,7 @@ namespace ChillConnect
|
||||
|
||||
}
|
||||
|
||||
|
||||
ui.btn_money.visible = false;
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
ui.btn_money.visible = true;
|
||||
@@ -170,6 +170,9 @@ namespace ChillConnect
|
||||
anim_paly.state.SetAnimation(0, "animation", true);
|
||||
|
||||
GameHelper.IsShowFirstReward();
|
||||
GameHelper.IsShowPettyReward();
|
||||
GameHelper.ShowStatementView();
|
||||
|
||||
|
||||
CreateGoldtimeList();
|
||||
|
||||
@@ -244,36 +247,36 @@ namespace ChillConnect
|
||||
GameHelper.SetGameday();
|
||||
}
|
||||
|
||||
ui.btn_noads.SetClick(() =>
|
||||
{
|
||||
if (!SaveData.GetSaveObject().is_get_packreward && !SaveData.GetSaveObject().is_get_removead)
|
||||
{
|
||||
if (ui.btn_noads.GetChild("img_ad").visible)
|
||||
{
|
||||
PackRewardData param = new PackRewardData();
|
||||
param.isAutoPop = false;
|
||||
param.isNeedScroll = true;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open, param);
|
||||
}
|
||||
else
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open);
|
||||
}
|
||||
|
||||
}
|
||||
else if (SaveData.GetSaveObject().is_get_packreward)
|
||||
{
|
||||
PackRewardData param = new PackRewardData();
|
||||
param.isAutoPop = false;
|
||||
param.isNeedScroll = true;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open, param);
|
||||
}
|
||||
else
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open);
|
||||
}
|
||||
GameHelper.showGameUI = false;
|
||||
});
|
||||
// ui.btn_noads.SetClick(() =>
|
||||
// {
|
||||
// if (!SaveData.GetSaveObject().is_get_packreward && !SaveData.GetSaveObject().is_get_removead)
|
||||
// {
|
||||
// if (ui.btn_noads.GetChild("img_ad").visible)
|
||||
// {
|
||||
// PackRewardData param = new PackRewardData();
|
||||
// param.isAutoPop = false;
|
||||
// param.isNeedScroll = true;
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open, param);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open);
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// else if (SaveData.GetSaveObject().is_get_packreward)
|
||||
// {
|
||||
// PackRewardData param = new PackRewardData();
|
||||
// param.isAutoPop = false;
|
||||
// param.isNeedScroll = true;
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open, param);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open);
|
||||
// }
|
||||
// GameHelper.showGameUI = false;
|
||||
// });
|
||||
|
||||
SetLevelProgress();
|
||||
(ui.btn_money as com_money).btn_ch.title = GameHelper.getDesByKey("ch_out_1");
|
||||
@@ -282,76 +285,156 @@ namespace ChillConnect
|
||||
|
||||
void timeEvent()
|
||||
{
|
||||
if (SaveData.GetSaveObject().addview_off_time > GameHelper.GetNowTime() && GameHelper.IsGiftSwitch())
|
||||
var saveObject = SaveData.GetSaveObject();
|
||||
if (saveObject == null)
|
||||
{
|
||||
if (!effect_show)
|
||||
ui.btn_add.type.selectedIndex = 1;
|
||||
ui.btn_add.type.selectedIndex = 1;
|
||||
ui.btn_add.text_offtime.text = CommonHelper.TimeFormat(SaveData.GetSaveObject().addview_off_time - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
Debug.LogError("[RainPlayUI UpBtnCoin] SaveData.GetSaveObject() returned null");
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
if (saveObject._goldtime == null)
|
||||
{
|
||||
ui.btn_add.type.selectedIndex = 0;
|
||||
Debug.LogError("[RainPlayUI UpBtnCoin] saveObject._goldtime is null");
|
||||
return;
|
||||
}
|
||||
|
||||
int time = SaveData.GetSaveObject()._goldtime[0];
|
||||
|
||||
if (saveObject._goldtime.Length == 0)
|
||||
{
|
||||
Debug.LogError("[RainPlayUI UpBtnCoin] saveObject._goldtime length is 0");
|
||||
return;
|
||||
}
|
||||
|
||||
int time = saveObject._goldtime[0];
|
||||
|
||||
if (ui.btn_gold == null)
|
||||
{
|
||||
Debug.LogError("[RainPlayUI UpBtnCoin] ui.btn_gold is null");
|
||||
return;
|
||||
}
|
||||
|
||||
com_gold btn_gold = ui.btn_gold as com_gold;
|
||||
if (btn_gold == null)
|
||||
{
|
||||
Debug.LogError("[RainPlayUI UpBtnCoin] ui.btn_gold cast to com_gold failed");
|
||||
return;
|
||||
}
|
||||
|
||||
if (btn_gold.state == null)
|
||||
{
|
||||
Debug.LogError("[RainPlayUI UpBtnCoin] btn_gold.state is null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Paidcoins_list == null)
|
||||
{
|
||||
Debug.LogError("[RainPlayUI UpBtnCoin] Paidcoins_list is null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Paidcoins_list.Count == 0)
|
||||
{
|
||||
Debug.LogError("[RainPlayUI UpBtnCoin] Paidcoins_list count is 0");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (time + Paidcoins_list[0].receive_CD < GameHelper.GetNowTime())
|
||||
{
|
||||
btn_gold.state.selectedIndex = 2;
|
||||
// btn_gold.red.visible = true;
|
||||
}
|
||||
else btn_gold.state.selectedIndex = 1;
|
||||
else
|
||||
{
|
||||
btn_gold.state.selectedIndex = 1;
|
||||
}
|
||||
|
||||
ui.btn_task_pass.GetChild("red").visible = SaveData.battlepassred();
|
||||
// ui.btn_task.red.visible = SaveData.getRed();
|
||||
if (!GameHelper.IsGiftSwitch()) return;
|
||||
if (ui.btn_task_pass != null && ui.btn_task_pass.GetChild("red") != null)
|
||||
{
|
||||
ui.btn_task_pass.GetChild("red").visible = SaveData.battlepassred();
|
||||
}
|
||||
|
||||
if (!GameHelper.IsGiftSwitch())
|
||||
{
|
||||
Debug.Log("[RainPlayUI UpBtnCoin] Gift switch is disabled, returning early");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
btn_look_ad_showtime++;
|
||||
if (btn_look_ad_showtime > 15) ui.btn_look_ad.visible = false;
|
||||
|
||||
if ((!SaveData.GetSaveObject().is_get_packreward || !SaveData.GetSaveObject().is_get_removead) && !SaveData.GetSaveObject().is_autopack_show
|
||||
&& (Time.time > (ConfigSystem.GetConfig<CommonModel>().Activetimes * 60)))
|
||||
if (btn_look_ad_showtime > 15)
|
||||
{
|
||||
Window Popup = GRoot.inst.GetChild("Popup") as Window;
|
||||
if (Popup.GetChildren().Length > 0) return;
|
||||
PackRewardData param = new PackRewardData();
|
||||
param.isAutoPop = true;
|
||||
param.isNeedScroll = false;
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open, param);
|
||||
SaveData.GetSaveObject().is_autopack_show = true;
|
||||
SaveData.GetSaveObject().is_autopack_show_day = DateTime.Now.Day;
|
||||
SaveData.saveDataFunc();
|
||||
|
||||
if (ui.btn_look_ad != null)
|
||||
{
|
||||
ui.btn_look_ad.visible = false;
|
||||
}
|
||||
}
|
||||
if (DataMgr.MakeupTaskHistory.Value.Count < 1)
|
||||
|
||||
if (DataMgr.MakeupTaskHistory.Value == null)
|
||||
{
|
||||
Debug.LogError("[RainPlayUI UpBtnCoin] DataMgr.MakeupTaskHistory.Value is null");
|
||||
return;
|
||||
}
|
||||
|
||||
if (DataMgr.MakeupTaskHistory.Value.Count < 1)
|
||||
{
|
||||
Debug.LogWarning("[RainPlayUI UpBtnCoin] MakeupTaskHistory count is less than 1");
|
||||
return;
|
||||
}
|
||||
|
||||
MakeupTaskData data = DataMgr.MakeupTaskHistory.Value[DataMgr.MakeupTaskHistory.Value.Count - 1];
|
||||
if (data == null)
|
||||
{
|
||||
Debug.LogError("[RainPlayUI UpBtnCoin] MakeupTaskData is null");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (data.status != MakeupTaskStatus.Level)
|
||||
{
|
||||
(ui.btn_money as com_money).group_tips.visible = false;
|
||||
var btnMoney = ui.btn_money as com_money;
|
||||
if (btnMoney != null && btnMoney.group_tips != null)
|
||||
{
|
||||
btnMoney.group_tips.visible = false;
|
||||
// Debug.Log("[RainPlayUI UpBtnCoin] Status is not Level, hide group_tips");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (data.ch_time > GameHelper.GetNowTime())
|
||||
{
|
||||
(ui.btn_money as com_money).text_time.text = "Only " + CommonHelper.TimeFormat((int)data.ch_time - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
var btnMoney = ui.btn_money as com_money;
|
||||
if (btnMoney != null && btnMoney.text_time != null)
|
||||
{
|
||||
btnMoney.text_time.text = "Only " + CommonHelper.TimeFormat((int)data.ch_time - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
// Debug.Log($"[RainPlayUI UpBtnCoin] Updated text_time with remaining time");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
(ui.btn_money as com_money).group_tips.visible = false;
|
||||
var btnMoney = ui.btn_money as com_money;
|
||||
if (btnMoney != null && btnMoney.group_tips != null)
|
||||
{
|
||||
btnMoney.group_tips.visible = false;
|
||||
// Debug.Log("[RainPlayUI UpBtnCoin] ch_time expired, hide group_tips");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
time_number++;
|
||||
if (time_number > 15)
|
||||
|
||||
var btnMoney2 = ui.btn_money as com_money;
|
||||
if (btnMoney2 != null && btnMoney2.group_tips != null)
|
||||
{
|
||||
(ui.btn_money as com_money).group_tips.visible = true;
|
||||
}
|
||||
if (time_number > 20)
|
||||
{
|
||||
(ui.btn_money as com_money).group_tips.visible = false;
|
||||
time_number = 0;
|
||||
if (time_number > 15)
|
||||
{
|
||||
btnMoney2.group_tips.visible = true;
|
||||
// Debug.Log("[RainPlayUI UpBtnCoin] time_number > 15, show group_tips");
|
||||
}
|
||||
if (time_number > 20)
|
||||
{
|
||||
btnMoney2.group_tips.visible = false;
|
||||
time_number = 0;
|
||||
// Debug.Log("[RainPlayUI UpBtnCoin] time_number > 20, hide group_tips and reset counter");
|
||||
}
|
||||
}
|
||||
}
|
||||
private int time_number = 0;
|
||||
@@ -481,6 +564,7 @@ namespace ChillConnect
|
||||
GameDispatcher.Instance.AddListener(GameMsg.ThreeDaysGiftUIClose, checkThreeGift);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.noads_refresh, setBtnAds);
|
||||
GameDispatcher.Instance.AddListener(GameMsg.add_points, AddPoints);
|
||||
|
||||
// MainThreadDispatcher.Instance.AddListener(MainThreadMsg.App_Focus_True, backGame);
|
||||
|
||||
}
|
||||
@@ -551,18 +635,18 @@ namespace ChillConnect
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SheepwindowUI_Open, 2);
|
||||
});
|
||||
|
||||
ui.btn_failpack.SetClick(() =>
|
||||
{
|
||||
float complte_progress = showResurgence();
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Open, complte_progress);
|
||||
});
|
||||
|
||||
// ui.btn_failpack.SetClick(() =>
|
||||
// {
|
||||
// float complte_progress = showResurgence();
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Open, complte_progress);
|
||||
// });
|
||||
|
||||
ui.btn_task_pass.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PassViewUI_Open); });
|
||||
|
||||
ui.btn_look_ad.SetClick(LookAd);
|
||||
ui.btn_three_day.SetClick(() =>
|
||||
{
|
||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.ThreeDaysGiftUI_Open);
|
||||
// uiCtrlDispatcher.Dispatch(UICtrlMsg.ThreeDaysGiftUI_Open);
|
||||
});
|
||||
|
||||
if (ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1 && GameHelper.IsGiftSwitch())
|
||||
@@ -570,7 +654,22 @@ namespace ChillConnect
|
||||
ui.btn_saveingpot.visible = true;
|
||||
}
|
||||
ui.btn_saveingpot.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.SaveingPotUI_Open); });
|
||||
|
||||
|
||||
ui.btn_statement.visible = GameHelper.IsGiftSwitch();
|
||||
ui.btn_statement.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.StatementViewUI_Open);
|
||||
});
|
||||
|
||||
if (!GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().WVswitch == 0)
|
||||
{
|
||||
ui.btn_wv.visible = false;
|
||||
}
|
||||
|
||||
ui.btn_wv.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.H5UI_Open);
|
||||
});
|
||||
|
||||
// #if !UNITY_EDITOR
|
||||
// string type = SystemInfo.deviceModel.ToLower().Trim();
|
||||
@@ -585,22 +684,42 @@ namespace ChillConnect
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Open); return;//zhushi
|
||||
|
||||
// GameHelper.ShowTips("Coming Soon!");
|
||||
if (SaveData.GetSaveObject().addview_off_time > GameHelper.GetNowTime() && GameHelper.IsGiftSwitch())
|
||||
|
||||
if (DataMgr.NewWatchCd.Value[1] < Convert.ToInt32(GameHelper.GetNowTime()))
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Open);
|
||||
}
|
||||
else
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuyslotUI_Open);
|
||||
GameHelper.ShowVideoAd("reward_add_space", isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
SaveData.GetSaveObject().have_slot = true;
|
||||
SetSlotNumber();
|
||||
GameHelper.SetWatchCd(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
// if (SaveData.GetSaveObject().addview_off_time > GameHelper.GetNowTime() && GameHelper.IsGiftSwitch())
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Open);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuyslotUI_Open);
|
||||
// }
|
||||
GameHelper.showGameUI = false;
|
||||
});
|
||||
|
||||
ui.btn_petty.visible = GameHelper.IsGiftSwitch();
|
||||
ui.btn_petty.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PettyAwardUI_Open);
|
||||
});
|
||||
|
||||
SetItemNumber();
|
||||
SetSlotNumber();
|
||||
SetTopCurr();
|
||||
setBtnAds();
|
||||
|
||||
ui.btn_gold.visible = !GameHelper.IsGiftSwitch();
|
||||
ui.btn_gold.SetClick(() =>
|
||||
{
|
||||
//uiCtrlDispatcher.Dispatch(UICtrlMsg.MainUI_Open);
|
||||
@@ -663,7 +782,7 @@ namespace ChillConnect
|
||||
}
|
||||
RankSystemMgr.Instance.checkUsers();
|
||||
ui.btn_rank.visible = GameHelper.IsGiftSwitch();
|
||||
ui.btn_rank.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RankUI_Open); });
|
||||
// ui.btn_rank.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RankUI_Open); });
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
var data = SaveData.GetRankData().rankRewardData;
|
||||
@@ -686,6 +805,12 @@ namespace ChillConnect
|
||||
// Debug.Log($"barry initView==== {SaveData.GetSaveObject().card_layer} {SaveData.GetSaveObject().all_card_numbers}");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void OnClickPass()
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PassViewUI_Open);
|
||||
}
|
||||
|
||||
private void AddPoints(object a = null)
|
||||
{
|
||||
@@ -727,6 +852,8 @@ namespace ChillConnect
|
||||
|
||||
try
|
||||
{
|
||||
ui.btn_task_pass.GetChild("red").visible = SaveData.battlepassred();
|
||||
|
||||
ui.btn_rank.GetChild("red").visible = SaveData.GetRankData().rankRewardData.Count > 0;
|
||||
}
|
||||
catch
|
||||
@@ -813,6 +940,7 @@ namespace ChillConnect
|
||||
|
||||
void CreateGoldtimeList()
|
||||
{
|
||||
Debug.Log($"barry _goldtime======{Paidcoins_list.Count}");
|
||||
// 获取保存对象
|
||||
var saveObject = SaveData.GetSaveObject();
|
||||
|
||||
@@ -820,8 +948,10 @@ namespace ChillConnect
|
||||
if (saveObject._goldtime == null || saveObject._goldtime.Length != Paidcoins_list.Count)
|
||||
{
|
||||
// 重置_goldtime,并创建一个新的数组,长度为Paidcoins_list.Count
|
||||
saveObject._goldtime = new int[Paidcoins_list.Count];
|
||||
SaveData.GetSaveObject()._goldtime = new int[Paidcoins_list.Count];
|
||||
}
|
||||
Debug.Log($"barry GetSaveObject._goldtime.Length======{SaveData.GetSaveObject()._goldtime.Length}");
|
||||
|
||||
}
|
||||
|
||||
void LookAd()
|
||||
@@ -1033,12 +1163,14 @@ namespace ChillConnect
|
||||
RefreshCardState(true);
|
||||
GameHelper.SetLevelstate(3);
|
||||
GameHelper.IsTemporaryEnd = false;
|
||||
SaveData.GetSaveObject().have_slot = false;
|
||||
SaveData.GetSaveObject().clear_number = 0;
|
||||
for (int i = 0; i < SaveData.GetSaveObject().usePropsNum.Length; i++)
|
||||
{
|
||||
SaveData.GetSaveObject().usePropsNum[i] = 0;
|
||||
}
|
||||
// SetLevelProgress();
|
||||
SetSlotNumber();
|
||||
}
|
||||
void RefreshFunc()
|
||||
{
|
||||
@@ -1706,38 +1838,38 @@ namespace ChillConnect
|
||||
float complte_progress = showResurgence();
|
||||
if (GameHelper.GetLevelstate() != 0)
|
||||
{
|
||||
if (SaveData.GetSaveObject().game_fail_off_number >= ConfigSystem.GetConfig<CommonModel>().AddDiscountLevel && !is_showslot && !SaveData.GetSaveObject().have_slot && GameHelper.IsGiftSwitch())
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Open);
|
||||
SaveData.GetSaveObject().game_fail_off_number = 0;
|
||||
if (SaveData.GetSaveObject().addview_off_time < GameHelper.GetNowTime())
|
||||
{
|
||||
SaveData.GetSaveObject().addview_off_time = (int)GameHelper.GetNowTime() + ConfigSystem.GetConfig<CommonModel>().AddDiscountCD;
|
||||
}
|
||||
is_showslot = true;
|
||||
// if (SaveData.GetSaveObject().game_fail_off_number >= ConfigSystem.GetConfig<CommonModel>().AddDiscountLevel && !is_showslot && !SaveData.GetSaveObject().have_slot && GameHelper.IsGiftSwitch())
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Open);
|
||||
// SaveData.GetSaveObject().game_fail_off_number = 0;
|
||||
// if (SaveData.GetSaveObject().addview_off_time < GameHelper.GetNowTime())
|
||||
// {
|
||||
// SaveData.GetSaveObject().addview_off_time = (int)GameHelper.GetNowTime() + ConfigSystem.GetConfig<CommonModel>().AddDiscountCD;
|
||||
// }
|
||||
// is_showslot = true;
|
||||
//
|
||||
// return;
|
||||
// }
|
||||
|
||||
return;
|
||||
}
|
||||
// if (SaveData.GetSaveObject().game_fail_number >= ConfigSystem.GetConfig<CommonModel>().AddSpaceLevel && !is_showslot && !SaveData.GetSaveObject().have_slot)
|
||||
// {
|
||||
//
|
||||
// if (SaveData.GetSaveObject().addview_off_time > GameHelper.GetNowTime() && GameHelper.IsGiftSwitch())
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Open);
|
||||
// else
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuyslotUI_Open);
|
||||
// SaveData.GetSaveObject().game_fail_number = 0;
|
||||
// is_showslot = true;
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (SaveData.GetSaveObject().game_fail_number >= ConfigSystem.GetConfig<CommonModel>().AddSpaceLevel && !is_showslot && !SaveData.GetSaveObject().have_slot)
|
||||
{
|
||||
|
||||
if (SaveData.GetSaveObject().addview_off_time > GameHelper.GetNowTime() && GameHelper.IsGiftSwitch())
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Open);
|
||||
else
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuyslotUI_Open);
|
||||
SaveData.GetSaveObject().game_fail_number = 0;
|
||||
is_showslot = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if ((complte_progress > ((float)ConfigSystem.GetConfig<CommonModel>().FailedGiftProgress / 100)) && !is_resurgence&&GameHelper.IsGiftSwitch())
|
||||
{
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Open, complte_progress);
|
||||
is_resurgence = true;
|
||||
return;
|
||||
}
|
||||
// if ((complte_progress > ((float)ConfigSystem.GetConfig<CommonModel>().FailedGiftProgress / 100)) && !is_resurgence&&GameHelper.IsGiftSwitch())
|
||||
// {
|
||||
//
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Open, complte_progress);
|
||||
// is_resurgence = true;
|
||||
// return;
|
||||
// }
|
||||
|
||||
DOVirtual.DelayedCall(0.75f, () =>
|
||||
{
|
||||
@@ -1752,36 +1884,36 @@ namespace ChillConnect
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SaveData.GetSaveObject().game_fail_off_number >= ConfigSystem.GetConfig<CommonModel>().AddDiscountLevel && !is_showslot && !SaveData.GetSaveObject().have_slot && GameHelper.IsGiftSwitch())
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Open);
|
||||
SaveData.GetSaveObject().game_fail_off_number = 0;
|
||||
if (SaveData.GetSaveObject().addview_off_time < GameHelper.GetNowTime())
|
||||
{
|
||||
SaveData.GetSaveObject().addview_off_time = (int)GameHelper.GetNowTime() + ConfigSystem.GetConfig<CommonModel>().AddDiscountCD;
|
||||
}
|
||||
is_showslot = true;
|
||||
return;
|
||||
}
|
||||
// if (SaveData.GetSaveObject().game_fail_off_number >= ConfigSystem.GetConfig<CommonModel>().AddDiscountLevel && !is_showslot && !SaveData.GetSaveObject().have_slot && GameHelper.IsGiftSwitch())
|
||||
// {
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Open);
|
||||
// SaveData.GetSaveObject().game_fail_off_number = 0;
|
||||
// if (SaveData.GetSaveObject().addview_off_time < GameHelper.GetNowTime())
|
||||
// {
|
||||
// SaveData.GetSaveObject().addview_off_time = (int)GameHelper.GetNowTime() + ConfigSystem.GetConfig<CommonModel>().AddDiscountCD;
|
||||
// }
|
||||
// is_showslot = true;
|
||||
// return;
|
||||
// }
|
||||
|
||||
if (SaveData.GetSaveObject().game_fail_number >= ConfigSystem.GetConfig<CommonModel>().AddSpaceLevel && !is_showslot && !SaveData.GetSaveObject().have_slot)
|
||||
{
|
||||
|
||||
if (SaveData.GetSaveObject().addview_off_time > GameHelper.GetNowTime() && GameHelper.IsGiftSwitch())
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Open);
|
||||
else
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuyslotUI_Open);
|
||||
SaveData.GetSaveObject().game_fail_number = 0;
|
||||
is_showslot = true;
|
||||
return;
|
||||
}
|
||||
if ((complte_progress > ((float)ConfigSystem.GetConfig<CommonModel>().FailedGiftProgress / 100)) && !is_resurgence&&GameHelper.IsGiftSwitch())
|
||||
{
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Open, complte_progress);
|
||||
is_resurgence = true;
|
||||
return;
|
||||
}
|
||||
// if (SaveData.GetSaveObject().game_fail_number >= ConfigSystem.GetConfig<CommonModel>().AddSpaceLevel && !is_showslot && !SaveData.GetSaveObject().have_slot)
|
||||
// {
|
||||
//
|
||||
// if (SaveData.GetSaveObject().addview_off_time > GameHelper.GetNowTime() && GameHelper.IsGiftSwitch())
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.AddViewoffUI_Open);
|
||||
// else
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuyslotUI_Open);
|
||||
// SaveData.GetSaveObject().game_fail_number = 0;
|
||||
// is_showslot = true;
|
||||
// return;
|
||||
// }
|
||||
// if ((complte_progress > ((float)ConfigSystem.GetConfig<CommonModel>().FailedGiftProgress / 100)) && !is_resurgence&&GameHelper.IsGiftSwitch())
|
||||
// {
|
||||
//
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ResurgenceUI_Open, complte_progress);
|
||||
// is_resurgence = true;
|
||||
// return;
|
||||
// }
|
||||
//通关失败
|
||||
float[] cash_array = GameHelper.GetRewardValue(2);
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace ChillConnect
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
HallManager.Instance.UpdateSecondEvent -= upTime;
|
||||
|
||||
RankSystemMgr.Instance.upRewardAndRank();
|
||||
@@ -71,7 +72,7 @@ namespace ChillConnect
|
||||
{
|
||||
ui.group_top.y += 68;
|
||||
}
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
TrackKit.SendEvent(Property.rank_Event,Property.RankShow);
|
||||
|
||||
HallManager.Instance.UpdateSecondEvent += upTime;
|
||||
|
||||
@@ -47,6 +47,7 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
AdRedeemManager.Instance.Destroy();
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
@@ -60,6 +61,7 @@ namespace ChillConnect
|
||||
{
|
||||
ui.group_top.y += 68;
|
||||
}
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
rewardList = SaveData.GetRankData().rankRewardData;
|
||||
InitView();
|
||||
|
||||
|
||||
@@ -77,8 +77,8 @@ namespace ChillConnect
|
||||
{
|
||||
if (args == null || model.recordList == null) return;
|
||||
|
||||
Debug.Log($" barry refresh args == {args}");
|
||||
Debug.Log($" barry refresh list == {model.recordList.Count}");
|
||||
// Debug.Log($" barry refresh args == {args}");
|
||||
// Debug.Log($" barry refresh list == {model.recordList.Count}");
|
||||
if (model.recordList.Count >= 9)
|
||||
{
|
||||
model.recordList.RemoveAt(0);
|
||||
|
||||
@@ -95,7 +95,16 @@ namespace ChillConnect
|
||||
|
||||
var value = GetRewardValue();
|
||||
ui.text_num.text = GameHelper.Get101Str(value);
|
||||
ui.btn_collect.title = "Claim(<img src='ui://o9974uc5k1oncy'/>" + GameHelper.Get101Str((decimal)value) + ")";
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
ui.text_num.text = GameHelper.Get102Str(value);
|
||||
|
||||
ui.btn_collect.title = "" + GameHelper.Get102Str((decimal)value);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.btn_collect.title ="(" + "Claim(<img src='ui://o9974uc5k1oncy'/>" + GameHelper.Get101Str((decimal)value) + ")";
|
||||
}
|
||||
DOVirtual.DelayedCall(0.2f, () =>
|
||||
{
|
||||
var gamwin =
|
||||
@@ -103,6 +112,7 @@ namespace ChillConnect
|
||||
gamwin.state.SetAnimation(0, "out", true);
|
||||
});
|
||||
|
||||
ui.gift.selectedIndex = GameHelper.IsGiftSwitch()? 1 : 0;
|
||||
ui.btn_multi.SetClick(OnClickDouble);
|
||||
ui.btn_collect.SetClick(OnClickClaim);
|
||||
if (ctrl.rewardInfo.sign_in_days == 6)
|
||||
@@ -154,13 +164,14 @@ namespace ChillConnect
|
||||
}
|
||||
cash_num = value;
|
||||
|
||||
var src = GameHelper.IsGiftSwitch() ? "(" : "(<img src='ui://o9974uc5cou6b8'/>";
|
||||
(ui.wheel.GetChild("wheel_") as wheel_).t0.Play(Scroll);
|
||||
(ui.wheel.GetChild("wheel_") as wheel_).t1.Play(() =>
|
||||
{
|
||||
rate_idnex++;
|
||||
ui.btn_multi.title = "(<img src='ui://o9974uc5cou6b8'/>"+ cash_num * boost_array[rate_idnex % 5] + ")";
|
||||
ui.btn_multi.title = src + cash_num * boost_array[rate_idnex % 5] + ")";
|
||||
});
|
||||
ui.btn_multi.title = "(<img src='ui://o9974uc5cou6b8'/>" + cash_num * boost_array[4] + ")";
|
||||
ui.btn_multi.title = src + cash_num * boost_array[4] + ")";
|
||||
|
||||
list_1 = new List<item_wheel>() { (ui.wheel.GetChild("wheel_") as wheel_).item_0, (ui.wheel.GetChild("wheel_") as wheel_).item_1, (ui.wheel.GetChild("wheel_") as wheel_).item_2, (ui.wheel.GetChild("wheel_") as wheel_).item_3, (ui.wheel.GetChild("wheel_") as wheel_).item_4, (ui.wheel.GetChild("wheel_") as wheel_).item_5, (ui.wheel.GetChild("wheel_") as wheel_).item_6, (ui.wheel.GetChild("wheel_") as wheel_).item_7, };
|
||||
// list_1[2].img_light.visible = true;
|
||||
@@ -284,10 +295,17 @@ namespace ChillConnect
|
||||
list_1[i].text_rate.text = "X" + rate_list[i];
|
||||
}
|
||||
|
||||
(ui.wheel.GetChild("wheel_") as wheel_).t1.Play(() =>
|
||||
var src = "(";
|
||||
var rewards = GameHelper.Get102Str((decimal)cash_num * boost_array[rate_idnex % boost_array.Length]);
|
||||
if (!GameHelper.IsGiftSwitch()){
|
||||
src = "(<img src='ui://o9974uc5cou6b8'/>";
|
||||
rewards = GameHelper.Get101Str((decimal)cash_num * boost_array[rate_idnex % boost_array.Length]);
|
||||
}
|
||||
|
||||
(ui.wheel.GetChild("wheel_") as wheel_).t1.Play(() =>
|
||||
{
|
||||
rate_idnex++;
|
||||
ui.btn_multi.title ="(<img src='ui://o9974uc5cou6b8'/>" + GameHelper.Get101Str((decimal)cash_num * boost_array[rate_idnex % boost_array.Length]) + ")";
|
||||
ui.btn_multi.title =src + rewards + ")";
|
||||
});
|
||||
|
||||
(ui.wheel.GetChild("wheel_") as wheel_).t0.Play(Scroll);
|
||||
@@ -339,10 +357,11 @@ namespace ChillConnect
|
||||
// return;
|
||||
// }
|
||||
|
||||
var src = GameHelper.IsGiftSwitch() ? "(" : "(<img src='ui://o9974uc5cou6b8'/>";
|
||||
(ui.wheel.GetChild("wheel_") as wheel_).t1.Play(() =>
|
||||
{
|
||||
rate_idnex++;
|
||||
ui.btn_multi.title = "(<img src='ui://o9974uc5cou6b8'/>" + GameHelper.Get101Str((decimal)cash_num * boost_array[rate_idnex % boost_array.Length]) + ")";
|
||||
ui.btn_multi.title = src + GameHelper.Get101Str((decimal)cash_num * boost_array[rate_idnex % boost_array.Length]) + ")";
|
||||
});
|
||||
|
||||
(ui.wheel.GetChild("wheel_") as wheel_).t0.Play(Scroll);
|
||||
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using Dont_Confuse;
|
||||
using IgnoreOPS;
|
||||
using IgnoreOPS;
|
||||
using FairyGUI;
|
||||
using FGUI.Common_01;
|
||||
@@ -54,7 +54,8 @@ namespace ChillConnect
|
||||
HallManager.Instance.UpdateSecondEvent -= updateSpeedCD;
|
||||
HallManager.Instance.UpdateSecondEvent -= Update;
|
||||
closeCallback?.Invoke();
|
||||
WebviewManager.ShezhiACT(true);
|
||||
// WebviewManager.ShezhiACT(true);
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.RefreshSaveingPot);
|
||||
|
||||
@@ -76,7 +77,8 @@ namespace ChillConnect
|
||||
ui.group_.y += Screen.safeArea.y;
|
||||
}
|
||||
|
||||
WebviewManager.ShezhiACT(false);
|
||||
// WebviewManager.ShezhiACT(false);
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuygoldUI_Close);
|
||||
|
||||
@@ -144,7 +146,7 @@ namespace ChillConnect
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
Debug.Log(DataMgr.ExchangeAccount);
|
||||
Debug.Log($"DataMgr.ExchangeAccount====={DataMgr.ExchangeAccount.Value}");
|
||||
Makeup_2 makeupVo = ConfigSystem.GetConfig<MakeupModel_2>().GetData(makeupTaskData.tableId);
|
||||
ui.text_ad.text = string.Format(GameHelper.getDesByKey("saving_pot_5"), makeupVo.ADIncrease);
|
||||
string str = string.Format(GameHelper.getDesByKey("saving_pot_2"), makeupVo.PayIncrease);
|
||||
@@ -211,7 +213,7 @@ namespace ChillConnect
|
||||
}
|
||||
else if (makeupTaskData.status == SaveingPotTaskStatus.None)
|
||||
{
|
||||
if (DataMgr.ExchangeAccount == null)
|
||||
if (DataMgr.ExchangeAccount.Value == null)
|
||||
{
|
||||
Debug.Log("enter");
|
||||
OnEnter();
|
||||
@@ -804,7 +806,7 @@ namespace ChillConnect
|
||||
GameHelper.ShowTips("Please enter the correct account information4", true);
|
||||
return;
|
||||
}
|
||||
DataMgr.ExchangeAccount .Value= account;
|
||||
DataMgr.ExchangeAccount.Value= account;
|
||||
DataMgr.ExchangeName .Value= $"{fname} {lname}";
|
||||
DataMgr.short_name = fname;
|
||||
DataMgr.long_name = lname;
|
||||
@@ -825,17 +827,17 @@ namespace ChillConnect
|
||||
|
||||
|
||||
ui.com_pay.text_name.text = DataMgr.ExchangeName .Value;
|
||||
ui.com_pay.text_email.text = DataMgr.ExchangeAccount .Value;
|
||||
ui.com_pay.text_email.text = DataMgr.ExchangeAccount.Value;
|
||||
|
||||
ui.com_pay.btn_change.SetClick(() =>
|
||||
{
|
||||
DataMgr.ExchangeName = null;
|
||||
DataMgr.ExchangeAccount = null;
|
||||
DataMgr.ExchangeAccount.Value = null;
|
||||
OnEnter();
|
||||
|
||||
});
|
||||
|
||||
var avatarId = DataMgr.PlayerAvatarId .Value;
|
||||
var avatarId = DataMgr.PlayerAvatarId.Value;
|
||||
TextureHelper.SetAvatarToLoader(avatarId, ui.com_pay.head.GetChild("load_avatar") as GLoader);
|
||||
ui.btn_confirm.SetClick(() =>
|
||||
{
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
AdRedeemManager.Instance.Destroy();
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
GameHelper.showGameUI = true;
|
||||
HallManager.Instance.UpdateSecondEvent -= initList;
|
||||
HallManager.Instance.UpdateSecondEvent -= upWatchAdsBtn;
|
||||
@@ -78,7 +78,7 @@ namespace ChillConnect
|
||||
{
|
||||
isAutoPop = (bool)args;
|
||||
}
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
// test
|
||||
// SaveData.GetSaveObject().remove_ad_time = Convert.ToInt32(GameHelper.GetNowTime()) + 5;
|
||||
// SaveData.GetSaveObject().is_get_removead = true;
|
||||
|
||||
@@ -6,6 +6,7 @@ using DG.Tweening;
|
||||
using FairyGUI;
|
||||
using FGUI.Signin_19;
|
||||
using IgnoreOPS;
|
||||
using SGModule.Common.Extensions;
|
||||
using Spine.Unity;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -106,6 +107,8 @@ namespace ChillConnect
|
||||
|
||||
var signList = signModel.DataList;
|
||||
|
||||
ui.com_gold.visible = !GameHelper.IsGiftSwitch();
|
||||
|
||||
// Debug.Log($"signList.Count:{signList.Count}");
|
||||
for (int i = 0; i < signList.Count; i++)
|
||||
{
|
||||
@@ -123,12 +126,13 @@ namespace ChillConnect
|
||||
private void RefreshView(btn_sign btnSign, SignDailyReward reward, int index)
|
||||
{
|
||||
btnSign.title = "0" + reward.id;
|
||||
btnSign.reward_num.text = GameHelper.Get101Str(reward.quantity[0]);
|
||||
btnSign.reward_num.text = GameHelper.IsGiftSwitch()?GameHelper.getChString(reward.quantity[0]):GameHelper.Get101Str(reward.quantity[0]);
|
||||
|
||||
btnSign.day.selectedIndex = index != 6 ? 0 : 1;
|
||||
|
||||
if (index == 6)
|
||||
btnSign.day.selectedIndex = 0;
|
||||
btnSign.isGift.selectedIndex = GameHelper.IsGiftSwitch()? 1 : 0;
|
||||
if (index == 6 && reward.quantity.Length > 1)
|
||||
{
|
||||
btnSign.day.selectedIndex = 1;
|
||||
btnSign.reward_num1.text = GameHelper.Get101Str(reward.quantity[1]);
|
||||
setItemUrl(btnSign.loader_icon0, reward.rewards_type[1]);
|
||||
}
|
||||
@@ -190,6 +194,7 @@ namespace ChillConnect
|
||||
else if (urltype == 1) loader.url = "ui://Common_01/spin_remove"; //yichu
|
||||
else if (urltype == 2) loader.url = "ui://Common_01/spin_undo"; //chehui
|
||||
else if (urltype == 3) loader.url = "ui://Common_01/spin_refresh"; //shuaxin
|
||||
else if (urltype == 4) loader.url = "ui://Common_01/record_money"; //shuaxin
|
||||
}
|
||||
private Action closeCallback;
|
||||
|
||||
@@ -197,12 +202,27 @@ namespace ChillConnect
|
||||
{
|
||||
|
||||
var rewardModel = new RewardData();
|
||||
|
||||
for (var i = 0; i < vo.item1.Length; i++)
|
||||
{
|
||||
var rewardData = new RewardSingleData(101, vo.quantity[i], RewardOrigin.SignIn, sign_day)
|
||||
var points = ui.point;
|
||||
var typeId = 101;
|
||||
|
||||
var rewardNum = vo.quantity[i];
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
points = ui.point1;
|
||||
typeId = vo.item1[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
rewardNum = GameHelper.Get101Str(vo.quantity[i]).As<decimal>();
|
||||
}
|
||||
|
||||
var rewardData = new RewardSingleData(typeId, rewardNum, RewardOrigin.SignIn, sign_day)
|
||||
{
|
||||
startPosition = startPos,
|
||||
endPosition = new Vector2(ui.point.x - 110, ui.point.y - 110)
|
||||
endPosition = new Vector2(points.x - 110, points.y - 110)
|
||||
|
||||
};
|
||||
rewardModel.AddReward(rewardData);
|
||||
@@ -230,7 +250,11 @@ namespace ChillConnect
|
||||
|
||||
// 用来刷新todo界面的一些信息,如红点等
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.UpdateTodoView);
|
||||
CommonHelper.ShowNumAnim(ui.com_gold.GetChild("text_gold") as GTextField, vo.quantity[0], 101);
|
||||
|
||||
if (!GameHelper.IsGiftSwitch() || vo.item1[0] == 101)
|
||||
{
|
||||
CommonHelper.ShowNumAnim(ui.com_gold.GetChild("text_gold") as GTextField, vo.quantity[0], 101);
|
||||
}
|
||||
|
||||
|
||||
// CtrlCloseUI();
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bcb268078e9429ebdf912b4ce1f287f
|
||||
timeCreated: 1780560480
|
||||
@@ -0,0 +1,42 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class StatementViewCtrl : BaseCtrl
|
||||
{
|
||||
public static StatementViewCtrl Instance { get; private set; }
|
||||
|
||||
private StatementViewModel 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,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4632715ec0e54eeea0b7d484a9b85252
|
||||
timeCreated: 1780455331
|
||||
@@ -0,0 +1,43 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class StatementViewModel : 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: faf951d22aea4319860cef683fcbed35
|
||||
timeCreated: 1780455331
|
||||
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
// using FGUI.G002_main;
|
||||
using Spine.Unity;
|
||||
using DG.Tweening;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class StatementViewUI : BaseUI
|
||||
{
|
||||
private StatementViewUICtrl ctrl;
|
||||
private StatementViewModel model;
|
||||
private FGUI.Lobby_03.com_statement ui;
|
||||
private Action closeCallback;
|
||||
private Action open_sign;
|
||||
private bool is_get = false;
|
||||
public StatementViewUI(StatementViewUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.StatementViewUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "Lobby_03";
|
||||
uiInfo.assetName = "com_statement";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
model = ModuleManager.Instance.GetModel(ModelConst.StatementViewModel) as StatementViewModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
//open_sign();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.Lobby_03.com_statement;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
|
||||
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.list.scrollPane.onScrollEnd.Add(OnListScroll);
|
||||
ui.btn_back.SetClick(CtrlCloseUI);
|
||||
}
|
||||
|
||||
private void OnListScroll()
|
||||
{
|
||||
var pageIndex = ui.list.scrollPane.currentPageX;
|
||||
|
||||
if (pageIndex == 0)
|
||||
{
|
||||
ui.state1.state.selectedIndex = 1;
|
||||
ui.state2.state.selectedIndex = 0;
|
||||
}else if (pageIndex == 1)
|
||||
{
|
||||
ui.state1.state.selectedIndex = 0;
|
||||
ui.state2.state.selectedIndex = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 65fe960a02344337a6c757d93ecf0e2e
|
||||
timeCreated: 1780455331
|
||||
@@ -0,0 +1,71 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class StatementViewUICtrl : BaseUICtrl
|
||||
{
|
||||
private StatementViewUI ui;
|
||||
private StatementViewModel model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.StatementViewUI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.StatementViewUI_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 StatementViewUI(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,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b350591ec8f41db9c3dda52f01b53c7
|
||||
timeCreated: 1780455331
|
||||
@@ -7,6 +7,7 @@ using FairyGUI;
|
||||
using FGUI.Common_01;
|
||||
using FGUI.Turntable_11;
|
||||
using IgnoreOPS;
|
||||
using SGModule.Common.Extensions;
|
||||
using Spine.Unity;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -173,6 +174,7 @@ namespace ChillConnect
|
||||
}
|
||||
|
||||
item.text_num.text = id == 102 ? GameHelper.Get102Str((decimal)quantity) : GameHelper.Get101Str((decimal)quantity);
|
||||
Debug.Log($"wheel id=========={id}");
|
||||
item.status.selectedIndex = id == 102 ? com_coin.Status_b : com_coin.Status_a;
|
||||
}
|
||||
|
||||
@@ -279,13 +281,21 @@ namespace ChillConnect
|
||||
var id = vo.wheel_item;
|
||||
var quantity = vo.quantity;
|
||||
|
||||
if (id == 0)
|
||||
if (!GameHelper.IsGiftSwitch() && id == 102)
|
||||
{
|
||||
id = 101;
|
||||
quantity *= 10;
|
||||
}
|
||||
|
||||
// if (id == 0)
|
||||
// {
|
||||
var endui = id == 101 ? ui.point : ui.point1;
|
||||
|
||||
var startPoint = GameHelper.GetUICenterPosition(ui.startpoint);
|
||||
var endPoint = GameHelper.GetUICenterPosition(ui.point);
|
||||
var endPoint = GameHelper.GetUICenterPosition(endui);
|
||||
|
||||
var rewardData = new RewardData();
|
||||
var rewardSingleData = new RewardSingleData(101, (decimal)quantity, RewardOrigin.LuckyWheel)
|
||||
var rewardSingleData = new RewardSingleData(id, (decimal)quantity, RewardOrigin.LuckyWheel)
|
||||
{
|
||||
startPosition = startPoint,
|
||||
endPosition = new Vector2(endPoint.x - 150, endPoint.y - 136),
|
||||
@@ -298,12 +308,12 @@ namespace ChillConnect
|
||||
normalAnim.state.SetAnimation(0, "daiji", true);
|
||||
});
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.GetReward, rewardData);
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.AddItemNumber(id - 1, (int)quantity);
|
||||
GameHelper.ShowTips("Successfully received");
|
||||
}
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// GameHelper.AddItemNumber(id - 1, (int)quantity);
|
||||
// GameHelper.ShowTips("Successfully received");
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace ChillConnect
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameHelper.showGameUI = true;
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(true);
|
||||
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace ChillConnect
|
||||
}
|
||||
CommonHelper.CheckAdTimes();
|
||||
|
||||
|
||||
WebviewManager.Instance.SetDarkThough(false);
|
||||
|
||||
|
||||
if (GameHelper.GetGameday() != DateTime.Now.Day)
|
||||
|
||||
@@ -28,6 +28,8 @@ using FGUI.tixian;
|
||||
using FGUI.Toast_23;
|
||||
using FGUI.Turntable_11;
|
||||
using FGUI.ZM_AddCell_12;
|
||||
using FGUI.ZM_H5_15;
|
||||
using FGUI.ZM_Petty;
|
||||
using FGUI.ZM_Tasks_13;
|
||||
|
||||
namespace ChillConnect
|
||||
@@ -66,6 +68,8 @@ namespace ChillConnect
|
||||
Pack_16Binder.BindAll();
|
||||
ZM_AddCell_12Binder.BindAll();
|
||||
ZM_Tasks_13Binder.BindAll();
|
||||
ZM_PettyBinder.BindAll();
|
||||
ZM_H5_15Binder.BindAll();
|
||||
}
|
||||
|
||||
public static void AutoRegisterCommonPackages()
|
||||
|
||||
@@ -25,7 +25,8 @@ namespace ChillConnect
|
||||
// return _saveObject;
|
||||
// }
|
||||
|
||||
_saveObject = DataManager.Instance.LoadData(DataKeys.SaveObject, new Saveobject());
|
||||
|
||||
_saveObject = DataMgr.SaveObject.Value;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,8 +55,8 @@ namespace ChillConnect
|
||||
//
|
||||
// if (File.Exists(jsonFilePath)) File.Delete(jsonFilePath);
|
||||
// File.WriteAllText(jsonFilePath, save);
|
||||
DataManager.Instance.SaveData(DataKeys.SaveObject, _saveObject);
|
||||
|
||||
// DataManager.Instance.SaveData(DataKeys.SaveObject, _saveObject);
|
||||
DataMgr.SaveObject.Save();
|
||||
}
|
||||
public static bool battlepassred()
|
||||
{
|
||||
@@ -243,7 +244,7 @@ namespace ChillConnect
|
||||
|
||||
public int this_time_cardtype;
|
||||
|
||||
public int[] dark_Dayref;
|
||||
public List<int> dark_Dayref;
|
||||
|
||||
public ApplePayClass max_pay_object;
|
||||
public List<SaveingPotClass> saveingpot_history = new List<SaveingPotClass>();
|
||||
@@ -287,6 +288,19 @@ namespace ChillConnect
|
||||
public int ExchangeProcessMode = -1;
|
||||
public int CHProcessMode = -1;
|
||||
#endregion
|
||||
|
||||
//小额奖励
|
||||
public int PettyState;
|
||||
public string PettyAccount;
|
||||
public string PettyFirstName;
|
||||
public string PettyLastName;
|
||||
|
||||
public int PettyAmount;
|
||||
public string PettyOrderID;
|
||||
public string PettyDateTime;
|
||||
public int PettyDataLimit;
|
||||
|
||||
public bool IsGetPettyReward = false;
|
||||
}
|
||||
public class RankData
|
||||
{
|
||||
|
||||
@@ -125,6 +125,7 @@ namespace ChillConnect
|
||||
SaveData.GetSaveObject().CHProcessMode = ConfigSystem.GetConfig<CommonModel>().CHProcessMode;
|
||||
}
|
||||
CtrlDispatcher.Instance.Dispatch(CtrlMsg.Game_StartBefore);
|
||||
|
||||
SaveingPotHelper.ResetHistory();
|
||||
}
|
||||
|
||||
@@ -153,40 +154,6 @@ namespace ChillConnect
|
||||
LevelAttemptsModel_.config_name_list = LevelAttemptsModel_.DataList[0].user_name.Split(",").ToList();
|
||||
LevelAttemptsModel_.config_money_list = LevelAttemptsModel_.DataList[0].amount.Split(",").ToList();
|
||||
}
|
||||
var gameUrlsModel = GetConfig<GameUrlsModel>();
|
||||
if (gameUrlsModel != null && gameUrlsModel.DataList.Count > 0)
|
||||
{
|
||||
light_weblist.Clear();
|
||||
dark_weblist.Clear();
|
||||
web_through_str = "";
|
||||
|
||||
var allList = gameUrlsModel.DataList;
|
||||
List<int> type_list = new List<int>();
|
||||
for (int i = 0; i < allList.Count; i++)
|
||||
{
|
||||
if (allList[i].webType == 2)
|
||||
{
|
||||
if ((GameHelper.IsGiftSwitch() && allList[i].isMagic == 1) ||
|
||||
(!GameHelper.IsGiftSwitch() && allList[i].isMagic == 0))
|
||||
{
|
||||
light_weblist.Add(allList[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dark_weblist.Add(allList[i]);
|
||||
if (!type_list.Contains(allList[i].wvType))
|
||||
{
|
||||
web_through_str += allList[i].wvthrough;
|
||||
web_through_str += "|";
|
||||
type_list.Add(allList[i].wvType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
web_through_str.Remove(web_through_str.Length - 1);
|
||||
gameUrlsModel.DataList = light_weblist;
|
||||
}
|
||||
|
||||
var jsonDictionary = ConfigLoader.Instance.JsonDictionary;
|
||||
var gameConfigModel = new GameConfigModel("GameBoard");
|
||||
@@ -221,6 +188,47 @@ namespace ChillConnect
|
||||
}
|
||||
|
||||
ConfigLoader.Instance.AddConfig(gameConfigModel);
|
||||
|
||||
SetGameUrlConfig();
|
||||
}
|
||||
private static List<GameUrls> data_new;
|
||||
|
||||
public static void SetGameUrlConfig()
|
||||
{
|
||||
|
||||
|
||||
light_weblist.Clear();
|
||||
dark_weblist.Clear();
|
||||
web_through_str = "";
|
||||
data_new = GetConfig<GameUrlsModel>().DataList;
|
||||
List<int> type_list = new List<int>();
|
||||
for (int i = 0; i < data_new.Count; i++)
|
||||
{
|
||||
|
||||
if (data_new[i].webType == 2)
|
||||
{
|
||||
if (GameHelper.IsGiftSwitch() && (data_new[i].isMagic == 1)) light_weblist.Add(data_new[i]);
|
||||
else if (!GameHelper.IsGiftSwitch() && (data_new[i].isMagic == 0)) light_weblist.Add(data_new[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
dark_weblist.Add(data_new[i]);
|
||||
if (!type_list.Contains(data_new[i].wvType))
|
||||
{
|
||||
web_through_str += data_new[i].wvthrough;
|
||||
web_through_str += "|";
|
||||
type_list.Add(data_new[i].wvType);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
web_through_str.Remove(web_through_str.Length - 1);
|
||||
|
||||
Debug.Log("light_weblist-----" + light_weblist.Count);
|
||||
Debug.Log("dark_weblist-----"+ dark_weblist.Count);
|
||||
Debug.Log("////////////////////////");
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace ChillConnect
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.UpdateHotFixProgress, 97);
|
||||
|
||||
MaxADKit.SetUserID(loginData.Uid.ToString());
|
||||
// MaxADKit.SetUserID(loginData.Uid.ToString());
|
||||
|
||||
DateTimeManager.Instance.SetServerCurrTimestamp(loginData.LoginTime);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace ChillConnect
|
||||
|
||||
private void OnRequestPlayData(object args) {
|
||||
NetApi.RequestPlayerData((isSuccess, json) => {
|
||||
// Debug.Log($"barry UserData : {json}");
|
||||
Debug.Log($"barry UserData : {json}");
|
||||
if (isSuccess) {
|
||||
var loginModel = LoginKit.Instance.LoginModel;
|
||||
if (loginModel.NewPlayer || loginModel.Uid != DataMgr.UserID.Value)
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Globalization;
|
||||
using AppsFlyerSDK;
|
||||
using DG.Tweening;
|
||||
using IgnoreOPS;
|
||||
using RgfCDfHLhn9WSDK;
|
||||
using SGModule.Net;
|
||||
using SGModule.NetKit;
|
||||
using UnityEngine;
|
||||
@@ -33,125 +34,57 @@ namespace ChillConnect
|
||||
|
||||
public static void Init()
|
||||
{
|
||||
// MaxSdkCallbacks.OnSdkInitializedEvent += sdkConfiguration =>
|
||||
// {
|
||||
|
||||
|
||||
// if (PlayerPrefs.GetInt("OpenAD", 1) == 1) InitOpenAds();
|
||||
// else GameDispatcher.Instance.Dispatch(GameMsg.CloseMask);
|
||||
|
||||
// DOVirtual.DelayedCall(7, () =>
|
||||
// {
|
||||
// InitializeRewardedAds();
|
||||
// InitializeInterstitialAds();
|
||||
// });
|
||||
|
||||
// };
|
||||
MaxSdkCallbacks.OnSdkInitializedEvent += sdkConfiguration =>
|
||||
#if !UNITY_EDITOR
|
||||
// 注册 ab事件,0或1,0为自然量版本,1为激励版本
|
||||
RgfCDfHLhn9WSDK_Utility.Instance.RegistIosParam(i =>
|
||||
{
|
||||
InitializeRewardedAds();
|
||||
InitializeInterstitialAds();
|
||||
};
|
||||
SuperApplication.Instance.attribution = i == 0 ? "organic" : "non_organic";
|
||||
Debug.Log($"ios ab param : {i} attribution=== {SuperApplication.Instance.attribution}");
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
|
||||
});
|
||||
|
||||
MaxSdk.SetSdkKey(SDKKey);
|
||||
|
||||
// var loginModel = GameHelper.GetLoginModel();
|
||||
// user_id = loginModel.uid.ToString();
|
||||
// MaxSdk.SetUserId(loginModel.uid.ToString());
|
||||
// MaxSdk.SetIsAgeRestrictedUser(false);
|
||||
MaxSdk.SetHasUserConsent(true);
|
||||
MaxSdk.SetDoNotSell(false);
|
||||
|
||||
MaxSdk.InitializeSdk();
|
||||
|
||||
// MaxSdk.ShowMediationDebugger();
|
||||
|
||||
adCallbackInfo = new Dictionary<string, string>();
|
||||
void GameConfig(bool result, string config)
|
||||
{
|
||||
Debug.Log($"************* game config result : {result}, config : {config}");
|
||||
}
|
||||
// SDK初始化方法
|
||||
RgfCDfHLhn9WSDK_Utility.Instance.Init(null, null, GameConfig);
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void SetUserID(string userID)
|
||||
|
||||
|
||||
public static bool CheckInterstitialReady()
|
||||
{
|
||||
user_id = userID;
|
||||
MaxSdk.SetUserId(user_id);
|
||||
return RgfCDfHLhn9WSDK_Utility.Instance.IsInterReady();
|
||||
}
|
||||
|
||||
#region 插屏广告相关
|
||||
public static UnityAction<bool> onInterstitialAdCompleted;
|
||||
|
||||
public static void ShowInterstitial(string placement = "DefaultInterstitial",
|
||||
UnityAction<bool> onCompleted = null)
|
||||
{
|
||||
if (MaxSdk.IsInterstitialReady(interstitialADUnitID))
|
||||
if (CheckInterstitialReady())
|
||||
{
|
||||
// Debug.Log($"广告已经准备好,播放");
|
||||
MaxSdk.ShowInterstitial(interstitialADUnitID, placement);
|
||||
onInterstitialAdCompleted = onCompleted;
|
||||
|
||||
Debug.Log($"广告已经准备好,播放");
|
||||
RgfCDfHLhn9WSDK_Utility.Instance.ShowInter(placement, () =>
|
||||
{
|
||||
DOVirtual.DelayedCall(0.1f, () =>
|
||||
{
|
||||
onCompleted?.Invoke(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
// Debug.Log($"广告未准备好,不播放");
|
||||
|
||||
Debug.Log($"广告未准备好,不播放");
|
||||
onCompleted?.Invoke(false);
|
||||
}
|
||||
}
|
||||
|
||||
static int retryAttemptInterstitial;
|
||||
|
||||
public static void InitializeInterstitialAds()
|
||||
{
|
||||
|
||||
MaxSdkCallbacks.Interstitial.OnAdLoadedEvent += OnInterstitialLoadedEvent;
|
||||
MaxSdkCallbacks.Interstitial.OnAdLoadFailedEvent += OnInterstitialLoadFailedEvent;
|
||||
MaxSdkCallbacks.Interstitial.OnAdDisplayedEvent += OnInterstitialDisplayedEvent;
|
||||
MaxSdkCallbacks.Interstitial.OnAdClickedEvent += OnInterstitialClickedEvent;
|
||||
MaxSdkCallbacks.Interstitial.OnAdHiddenEvent += OnInterstitialHiddenEvent;
|
||||
MaxSdkCallbacks.Interstitial.OnAdDisplayFailedEvent += OnInterstitialAdFailedToDisplayEvent;
|
||||
MaxSdkCallbacks.Interstitial.OnAdRevenuePaidEvent += OnRewardedAdRevenueEvent;
|
||||
|
||||
|
||||
LoadInterstitial();
|
||||
}
|
||||
|
||||
private static void LoadInterstitial()
|
||||
{
|
||||
MaxSdk.LoadInterstitial(interstitialADUnitID);
|
||||
}
|
||||
|
||||
private static void OnInterstitialLoadedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
retryAttemptInterstitial = 0;
|
||||
TrackKit.SendEvent(Property.video_Event, Property.InterstitialVideosFillNumber);
|
||||
}
|
||||
|
||||
private static void OnInterstitialLoadFailedEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
|
||||
{
|
||||
retryAttemptInterstitial++;
|
||||
double retryDelay = Math.Pow(2, Math.Min(6, retryAttemptInterstitial));
|
||||
|
||||
CrazyAsyKit.StartAction("LoadInterstitial", LoadInterstitial, (float)retryDelay);
|
||||
}
|
||||
|
||||
private static void OnInterstitialDisplayedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
}
|
||||
|
||||
private static void OnInterstitialAdFailedToDisplayEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo,
|
||||
MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
LoadInterstitial();
|
||||
}
|
||||
|
||||
private static void OnInterstitialClickedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
}
|
||||
|
||||
private static void OnInterstitialHiddenEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
LoadInterstitial();
|
||||
onInterstitialAdCompleted?.Invoke(true);
|
||||
onInterstitialAdCompleted = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
//开屏相关
|
||||
public static UnityAction<bool> onAppOpenAdCompleted;
|
||||
@@ -167,256 +100,74 @@ namespace ChillConnect
|
||||
// #if UNITY_EDITOR
|
||||
// onCompleted?.Invoke(true);
|
||||
// #else
|
||||
onAppOpenAdCompleted = onCompleted;
|
||||
if (!IsLoaded)
|
||||
{
|
||||
MaxSdkCallbacks.AppOpen.OnAdLoadedEvent += ShowOpenAd;
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// bool isFinished = NetworkManager.isWatchedAD;
|
||||
// onCompleted?.Invoke(isFinished);
|
||||
ShowOpenAd(null, null);
|
||||
}
|
||||
// onAppOpenAdCompleted = onCompleted;
|
||||
// if (!IsLoaded)
|
||||
// {
|
||||
// MaxSdkCallbacks.AppOpen.OnAdLoadedEvent += ShowOpenAd;
|
||||
//
|
||||
//
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // bool isFinished = NetworkManager.isWatchedAD;
|
||||
// // onCompleted?.Invoke(isFinished);
|
||||
// ShowOpenAd(null, null);
|
||||
// }
|
||||
// #endif
|
||||
}
|
||||
public static void ShowOpenAd(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
MaxSdk.ShowAppOpenAd(AppOpenAdUnitId);
|
||||
}
|
||||
|
||||
|
||||
public static void InitOpenAds()
|
||||
{
|
||||
|
||||
MaxSdkCallbacks.AppOpen.OnAdLoadedEvent += OnAppOpenLoadedEvent;
|
||||
MaxSdkCallbacks.AppOpen.OnAdLoadFailedEvent += OnOpendAdLoadFailedEvent;
|
||||
// MaxSdkCallbacks.AppOpen.OnAdDisplayedEvent += OnInterstitialDisplayedEvent;
|
||||
MaxSdkCallbacks.AppOpen.OnAdClickedEvent += OnOpenClickedEvent;
|
||||
MaxSdkCallbacks.AppOpen.OnAdHiddenEvent += OnOpenAdHiddenEvent;
|
||||
// MaxSdkCallbacks.AppOpen.OnAdDisplayFailedEvent += OnInterstitialAdFailedToDisplayEvent;
|
||||
MaxSdkCallbacks.AppOpen.OnAdRevenuePaidEvent += OnOpenAdRevenueEvent;
|
||||
LoadAppOpenAd();
|
||||
}
|
||||
private static void OnOpenClickedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
TrackKit.SendEvent(Property.adEvent, Property.open_show);
|
||||
TrackKit.SendEvent(Property.adEvent, Property.open_show_people);
|
||||
}
|
||||
private static bool IsLoaded = false;
|
||||
private static void OnAppOpenLoadedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
IsLoaded = true;
|
||||
}
|
||||
private static void OnOpendAdLoadFailedEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
|
||||
{
|
||||
// retryAttempt++;
|
||||
// double retryDelay = Math.Pow(2, Math.Min(6, retryAttempt));
|
||||
|
||||
// CrazyAsyKit.StartAction("LoadRewardedAd", LoadRewardedAd, (float)retryDelay);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.CloseMask);
|
||||
InitializeRewardedAds();
|
||||
InitializeInterstitialAds();
|
||||
}
|
||||
private static void OnOpenAdHiddenEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
// LoadAppOpenAd();
|
||||
onAppOpenAdCompleted?.Invoke(true);
|
||||
onAppOpenAdCompleted = null;
|
||||
// if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().is_get_removead && (Random.Range(0, 100) < GameHelper.GetCommonModel().rewardinsertion))
|
||||
// {
|
||||
// TrackKit.SendEvent(Property.AfterRewardAdShow);
|
||||
|
||||
// GameHelper.ShowInterstitial("AfterReward");
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region 激励视频广告相关
|
||||
|
||||
public static UnityAction<bool> onVideoAdCompleted;
|
||||
private static string _placement = "";
|
||||
public static bool CheckRewardedReady()
|
||||
{
|
||||
return RgfCDfHLhn9WSDK_Utility.Instance.IsVideoReady();
|
||||
}
|
||||
public static void ShowVideo(string placement = "DefaultVideo", UnityAction<bool> onCompleted = null)
|
||||
{
|
||||
onVideoAdCompleted = onCompleted;
|
||||
_placement = placement;
|
||||
#if UNITY_EDITOR
|
||||
onCompleted?.Invoke(true);
|
||||
onVideoAdCompleted?.Invoke(true);
|
||||
#else
|
||||
TrackKit.SendEvent(Property.adEvent,Property.watch_ad_people);
|
||||
// NetworkKit.BuriedPoint(BuriedPointEvent.video_behavior,BuriedPointEvent.watch_ad_people,1);
|
||||
// NetworkKit.BuriedPoint(BuriedPointEvent.video_type,BuriedPointEvent.Rewarded_videos_trigger_number,1);
|
||||
TrackKit.SendEvent(Property.adEvent,Property.Rewarded_videos_trigger_number);
|
||||
|
||||
if (MaxSdk.IsRewardedAdReady(rewardedADUnitID))
|
||||
if (CheckRewardedReady())
|
||||
{
|
||||
MaxSdk.ShowRewardedAd(rewardedADUnitID, placement);
|
||||
onVideoAdCompleted=onCompleted;
|
||||
RgfCDfHLhn9WSDK_Utility.Instance.ShowRewardVideo(_placement, b =>
|
||||
{
|
||||
DOVirtual.DelayedCall(0.1f, () =>
|
||||
{
|
||||
onVideoAdCompleted?.Invoke(b);
|
||||
});
|
||||
}, ()=>
|
||||
{
|
||||
DOVirtual.DelayedCall(0.25f, () =>
|
||||
{
|
||||
Debug.Log($"激励广告关闭");
|
||||
if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().is_get_removead && (UnityEngine.Random.Range(0, 100) < GameHelper.GetCommonModel().rewardinsertion))
|
||||
{
|
||||
TrackKit.SendEvent(Property.adEvent, Property.AfterRewardAdShow);
|
||||
|
||||
GameHelper.ShowInterstitial("AfterReward");
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
bool isFinished = NetworkManager.isWatchedAD;
|
||||
onCompleted?.Invoke(isFinished);
|
||||
onVideoAdCompleted?.Invoke(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
static int retryAttempt;
|
||||
|
||||
public static void InitializeRewardedAds()
|
||||
{
|
||||
MaxSdkCallbacks.Rewarded.OnAdLoadedEvent += OnRewardedAdLoadedEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdLoadFailedEvent += OnRewardedAdLoadFailedEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdDisplayedEvent += OnRewardedAdDisplayedEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdClickedEvent += OnRewardedAdClickedEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdRevenuePaidEvent += OnRewardedAdRevenuePaidEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdHiddenEvent += OnRewardedAdHiddenEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdDisplayFailedEvent += OnRewardedAdFailedToDisplayEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdReceivedRewardEvent += OnRewardedAdReceivedRewardEvent;
|
||||
MaxSdkCallbacks.Rewarded.OnAdRevenuePaidEvent += OnInterstitialAdRevenueEvent;
|
||||
|
||||
|
||||
LoadRewardedAd();
|
||||
}
|
||||
private static void OnInterstitialAdRevenueEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
OnAdRevenuePaidEvent(adUnitId, adInfo, 2);
|
||||
}
|
||||
|
||||
private static void OnRewardedAdRevenueEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
OnAdRevenuePaidEvent(adUnitId, adInfo, 1);
|
||||
#if !GAME_RELEASE
|
||||
GameHelper.AdOverRevenueEvent(2, 0.1f);
|
||||
#endif
|
||||
}
|
||||
private static void OnOpenAdRevenueEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
OnAdRevenuePaidEvent(adUnitId, adInfo, 3);
|
||||
#if !GAME_RELEASE
|
||||
GameHelper.AdOverRevenueEvent(3, 0.1f);
|
||||
#endif
|
||||
}
|
||||
private static void LoadRewardedAd()
|
||||
{
|
||||
MaxSdk.LoadRewardedAd(rewardedADUnitID);
|
||||
}
|
||||
public static string user_id = "";
|
||||
private static void OnAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo, int adType)
|
||||
{
|
||||
|
||||
string countryCode = "USD";
|
||||
|
||||
adCallbackInfo.Clear();
|
||||
adCallbackInfo.Add("appsflyer_id", AppsFlyer.getAppsFlyerId());
|
||||
adCallbackInfo.Add("customer_user_id", user_id);
|
||||
adCallbackInfo.Add("af_currency", countryCode);
|
||||
|
||||
//广告收益上传(扣量)((用户累计收益大于0.1上报50%,50%可配置))
|
||||
double revenue = Convert.ToDouble(PlayerPrefs.GetString($"adInfoRevenue_{user_id}", "0"));
|
||||
revenue += adInfo.Revenue;
|
||||
if (adInfo.Revenue > 0)
|
||||
{
|
||||
GameHelper.AdOverRevenueEvent(adType, (float)adInfo.Revenue);
|
||||
}
|
||||
// Debug.Log($"revenue: {revenue} \n adInfo.Revenue: {adInfo.Revenue}");
|
||||
|
||||
// if (revenue >= RevenueThreshold)
|
||||
// {
|
||||
adCallbackInfo.Add("af_revenue", revenue.ToString(CultureInfo.InvariantCulture));
|
||||
AppsFlyer.sendEvent("af_ad_revenue", adCallbackInfo);
|
||||
PlayerPrefs.SetString($"adInfoRevenue_{user_id}", "0");
|
||||
|
||||
int adrate = ConfigSystem.GetConfig<CommonModel>().adrate / 100;
|
||||
double revenueAdrate = revenue * adrate;
|
||||
adCallbackInfo["af_revenue"] = revenueAdrate.ToString(CultureInfo.InvariantCulture);
|
||||
AppsFlyer.sendEvent("Af_new_ad_revenue", adCallbackInfo);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// PlayerPrefs.SetString($"adInfoRevenue_{user_id}", revenue.ToString());
|
||||
// }
|
||||
|
||||
int highSend;
|
||||
if (!PlayerPrefs.HasKey($"sendHighRevenue_{user_id}"))
|
||||
{
|
||||
highSend = 0; // 如果不存在,则初始化为 0
|
||||
}
|
||||
else
|
||||
{
|
||||
highSend = PlayerPrefs.GetInt($"sendHighRevenue_{user_id}", 0); // 从 PlayerPrefs 中获取
|
||||
}
|
||||
// 判断是否需要发送高收入事件
|
||||
// Debug.Log($"highSend=====: {highSend}");
|
||||
if (highSend == 0)
|
||||
{
|
||||
float limitNum = GameHelper.GetCommonModel().afSendLimit;
|
||||
var totalNum = Convert.ToDouble(PlayerPrefs.GetString($"adRevenueTotal_{user_id}", "0"));
|
||||
totalNum += adInfo.Revenue;
|
||||
// Debug.Log($"totalNum=====: {totalNum} {limitNum}");
|
||||
if (totalNum >= limitNum)
|
||||
{
|
||||
GameHelper.sendHighRevenueToAF(); // 发送高收入事件
|
||||
PlayerPrefs.SetInt($"sendHighRevenue_{user_id}", 1); // 标记已发送
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerPrefs.SetString($"adRevenueTotal_{user_id}", totalNum.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
private static void OnRewardedAdLoadedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
retryAttempt = 0;
|
||||
}
|
||||
|
||||
private static void OnRewardedAdLoadFailedEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo)
|
||||
{
|
||||
retryAttempt++;
|
||||
double retryDelay = Math.Pow(2, Math.Min(6, retryAttempt));
|
||||
|
||||
CrazyAsyKit.StartAction("LoadRewardedAd", LoadRewardedAd, (float)retryDelay);
|
||||
}
|
||||
|
||||
private static void OnRewardedAdDisplayedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
}
|
||||
|
||||
private static void OnRewardedAdFailedToDisplayEvent(string adUnitId, MaxSdkBase.ErrorInfo errorInfo,
|
||||
MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
LoadRewardedAd();
|
||||
}
|
||||
|
||||
private static void OnRewardedAdClickedEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
}
|
||||
|
||||
private static void OnRewardedAdHiddenEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
LoadRewardedAd();
|
||||
onVideoAdCompleted?.Invoke(true);
|
||||
onVideoAdCompleted = null;
|
||||
if (GameHelper.IsGiftSwitch() && !SaveData.GetSaveObject().is_get_removead && (Random.Range(0, 100) < GameHelper.GetCommonModel().rewardinsertion))
|
||||
{
|
||||
TrackKit.SendEvent(Property.adEvent, Property.AfterRewardAdShow);
|
||||
|
||||
GameHelper.ShowInterstitial("AfterReward");
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnRewardedAdReceivedRewardEvent(string adUnitId, MaxSdkBase.Reward reward,
|
||||
MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
|
||||
#if !GAME_RELEASE
|
||||
GameHelper.AdOverRevenueEvent(1, 0.1f);
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void OnRewardedAdRevenuePaidEvent(string adUnitId, MaxSdkBase.AdInfo adInfo)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ public partial class Property
|
||||
public static readonly string withdraw_Event = TrackEvent.Register("withdraw_behavior");
|
||||
public static readonly string rank_Event = TrackEvent.Register("rank_show");
|
||||
public static readonly string video_Event = TrackEvent.Register("video_type");
|
||||
public static readonly string Event = TrackEvent.Register("Hall_behavior");
|
||||
|
||||
|
||||
#region 加盒子
|
||||
|
||||
@@ -1,34 +1,839 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using ChillConnect;
|
||||
using FairyGUI;
|
||||
using Newtonsoft.Json;
|
||||
using SGModule.Net;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Dont_Confuse
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using DG.Tweening;
|
||||
using IgnoreOPS;
|
||||
using SGModule.NetKit;
|
||||
|
||||
namespace IgnoreOPS
|
||||
{
|
||||
|
||||
|
||||
public class WebviewManager : MonoBehaviour
|
||||
{
|
||||
public static void DakaiACT()
|
||||
// Vector2 startPos;
|
||||
// float lastTouchTime = 0f;
|
||||
// float touchInterval = 0.3f;
|
||||
// void Update()
|
||||
// {
|
||||
// #if UNITY_IOS && !UNITY_EDITOR
|
||||
// if(Input.touchCount > 0)
|
||||
// {
|
||||
// Touch touch_ = Input.GetTouch(0);
|
||||
//
|
||||
// if(touch_.phase == TouchPhase.Began)
|
||||
// {
|
||||
// startPos = touch_.position;
|
||||
// lastTouchTime = Time.time;
|
||||
// }
|
||||
// if(touch_.phase == TouchPhase.Ended)
|
||||
// {
|
||||
// if ((Time.time - lastTouchTime) < touchInterval){
|
||||
// // if (WebViewMgr.Instance.WebUIType == WebUIType.H5 && EventSystem.current.currentSelectedGameObject == null){
|
||||
// // BrigdeIOS.SetTouchWebview(true, true);
|
||||
// // }else{
|
||||
// // BrigdeIOS.SetTouchWebview(true);
|
||||
// // }
|
||||
// BrigdeIOS.SetClickView();
|
||||
// }
|
||||
// }
|
||||
// // if(touch_.phase == TouchPhase.Moved){
|
||||
// // Vector2 delta = touch_.position - startPos;
|
||||
// // // Debug.Log("delta Y: " + delta.y);
|
||||
// // BrigdeIOS.ScrollWebview(delta.x, delta.y);
|
||||
// // startPos = touch_.position;
|
||||
// // }
|
||||
// }
|
||||
// #endif
|
||||
// }
|
||||
public static WebviewManager Instance;
|
||||
public WebviewManager()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
public void OpenWebView(string url)
|
||||
{
|
||||
//Debug.Log("[WebviewManager] OpenWebView");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
// BrigdeIOS.DakaiACT();
|
||||
BrigdeIOS.OpenWebview(url);
|
||||
#endif
|
||||
}
|
||||
public static void ShezhiACT(bool though)
|
||||
public void showDarkWebview()
|
||||
{
|
||||
//Debug.Log("[WebviewManager] OpenWebView");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
// BrigdeIOS.ShezhiACT(though);
|
||||
BrigdeIOS.showDarkWebview();
|
||||
#endif
|
||||
}
|
||||
public void haveSimCard(string have)
|
||||
|
||||
public void CloseWebview()
|
||||
{
|
||||
if (have == "TRUE") NetworkManager.haveSimCard = true;
|
||||
//Debug.Log("[WebviewManager] CloseWebview");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.CloseWebview();
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetOffset(int offset_y, int offset_y1)
|
||||
{
|
||||
// Debug.Log($"barry [WebviewManager] SetOffset:{offset_y}, {offset_y1}");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetOffset(offset_y, offset_y1);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetPadding(float left, float top, float right, float bottom)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetPadding");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetPadding(left, top, right, bottom);
|
||||
#endif
|
||||
}
|
||||
public void SetDarkThough(bool though)
|
||||
{
|
||||
if (!GameHelper.IsGiftSwitch()) return;
|
||||
// if (though)
|
||||
// {
|
||||
// if (UI.Instance.IsExistUI(UIConst.LevelSuccessUI) || UI.Instance.IsExistUI(UIConst.MakeupConfirmUI) ||
|
||||
// UI.Instance.IsExistUI(UIConst.NewTaskUI) || UI.Instance.IsExistUI(UIConst.PackrewardUI) || UI.Instance.IsExistUI(UIConst.SaveingPotUI)
|
||||
// )
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// }
|
||||
// Debug.Log("[WebviewManager] SetPadding");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetDarkThough(though);
|
||||
#endif
|
||||
}
|
||||
public void SetBtn(int left, int top, int right, int bottom)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetBtn");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetBtn(left, top, right, bottom);
|
||||
#endif
|
||||
}
|
||||
public void SetCTEnable(bool flag)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetCTEnable");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetCTEnable(flag);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetFullScreen()
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetFullScreen");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetFullScreen();
|
||||
#endif
|
||||
}
|
||||
|
||||
public void addH5Field(int field1, int field2, int field3, int field4, int field5, string field6, string field7, string dark_url, string light_url, bool is_gift, string web_through_str, string click_add_time)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.addH5Field(field1,field2,field3,field4,field5,field6,field7,dark_url,light_url,is_gift,web_through_str,click_add_time);
|
||||
#endif
|
||||
}
|
||||
public void ShowH5View(bool flag)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetCTEnable");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.ShowH5View(flag);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void SetIconProgress(float val)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetCTEnable");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.SetIconProgress(val);
|
||||
#endif
|
||||
}
|
||||
public void setInH5View(bool flag)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetCTEnable");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.setInH5View(flag);
|
||||
#endif
|
||||
}
|
||||
public void upDataH5times(string weblink, int times, bool is_dark)
|
||||
{
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.upDataH5times( weblink, times,is_dark);
|
||||
#endif
|
||||
}
|
||||
public void ShowFlyBtn(bool flag)
|
||||
{
|
||||
// Debug.Log("[WebviewManager] SetCTEnable");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.ShowFlyBtn(flag);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void setFlyBtnTag(bool flag)
|
||||
{
|
||||
// Debug.Log($"[WebviewManager] setFlyBtnTag ---{flag}");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.setFlyBtnTag(flag);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void setRewardBtnTag(bool flag)
|
||||
{
|
||||
// Debug.Log($"[WebviewManager] setRewardBtnTag--- {flag}");
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
BrigdeIOS.setRewardBtnTag(flag);
|
||||
#endif
|
||||
}
|
||||
|
||||
public void ObjC_TouchClick(string name)
|
||||
{
|
||||
// Debug.Log("Touch click: " + name);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.H5ViewClickBtn, name);
|
||||
}
|
||||
public void H5AutoRefresh(string times)
|
||||
{
|
||||
if (times == "") return;
|
||||
DateTime newDate = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
newDate = newDate.AddSeconds(GameHelper.GetNowTime(true));
|
||||
var newDays = newDate.Day;
|
||||
|
||||
|
||||
if (times == "Dailyrefreshtimes")
|
||||
{
|
||||
var last_time = PlayerPrefs.GetInt("Dayreftimes", 0);
|
||||
|
||||
if (last_time == newDays)
|
||||
{
|
||||
var numbers = PlayerPrefs.GetInt("Dailyrefreshnum", 0);
|
||||
numbers++;
|
||||
PlayerPrefs.SetInt("Dailyrefreshnum", numbers);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
PlayerPrefs.SetInt("Dailyrefreshnum", 1);
|
||||
PlayerPrefs.SetInt("Dayreftimes", newDays);
|
||||
string darkWVRefreshtime_str = "";
|
||||
string darkWVDailyrefreshtimes_str = "";
|
||||
|
||||
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime.Length; i++)
|
||||
// {
|
||||
// if (i != 0) darkWVRefreshtime_str += "|";
|
||||
// darkWVRefreshtime_str += ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime[i].ToString();
|
||||
// }
|
||||
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime2.Length; i++)
|
||||
// {
|
||||
// darkWVRefreshtime_str += "|";
|
||||
// darkWVRefreshtime_str += ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime2[i].ToString();
|
||||
// }
|
||||
|
||||
int dark_type = -1;
|
||||
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
|
||||
{
|
||||
if (dark_type != ConfigSystem.dark_weblist[i].wvType)
|
||||
{
|
||||
if (i != 0) darkWVRefreshtime_str += "|";
|
||||
darkWVRefreshtime_str += ConfigSystem.dark_weblist[i].darkWVRefreshtime[0];
|
||||
darkWVRefreshtime_str += "|";
|
||||
darkWVRefreshtime_str += ConfigSystem.dark_weblist[i].darkWVRefreshtime[1];
|
||||
dark_type = ConfigSystem.dark_weblist[i].wvType;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes.Length; i++)
|
||||
// {
|
||||
// if (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
// darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[i].ToString();
|
||||
// }
|
||||
|
||||
dark_type = -1;
|
||||
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
|
||||
{
|
||||
if (dark_type != ConfigSystem.dark_weblist[i].wvType)
|
||||
{
|
||||
if (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
darkWVDailyrefreshtimes_str += ConfigSystem.dark_weblist[i].darkWVDailyrefreshtimes;
|
||||
dark_type = ConfigSystem.dark_weblist[i].wvType;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
WebviewManager.Instance.addH5Field(ConfigSystem.GetConfig<CommonModel>().flyCtRate, ConfigSystem.GetConfig<CommonModel>().otherH5switch,
|
||||
ConfigSystem.GetConfig<CommonModel>().H5Refreshtime, ConfigSystem.GetConfig<CommonModel>().Dailyrefreshtimes, ConfigSystem.GetConfig<CommonModel>().darkThoughProbability, darkWVRefreshtime_str,
|
||||
darkWVDailyrefreshtimes_str, "", "", GameHelper.IsGiftSwitch(), "", "");
|
||||
}
|
||||
}
|
||||
else if (times.Contains("dark_Dailyrefreshtimes"))
|
||||
{
|
||||
var last_time = PlayerPrefs.GetInt("dark_refreshDay", 0);
|
||||
if (last_time == newDays)
|
||||
{
|
||||
// var numbers = PlayerPrefs.GetInt("dark_Dayref", 0);
|
||||
// numbers++;
|
||||
// PlayerPrefs.SetInt("dark_Dayref", numbers);
|
||||
string[] temp_arr = times.Split("|");
|
||||
if (temp_arr.Length >= 2)
|
||||
{
|
||||
SaveData.GetSaveObject().dark_Dayref[Int32.Parse(temp_arr[1])]++;
|
||||
SaveData.saveDataFunc();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
// PlayerPrefs.SetInt("dark_Dayref", 1);
|
||||
string[] temp_arr = times.Split("|");
|
||||
if (temp_arr.Length >= 2)
|
||||
{
|
||||
SaveData.GetSaveObject().dark_Dayref[Int32.Parse(temp_arr[1])] = 1;
|
||||
SaveData.saveDataFunc();
|
||||
}
|
||||
PlayerPrefs.SetInt("dark_refreshDay", newDays);
|
||||
string darkWVRefreshtime_str = "";
|
||||
string darkWVDailyrefreshtimes_str = "";
|
||||
|
||||
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime.Length; i++)
|
||||
// {
|
||||
// if (i != 0) darkWVRefreshtime_str += "|";
|
||||
// darkWVRefreshtime_str += ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime[i].ToString();
|
||||
// }
|
||||
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime2.Length; i++)
|
||||
// {
|
||||
// darkWVRefreshtime_str += "|";
|
||||
// darkWVRefreshtime_str += ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime2[i].ToString();
|
||||
// }
|
||||
int dark_type = -1;
|
||||
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
|
||||
{
|
||||
if (dark_type != ConfigSystem.dark_weblist[i].wvType)
|
||||
{
|
||||
if (i != 0) darkWVRefreshtime_str += "|";
|
||||
darkWVRefreshtime_str += ConfigSystem.dark_weblist[i].darkWVRefreshtime[0];
|
||||
darkWVRefreshtime_str += "|";
|
||||
darkWVRefreshtime_str += ConfigSystem.dark_weblist[i].darkWVRefreshtime[1];
|
||||
dark_type = ConfigSystem.dark_weblist[i].wvType;
|
||||
}
|
||||
}
|
||||
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes.Length; i++)
|
||||
// {
|
||||
// if (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
// darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[i].ToString();
|
||||
// }
|
||||
|
||||
dark_type = -1;
|
||||
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
|
||||
{
|
||||
if (dark_type != ConfigSystem.dark_weblist[i].wvType)
|
||||
{
|
||||
if (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
darkWVDailyrefreshtimes_str += ConfigSystem.dark_weblist[i].darkWVDailyrefreshtimes;
|
||||
dark_type = ConfigSystem.dark_weblist[i].wvType;
|
||||
}
|
||||
}
|
||||
WebviewManager.Instance.addH5Field(ConfigSystem.GetConfig<CommonModel>().flyCtRate, ConfigSystem.GetConfig<CommonModel>().otherH5switch,
|
||||
ConfigSystem.GetConfig<CommonModel>().H5Refreshtime, ConfigSystem.GetConfig<CommonModel>().Dailyrefreshtimes, ConfigSystem.GetConfig<CommonModel>().darkThoughProbability, darkWVRefreshtime_str,
|
||||
darkWVDailyrefreshtimes_str, "", "", GameHelper.IsGiftSwitch(), "", "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
string[] temp_array = times.Split("|");
|
||||
if (temp_array.Length >= 2 && temp_array[0] != null && temp_array[0] != "")
|
||||
{
|
||||
if (temp_array[1] == "h5")
|
||||
{
|
||||
|
||||
H5sendClass info = new H5sendClass() { link = temp_array[0], type = "h5" };
|
||||
NetApi.H5RefreshTimes<H5refreshTimes>(temp_array[0], "h5", (isSuccess, obj) =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
|
||||
int numbers = 0;
|
||||
for (int i = 0; i < ConfigSystem.light_weblist.Count; i++)
|
||||
{
|
||||
if (ConfigSystem.light_weblist[i].webLink == temp_array[0])
|
||||
{
|
||||
// Debug.Log("uuuuuuuuuuuuuuuuu明穿透" + temp_array[0] + "已经刷新了" + obj.times + "次" + "上限是" + ConfigSystem.light_weblist[i].refreshMax + "次");
|
||||
numbers = ConfigSystem.light_weblist[i].refreshMax - obj.times;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (numbers < 0) numbers = 0;
|
||||
upDataH5times(temp_array[0], numbers, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
H5sendClass info = new H5sendClass() { link = temp_array[0], type = "h6" };
|
||||
NetApi.H5RefreshTimes<H5refreshTimes>(temp_array[0], "h6", (isSuccess, obj) =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
int numbers = 0;
|
||||
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
|
||||
{
|
||||
if (ConfigSystem.dark_weblist[i].webLink == temp_array[0])
|
||||
{
|
||||
// Debug.Log("uuuuuuuuuuuuuuuuu暗穿透" + temp_array[0] + "已经刷新了" + obj.times + "次" + "上限是" + ConfigSystem.dark_weblist[i].refreshMax + "次");
|
||||
numbers = ConfigSystem.dark_weblist[i].refreshMax - obj.times;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (numbers < 0) numbers = 0;
|
||||
upDataH5times(temp_array[0], numbers, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private GList select_glist;
|
||||
private float select_glist_y;
|
||||
public void TouchClickPoint(string name)
|
||||
{
|
||||
// Debug.Log("TouchClickPoint" + name);
|
||||
if (name == null) return;
|
||||
if (name == "flyBtn")
|
||||
{
|
||||
// NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior, BuriedPointEvent.fly_ct_number, 1);
|
||||
//NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior,BuriedPointEvent.fly_ct_people,1);
|
||||
TrackKit.SendEvent(Property.Event, Property.FlyCtNumber);
|
||||
|
||||
}
|
||||
|
||||
if (name == "rewardBtn")
|
||||
{
|
||||
// NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior, BuriedPointEvent.annular_ct_number, 1);
|
||||
//NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior,BuriedPointEvent.annular_ct_people,1);
|
||||
TrackKit.SendEvent(Property.Event, Property.AnnularCtNumber);
|
||||
|
||||
}
|
||||
|
||||
if (name == "finish")
|
||||
{
|
||||
// NetworkKit.BuriedPoint(BuriedPointEvent.Hall_behavior, BuriedPointEvent.annular_finish_number, 1);
|
||||
TrackKit.SendEvent(Property.Event, Property.AnnularFinishNumber);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
string[] a = name.Split("|");
|
||||
if (a.Length < 2) return;
|
||||
if (!float.TryParse(a[0], out float x) || !float.TryParse(a[1], out float y))
|
||||
{
|
||||
Debug.LogError("Invalid format for coordinates: " + name);
|
||||
return;
|
||||
}
|
||||
|
||||
Vector2 fguiScreenPos = new(x * GRoot.inst.width, y * GRoot.inst.height);
|
||||
|
||||
// Debug.Log("mmmmmmmmmmmmmmmmmm" + a[0]);
|
||||
// Debug.Log("mmmmmmmmmmmmmmmmmm" + a[1]);
|
||||
// if (AppConst.DeviceLangue == "pt")
|
||||
// {
|
||||
// fguiScreenPos = new Vector2((float.Parse(a[0]) * GRoot.inst.width) / 1000000.0f,
|
||||
// float.Parse(a[1]) * GRoot.inst.height / 1000000.0f);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
|
||||
//}
|
||||
GButton objUnderPoint = null;
|
||||
|
||||
var child_array = GRoot.inst.GetChildren().Reverse();
|
||||
bool click_card = true;
|
||||
foreach (GComponent child in child_array) //normal
|
||||
{
|
||||
if (child.GetChildren().Length > 0)
|
||||
{
|
||||
var com_array = child.GetChildren().Reverse();
|
||||
foreach (GComponent com_child in com_array) //com_层面
|
||||
{
|
||||
if (child.name == "Popup" || child.name == "Highest")
|
||||
{
|
||||
click_card = false;/* */
|
||||
}
|
||||
var btn_array = com_child.GetChildren();
|
||||
for (int i = btn_array.Length - 1; i >= 0; i--) //btn_层面
|
||||
{
|
||||
// if (btn_array[i] .name=="btn_collect")
|
||||
// {
|
||||
// Debug.Log(btn_array[i].x);
|
||||
// Debug.Log(btn_array[i].y);
|
||||
// Debug.Log(fguiScreenPos.x);
|
||||
// Debug.Log(fguiScreenPos.y);
|
||||
// Debug.Log(btn_array[i].position.x <= fguiScreenPos.x &&
|
||||
// fguiScreenPos.x <= btn_array[i].position.x + btn_array[i].width);
|
||||
// Debug.Log( btn_array[i].position.y <= fguiScreenPos.y &&
|
||||
// fguiScreenPos.y <= btn_array[i].position.y + btn_array[i].height);
|
||||
// }
|
||||
|
||||
if (btn_array[i] is GButton)
|
||||
{
|
||||
GButton temp = btn_array[i] as GButton;
|
||||
|
||||
if (temp.onStage && temp.visible && temp.position.x <= fguiScreenPos.x &&
|
||||
fguiScreenPos.x <= temp.position.x + temp.width &&
|
||||
temp.position.y <= fguiScreenPos.y &&
|
||||
fguiScreenPos.y <= temp.position.y + temp.height)
|
||||
{
|
||||
objUnderPoint = btn_array[i] as GButton;
|
||||
if (objUnderPoint.enabled)
|
||||
{
|
||||
objUnderPoint.FireClick(true, true);
|
||||
}
|
||||
else objUnderPoint.FireClick(true, false);
|
||||
goto EndLoop;
|
||||
}
|
||||
}
|
||||
|
||||
else if (btn_array[i] is GTextInput)
|
||||
{
|
||||
|
||||
GTextInput temp = btn_array[i] as GTextInput;
|
||||
if (temp.onStage && temp.visible && temp.position.x <= fguiScreenPos.x &&
|
||||
fguiScreenPos.x <= temp.position.x + temp.width &&
|
||||
temp.position.y <= fguiScreenPos.y &&
|
||||
fguiScreenPos.y <= temp.position.y + temp.height)
|
||||
{
|
||||
|
||||
temp.RequestFocus();
|
||||
goto EndLoop;
|
||||
}
|
||||
|
||||
}
|
||||
else if (btn_array[i] is GList)
|
||||
{
|
||||
|
||||
GList temp = btn_array[i] as GList;
|
||||
if (temp.onStage && temp.visible && temp.position.x <= fguiScreenPos.x &&
|
||||
fguiScreenPos.x <= temp.position.x + temp.width &&
|
||||
temp.position.y <= fguiScreenPos.y &&
|
||||
fguiScreenPos.y <= temp.position.y + temp.height)
|
||||
{
|
||||
if (select_glist == null)
|
||||
{
|
||||
select_glist_y = fguiScreenPos.y;
|
||||
select_glist = btn_array[i] as GList;
|
||||
}
|
||||
else
|
||||
{
|
||||
select_glist.scrollPane.posY -= (fguiScreenPos.y - select_glist_y);
|
||||
select_glist_y = fguiScreenPos.y;
|
||||
}
|
||||
|
||||
goto EndLoop;
|
||||
}
|
||||
|
||||
}
|
||||
else if (btn_array[i] is GComponent)
|
||||
{
|
||||
var child_btn_array = btn_array[i].asCom.GetChildren(); //嵌套的com
|
||||
|
||||
for (int j = child_btn_array.Length - 1; j >= 0; j--)
|
||||
{
|
||||
if (child_btn_array[j] is GButton)
|
||||
{
|
||||
Vector2 local_pos = new Vector2(btn_array[i].x + child_btn_array[j].x,
|
||||
btn_array[i].y + child_btn_array[j].y);
|
||||
if (child_btn_array[j].visible && child_btn_array[j].onStage && child_btn_array[j].visible && local_pos.x <= fguiScreenPos.x &&
|
||||
fguiScreenPos.x <= local_pos.x + child_btn_array[j].width &&
|
||||
local_pos.y <= fguiScreenPos.y && fguiScreenPos.y <=
|
||||
local_pos.y + child_btn_array[j].height)
|
||||
{
|
||||
objUnderPoint = child_btn_array[j] as GButton;
|
||||
if (objUnderPoint.enabled) objUnderPoint.FireClick(true, true);
|
||||
else objUnderPoint.FireClick(true, false);
|
||||
goto EndLoop;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if (child.name == "Popup" || child.name == "Highest")
|
||||
{
|
||||
goto EndLoop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EndLoop: Debug.Log("");
|
||||
if (click_card)
|
||||
{
|
||||
if (orthoCamera == null) orthoCamera = GameObject.Find("GameCamera").GetComponent<Camera>();
|
||||
Ray ray = orthoCamera.ScreenPointToRay(new Vector2(float.Parse(a[0]) * Screen.width, (1 - float.Parse(a[1])) * Screen.height));
|
||||
RaycastHit hit;
|
||||
int layerMask = 1 << 6;
|
||||
|
||||
if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask))
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.card_click, hit.collider.gameObject.name);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public Camera orthoCamera;
|
||||
|
||||
public static Dictionary<string, string> adCallbackInfo = new Dictionary<string, string>();
|
||||
public void SendH5Event(string numbers)
|
||||
{
|
||||
|
||||
// adCallbackInfo.Clear();
|
||||
// adCallbackInfo.Add("h5_revenue",ConfigSystem.GetConfig<CommonModel>().h5_refreshRevenue.ToString());
|
||||
// //Debug.Log("sssssssssssssssssss"+JsonConvert.SerializeObject(adCallbackInfo));
|
||||
// AppsFlyer.sendEvent("Growing_Total_01_002",adCallbackInfo);
|
||||
}
|
||||
|
||||
public void RefreshUrl()
|
||||
{
|
||||
|
||||
// if (gameUrlInfo == null) return;
|
||||
//TODO: show invisible h5
|
||||
var Dailyrefresh_reamain = 0;
|
||||
var last_time = PlayerPrefs.GetInt("Dayreftimes", 0);
|
||||
DateTime newDate = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
newDate = newDate.AddSeconds(GameHelper.GetNowTime());
|
||||
var newDays = newDate.Day;
|
||||
|
||||
|
||||
|
||||
if (last_time == newDays)
|
||||
{
|
||||
Dailyrefresh_reamain = ConfigSystem.GetConfig<CommonModel>().Dailyrefreshtimes -
|
||||
PlayerPrefs.GetInt("Dailyrefreshnum", 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayerPrefs.SetInt("Dailyrefreshnum", 0);
|
||||
Dailyrefresh_reamain = ConfigSystem.GetConfig<CommonModel>().Dailyrefreshtimes;
|
||||
PlayerPrefs.SetInt("Dayreftimes", newDays);
|
||||
}
|
||||
|
||||
int dark_last_time = PlayerPrefs.GetInt("dark_refreshDay", 0);
|
||||
|
||||
DateTime dark_newDate = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
|
||||
dark_newDate = dark_newDate.AddSeconds(GameHelper.GetNowTime());
|
||||
var dark_newDays = dark_newDate.Day;
|
||||
|
||||
|
||||
string darkWVDailyrefreshtimes_str = "";
|
||||
|
||||
|
||||
if (SaveData.GetSaveObject().dark_Dayref == null)
|
||||
{
|
||||
SaveData.GetSaveObject().dark_Dayref = new List<int>() { 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0,0};
|
||||
}
|
||||
|
||||
if (dark_last_time == dark_newDays)
|
||||
{
|
||||
// dark_Dailyrefresh_reamain = ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[Int32.Parse(webview_index) - 1] -
|
||||
// PlayerPrefs.GetInt("dark_Dayref", 0);
|
||||
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes.Length; i++)
|
||||
// {
|
||||
|
||||
// if (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
// darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[i] - SaveData.GetSaveObject().dark_Dayref[i];
|
||||
|
||||
// }
|
||||
int dark_type_ = -1;
|
||||
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
|
||||
{
|
||||
if (dark_type_ != ConfigSystem.dark_weblist[i].wvType)
|
||||
{
|
||||
dark_type_ = ConfigSystem.dark_weblist[i].wvType;
|
||||
if (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
Debug.Log(dark_type_);
|
||||
darkWVDailyrefreshtimes_str += ConfigSystem.dark_weblist[i].darkWVDailyrefreshtimes - SaveData.GetSaveObject().dark_Dayref[dark_type_ - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// PlayerPrefs.SetInt("dark_Dayref", 0);
|
||||
for (int i = 0; i < SaveData.GetSaveObject().dark_Dayref.Count; i++)
|
||||
{
|
||||
SaveData.GetSaveObject().dark_Dayref[i] = 0;
|
||||
}
|
||||
SaveData.saveDataFunc();
|
||||
// dark_Dailyrefresh_reamain = ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[Int32.Parse(webview_index)];
|
||||
|
||||
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes.Length; i++)
|
||||
// {
|
||||
|
||||
// if (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
// darkWVDailyrefreshtimes_str += ConfigSystem.GetConfig<CommonModel>().darkWVDailyrefreshtimes[i];
|
||||
|
||||
// }
|
||||
int dark_type_ = -1;
|
||||
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
|
||||
{
|
||||
if (dark_type_ != ConfigSystem.dark_weblist[i].wvType)
|
||||
{
|
||||
dark_type_ = ConfigSystem.dark_weblist[i].wvType;
|
||||
if (i != 0) darkWVDailyrefreshtimes_str += "|";
|
||||
darkWVDailyrefreshtimes_str += ConfigSystem.dark_weblist[i].darkWVDailyrefreshtimes;
|
||||
}
|
||||
}
|
||||
PlayerPrefs.SetInt("dark_refreshDay", dark_newDays);
|
||||
}
|
||||
|
||||
// var last_login_time = PlayerPrefs.GetInt("last_login_time", 0);//获取上次登录日期
|
||||
// PlayerPrefs.SetInt("last_login_time", newDays);
|
||||
|
||||
string light_str = "";
|
||||
string dark_str = "";
|
||||
|
||||
for (int i = 0; i < ConfigSystem.light_weblist.Count; i++)
|
||||
{
|
||||
int can_refresh_numbners = 0;
|
||||
// if (last_login_time==newDays)
|
||||
// {
|
||||
// can_refresh_numbners=ConfigSystem.light_weblist[i].refreshMax- PlayerPrefs.GetInt(ConfigSystem.light_weblist[i].webLink, 0);
|
||||
// if (can_refresh_numbners < 0) can_refresh_numbners = 0;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
can_refresh_numbners = ConfigSystem.light_weblist[i].refreshMax;
|
||||
//if (can_refresh_numbners < 0) can_refresh_numbners = 9999999;
|
||||
// PlayerPrefs.SetInt(ConfigSystem.light_weblist[i].webLink, 0);
|
||||
// }
|
||||
|
||||
if (i != 0)
|
||||
{
|
||||
light_str += "|";
|
||||
}
|
||||
|
||||
light_str += ConfigSystem.light_weblist[i].webLink + "#" + ConfigSystem.light_weblist[i].probability + "#" + can_refresh_numbners + "#" + ConfigSystem.light_weblist[i].darkWebTimesCT; ;
|
||||
}
|
||||
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
|
||||
{
|
||||
int can_refresh_numbners = 0;
|
||||
// if (last_login_time==newDays)
|
||||
// {
|
||||
// can_refresh_numbners=ConfigSystem.dark_weblist[i].refreshMax- PlayerPrefs.GetInt(ConfigSystem.dark_weblist[i].webLink, 0);
|
||||
// if (can_refresh_numbners < 0) can_refresh_numbners = 0;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
can_refresh_numbners = ConfigSystem.dark_weblist[i].refreshMax;
|
||||
//if (can_refresh_numbners < 0) can_refresh_numbners = 9999999;
|
||||
// PlayerPrefs.SetInt(ConfigSystem.dark_weblist[i].webLink, 0);
|
||||
// }
|
||||
|
||||
if (i != 0)
|
||||
{
|
||||
dark_str += "|";
|
||||
}
|
||||
|
||||
dark_str += ConfigSystem.dark_weblist[i].webLink + "#" + ConfigSystem.dark_weblist[i].probability + "#" + can_refresh_numbners + "#" + ConfigSystem.dark_weblist[i].darkWebTimesCT + "#" + ConfigSystem.dark_weblist[i].wvType + "#" + ConfigSystem.dark_weblist[i].WVOffset ;
|
||||
}
|
||||
|
||||
|
||||
string darkWVRefreshtime_str = "";
|
||||
|
||||
|
||||
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime.Length; i++)
|
||||
// {
|
||||
// if (i != 0) darkWVRefreshtime_str += "|";
|
||||
// darkWVRefreshtime_str += ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime[i].ToString();
|
||||
// }
|
||||
// for (int i = 0; i < ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime2.Length; i++)
|
||||
// {
|
||||
// darkWVRefreshtime_str += "|";
|
||||
// darkWVRefreshtime_str += ConfigSystem.GetConfig<CommonModel>().darkWVRefreshtime2[i].ToString();
|
||||
// }
|
||||
int dark_type = -1;
|
||||
string add_time = "";
|
||||
for (int i = 0; i < ConfigSystem.dark_weblist.Count; i++)
|
||||
{
|
||||
if (dark_type != ConfigSystem.dark_weblist[i].wvType)
|
||||
{
|
||||
if (i != 0)
|
||||
{
|
||||
darkWVRefreshtime_str += "|";
|
||||
add_time += "|";
|
||||
}
|
||||
darkWVRefreshtime_str += ConfigSystem.dark_weblist[i].darkWVRefreshtime[0];
|
||||
darkWVRefreshtime_str += "|";
|
||||
darkWVRefreshtime_str += ConfigSystem.dark_weblist[i].darkWVRefreshtime[1];
|
||||
dark_type = ConfigSystem.dark_weblist[i].wvType;
|
||||
add_time += ConfigSystem.dark_weblist[i].WVClickAddTime;
|
||||
}
|
||||
}
|
||||
Debug.Log("--------------------------------");
|
||||
|
||||
// add_time+= ConfigSystem.GetConfig<CommonModel>().WVClickAddTime[0] + "|" + ConfigSystem.GetConfig<CommonModel>().WVClickAddTime[1];
|
||||
|
||||
Debug.Log(add_time);
|
||||
Debug.Log(darkWVRefreshtime_str);
|
||||
Debug.Log(darkWVDailyrefreshtimes_str);
|
||||
Debug.Log(dark_str);
|
||||
Debug.Log(ConfigSystem.web_through_str);
|
||||
WebviewManager.Instance.addH5Field(ConfigSystem.GetConfig<CommonModel>().flyCtRate, ConfigSystem.GetConfig<CommonModel>().otherH5switch,
|
||||
ConfigSystem.GetConfig<CommonModel>().H5Refreshtime, Dailyrefresh_reamain, ConfigSystem.GetConfig<CommonModel>().darkThoughProbability
|
||||
, darkWVRefreshtime_str, darkWVDailyrefreshtimes_str, dark_str, light_str, GameHelper.IsGiftSwitch(), ConfigSystem.web_through_str, add_time);
|
||||
// WebviewManager.Instance.OpenWebView(gameUrlInfo.webLink);
|
||||
|
||||
//WebviewManager.Instance.setFlyCtRate(ConfigSystem.GetConfig<CommonModel>().flyCtRate);
|
||||
// RefreshDataCT(isTop, gameUrlInfo);
|
||||
}
|
||||
|
||||
public void ClickAdEvent(string ad_msg)
|
||||
{
|
||||
string[] temp_array = ad_msg.Split("|");
|
||||
if (temp_array.Length >= 2 && temp_array[0] != null && temp_array[0] != "")
|
||||
{
|
||||
H5sendClass info = new H5sendClass() { link = temp_array[0], type = temp_array[1] };
|
||||
NetApi.SetClickAdEvent<object>(temp_array[0], temp_array[1], (isSuccess, obj) =>
|
||||
{
|
||||
// if (isSuccess)
|
||||
// {
|
||||
// Debug.Log("dadianchenggong" + temp_array[0]);
|
||||
// }
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public static bool haveSimCard = false;
|
||||
public void diaoyongtest(string have)
|
||||
{
|
||||
if (have == "TRUE") haveSimCard = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public class H5refreshTimes
|
||||
{
|
||||
public string link;
|
||||
public int times;
|
||||
|
||||
}
|
||||
public class H5sendClass
|
||||
{
|
||||
public string link;
|
||||
public string type;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 59423ca7d3fb1cf4080c1827c2132dab
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
guid: 7f3b9d6c409a4d71bcc6f0c3720f826d
|
||||
timeCreated: 1780739859
|
||||
Reference in New Issue
Block a user