feat:1、创建项目
This commit is contained in:
@@ -0,0 +1,411 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using ChillConnect;
|
||||
using DG.Tweening;
|
||||
using FGUI.Common_01;
|
||||
using IgnoreOPS;
|
||||
using Newtonsoft.Json;
|
||||
using SGModule.Net;
|
||||
using SGModule.NetKit;
|
||||
using UnityEngine;
|
||||
|
||||
public class AdRedeemManager
|
||||
{
|
||||
public static readonly AdRedeemManager Instance = new AdRedeemManager();
|
||||
|
||||
AdRedeemManager()
|
||||
{
|
||||
|
||||
}
|
||||
public const string MakeupAd = "MakeupAd";
|
||||
public const string SavingPotMakeupAd = "SavingPotMakeupAd";
|
||||
public const string MakeupLVAd = "MakeupLVAd";
|
||||
|
||||
public void Redeem(AdRedeemData _data)
|
||||
{
|
||||
if (Time.time - SaveData.redeem_time < 2)
|
||||
{
|
||||
GameHelper.ShowTips("Clicks are too frequent");
|
||||
return;
|
||||
}
|
||||
SaveData.redeem_time = Time.time;
|
||||
|
||||
int myAdNum = GetLookRewardADNum();
|
||||
if (myAdNum >= _data.ad_count)
|
||||
{
|
||||
SetLookRewardADNum(myAdNum - _data.ad_count);
|
||||
|
||||
string name = _data.type.Contains("shop") ? _data.shopName : _data.type;
|
||||
SendEventClickByName(name, "success");
|
||||
|
||||
DOVirtual.DelayedCall(0.1f, () =>
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.apple_pay_success, name);
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("Your ADs count is insufficient!");
|
||||
}
|
||||
}
|
||||
|
||||
public void ShowVideoAd(string adName, Action _action)
|
||||
{
|
||||
GameHelper.ShowVideoAd(adName, isSuccess =>
|
||||
{
|
||||
if (isSuccess)
|
||||
{
|
||||
_action?.Invoke();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// private btn_watchAd btn_WatchAd = null;
|
||||
private Dictionary<string, btn_watchAd> btn_WatchAd = new Dictionary<string, btn_watchAd>();
|
||||
private Dictionary<string, Action> ActionSetText = new Dictionary<string, Action>(); //广告数量的显示
|
||||
|
||||
public void SetWatchAd(string key, btn_watchAd _btn, Action action)
|
||||
{
|
||||
if (!btn_WatchAd.ContainsKey(key))
|
||||
{
|
||||
btn_WatchAd.Add(key, _btn);
|
||||
}
|
||||
else
|
||||
{
|
||||
btn_WatchAd[key] = _btn;
|
||||
}
|
||||
|
||||
if (!ActionSetText.ContainsKey(key))
|
||||
{
|
||||
ActionSetText.Add(key, action);
|
||||
}
|
||||
else
|
||||
{
|
||||
ActionSetText[key] = action;
|
||||
}
|
||||
}
|
||||
private void removeWatchAd()
|
||||
{
|
||||
btn_WatchAd.Clear();
|
||||
}
|
||||
private int ad_cool_down = ConfigSystem.GetConfig<CommonModel>().exchangeCD;
|
||||
|
||||
private void updateWatchCD()
|
||||
{
|
||||
var lastTimes = SaveData.GetSaveObject()._watch_ad_cd;
|
||||
foreach (var item in btn_WatchAd)
|
||||
{
|
||||
bool is_get = item.Key == PurchasingManager.GetPaySku(PayType.pack_reward) && SaveData.GetSaveObject().is_get_packreward;
|
||||
bool is_get1 = item.Key == PurchasingManager.GetPaySku(PayType.remove_ad) && SaveData.GetSaveObject().is_get_removead;
|
||||
|
||||
if (item.Key == PurchasingManager.GetPaySku(PayType.pack_reward) || item.Key == PurchasingManager.GetPaySku(PayType.remove_ad)) return;
|
||||
if (is_get || is_get1)
|
||||
{
|
||||
item.Value.enabled = false;
|
||||
}
|
||||
else if (GameHelper.GetNowTime() < lastTimes && !checkIsCanReceive(item.Key))
|
||||
{
|
||||
item.Value.enabled = false;
|
||||
item.Value.can_buy.selectedIndex = btn_watchAd.Can_buy_cd;
|
||||
item.Value.btn_text.text = CommonHelper.TimeFormat(lastTimes - Convert.ToInt32(GameHelper.GetNowTime()), CountDownType.Hour);
|
||||
}
|
||||
else
|
||||
{
|
||||
// stopAction();
|
||||
item.Value.enabled = true;
|
||||
item.Value.can_buy.selectedIndex = btn_watchAd.Can_buy_can;
|
||||
checkBtnState(item.Value, item.Key);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private CommonModel config = ConfigSystem.GetConfig<CommonModel>();
|
||||
private List<Paidgift> packdata = ConfigSystem.GetConfig<PaidgiftModel>().DataList;
|
||||
private List<Paidcoins> coinList = ConfigSystem.GetConfig<PaidcoinsModel>().DataList;
|
||||
|
||||
public int GetCeilingNeedAds(string name)
|
||||
{
|
||||
|
||||
int needAds = -1;
|
||||
if (name == PurchasingManager.GetPaySku(PayType.buy_one))
|
||||
{
|
||||
double addspace = config.addspace;
|
||||
needAds = (int)Math.Ceiling(addspace);
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.buy_one_off))
|
||||
{
|
||||
double addspace1 = config.AddDiscount;
|
||||
needAds = (int)Math.Ceiling(addspace1);
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.battle_pass))
|
||||
{
|
||||
double Passportgift = config.Passportgift;
|
||||
needAds = (int)Math.Ceiling(Passportgift);
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.pack_reward))
|
||||
{
|
||||
double Paid_price = packdata[0].Paid_price;
|
||||
needAds = (int)Math.Ceiling(Paid_price);
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.remove_ad))
|
||||
{
|
||||
double move_price = packdata[1].Paid_price;
|
||||
needAds = (int)Math.Ceiling(move_price);
|
||||
}
|
||||
else if (name == MakeupAd || name == SavingPotMakeupAd || name == MakeupLVAd)
|
||||
{
|
||||
|
||||
needAds = 9999;
|
||||
}
|
||||
|
||||
// else if (name == PurchasingManager.GetPaySku(PayType.buy_gold_1))
|
||||
// {
|
||||
// double gold_price1 = coinList[1].Payment_amount;
|
||||
// needAds = (int)Math.Ceiling(gold_price1);
|
||||
// }
|
||||
// else if (name == PurchasingManager.GetPaySku(PayType.buy_gold_2))
|
||||
// {
|
||||
// double gold_price2 = coinList[2].Payment_amount;
|
||||
// needAds = (int)Math.Ceiling(gold_price2);
|
||||
// }
|
||||
// else if (name == PurchasingManager.GetPaySku(PayType.buy_gold_3))
|
||||
// {
|
||||
// double gold_price3 = coinList[3].Payment_amount;
|
||||
// needAds = (int)Math.Ceiling(gold_price3);
|
||||
// }
|
||||
// else if (name == PurchasingManager.GetPaySku(PayType.buy_gold_4))
|
||||
// {
|
||||
// double gold_price4 = coinList[4].Payment_amount;
|
||||
// needAds = (int)Math.Ceiling(gold_price4);
|
||||
// }
|
||||
// else if (name == PurchasingManager.GetPaySku(PayType.buy_gold_5))
|
||||
// {
|
||||
// double gold_price5 = coinList[5].Payment_amount;
|
||||
// needAds = (int)Math.Ceiling(gold_price5);
|
||||
// }
|
||||
|
||||
if (name.StartsWith("buy_gold"))
|
||||
{
|
||||
List<Paidcoins> coinList = ConfigSystem.GetConfig<PaidcoinsModel>().DataList;
|
||||
|
||||
int startIndex = "buy_gold".Length;
|
||||
string suffix = name[startIndex..]; // 截取 "gold" 后的所有字符
|
||||
int suffix_num = int.Parse(suffix);
|
||||
|
||||
double gold_price = coinList[suffix_num].Payment_amount;
|
||||
needAds = (int)Math.Ceiling(gold_price);
|
||||
}
|
||||
|
||||
return needAds;
|
||||
|
||||
}
|
||||
|
||||
private bool checkIsCanReceive(string name)
|
||||
{
|
||||
int myAd = GetLookRewardADNum();
|
||||
return myAd >= GetCeilingNeedAds(name);
|
||||
}
|
||||
private void checkBtnState(btn_watchAd item, string key)
|
||||
{
|
||||
// stopAction();
|
||||
// foreach (var item in btn_WatchAd)
|
||||
// {
|
||||
item.SetClick(() => { });
|
||||
|
||||
if (checkIsCanReceive(key))
|
||||
{
|
||||
item.buy_state.selectedIndex = btn_watchAd.Buy_state_buy;
|
||||
if (item.GetChild("img_saveingpot") != null)
|
||||
{
|
||||
item.GetChild("img_saveingpot").visible = false;
|
||||
}
|
||||
|
||||
item.SetClick(() =>
|
||||
{
|
||||
item.enabled = false;
|
||||
AdRedeemData adRedeemData = new AdRedeemData
|
||||
{
|
||||
type = key,
|
||||
ad_count = GetCeilingNeedAds(key)
|
||||
};
|
||||
Redeem(adRedeemData);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
item.buy_state.selectedIndex = btn_watchAd.Buy_state_ad;
|
||||
bool is_get = key == PurchasingManager.GetPaySku(PayType.pack_reward) && SaveData.GetSaveObject().is_get_packreward;
|
||||
bool is_get1 = key == PurchasingManager.GetPaySku(PayType.remove_ad) && SaveData.GetSaveObject().is_get_removead;
|
||||
|
||||
if (is_get || is_get1)
|
||||
{
|
||||
item.enabled = false;
|
||||
item.SetClick(() => { });
|
||||
}
|
||||
else
|
||||
{
|
||||
if (item.GetChild("img_saveingpot") != null && GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1)
|
||||
{
|
||||
item.GetChild("img_saveingpot").visible = true;
|
||||
}
|
||||
|
||||
item.SetClick(() =>
|
||||
{
|
||||
SendEventClickByName(key, "click");
|
||||
ShowVideoAd("buy_add_one", () =>
|
||||
{
|
||||
RunAllAction();
|
||||
item.enabled = false;
|
||||
TimerHelper.mEasy.AddTimer(0.1f, () =>
|
||||
{
|
||||
var ad_times = Convert.ToInt32(GameHelper.GetNowTime());
|
||||
SaveData.GetSaveObject()._watch_ad_cd = ad_times + ad_cool_down;
|
||||
startAction();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
private void RunAllAction()
|
||||
{
|
||||
foreach (var item in ActionSetText)
|
||||
{
|
||||
item.Value?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private void startAction()
|
||||
{
|
||||
stopAction();
|
||||
HallManager.Instance.UpdateSecondEvent += updateWatchCD;
|
||||
}
|
||||
|
||||
private void stopAction()
|
||||
{
|
||||
HallManager.Instance.UpdateSecondEvent -= updateWatchCD;
|
||||
}
|
||||
|
||||
public int GetLookRewardADNum()
|
||||
{
|
||||
int nums = PlayerPrefs.GetInt("get_look_reward_ad_num", 0);
|
||||
return nums;
|
||||
}
|
||||
|
||||
public void SetLookRewardADNum(int nums)
|
||||
{
|
||||
PlayerPrefs.SetInt("get_look_reward_ad_num", nums);
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
startAction();
|
||||
updateWatchCD();
|
||||
}
|
||||
|
||||
public void Destroy()
|
||||
{
|
||||
stopAction();
|
||||
removeWatchAd();
|
||||
ActionSetText.Clear();
|
||||
}
|
||||
|
||||
public void SendEventClickByName(string name, string type)
|
||||
{
|
||||
string clickTrackKey = null;
|
||||
string successTrackKey = null;
|
||||
string suffix = "";
|
||||
if (name == PurchasingManager.GetPaySku(PayType.pack_reward))
|
||||
{
|
||||
clickTrackKey = Property.FirstPackClick;
|
||||
successTrackKey = Property.FirstPackSuccess;
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.remove_ad))
|
||||
{
|
||||
clickTrackKey = Property.RemoveAdClick;
|
||||
successTrackKey = Property.RemoveAdSuccess;
|
||||
}
|
||||
// case buy_gold_1:
|
||||
// eventClickName = BuriedPointEvent.gold_click_1;
|
||||
// eventSuccName = BuriedPointEvent.gold_success_1;
|
||||
// break;
|
||||
// case buy_gold_2:
|
||||
// eventClickName = BuriedPointEvent.gold_click_2;
|
||||
// eventSuccName = BuriedPointEvent.gold_success_2;
|
||||
// break;
|
||||
// case buy_gold_3:
|
||||
// eventClickName = BuriedPointEvent.gold_click_3;
|
||||
// eventSuccName = BuriedPointEvent.gold_success_3;
|
||||
// break;
|
||||
// case buy_gold_4:
|
||||
// eventClickName = BuriedPointEvent.gold_click_4;
|
||||
// eventSuccName = BuriedPointEvent.gold_success_4;
|
||||
// break;
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.battle_pass))
|
||||
{
|
||||
clickTrackKey = Property.PassClick;
|
||||
successTrackKey = Property.PassSuccess;
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.buy_one))
|
||||
{
|
||||
clickTrackKey = Property.BuyOneClick;
|
||||
successTrackKey = Property.BuyOneSuccess;
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.buy_one_off))
|
||||
{
|
||||
clickTrackKey = Property.BuyOneOffClick;
|
||||
successTrackKey = Property.BuyOneOffSuccess;
|
||||
}
|
||||
|
||||
if (name.StartsWith("buy_gold"))
|
||||
{
|
||||
int startIndex = "buy_gold".Length;
|
||||
suffix = name[startIndex..]; // 截取 "gold" 后的所有字符
|
||||
clickTrackKey = Property.GoldClick;
|
||||
successTrackKey = Property.GoldSuccess;
|
||||
}
|
||||
|
||||
if (type == "success" && successTrackKey != null)
|
||||
{
|
||||
// TrackKit.SendEvent(Property.adEvent, successTrackKey, Int32.Parse(suffix));
|
||||
}
|
||||
else if (type == "click" && clickTrackKey != null)
|
||||
{
|
||||
// TrackKit.SendEvent(Property.adEvent, clickTrackKey, Int32.Parse(suffix));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class AdRedeemData
|
||||
{
|
||||
|
||||
[JsonProperty("type")]
|
||||
public string type;
|
||||
[JsonProperty("ad_count")]
|
||||
public int ad_count;
|
||||
[JsonProperty("shopName")]
|
||||
public string shopName;
|
||||
}
|
||||
public class orderState
|
||||
{
|
||||
[JsonProperty("order_id")]
|
||||
public string order_id;
|
||||
[JsonProperty("status")]
|
||||
public int status;
|
||||
|
||||
}
|
||||
public class orderData
|
||||
{
|
||||
[JsonProperty("order_id")]
|
||||
public string order_id;
|
||||
[JsonProperty("pay_url")]
|
||||
public string pay_url;
|
||||
[JsonProperty("code")]
|
||||
public int code;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33ed44012dd51724bbb822265db9b931
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,32 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class App
|
||||
{
|
||||
private static SApplication _sCurrSApplication;
|
||||
|
||||
public static void InitApplication(SApplication sApplication)
|
||||
{
|
||||
_sCurrSApplication = sApplication;
|
||||
_sCurrSApplication.Init();
|
||||
_sCurrSApplication.Enable();
|
||||
}
|
||||
|
||||
private static float LoadingProgressDelayTime = 0f;
|
||||
|
||||
public static void DisplayLoadingUI()
|
||||
{
|
||||
AppDispatcher.Instance.Dispatch(AppMsg.UI_DisplayLoadingUI);
|
||||
}
|
||||
|
||||
public static void HideLoadingUI(bool isDelay = false)
|
||||
{
|
||||
if (!isDelay)
|
||||
{
|
||||
AppDispatcher.Instance.Dispatch(AppMsg.UI_HideLoadingUI);
|
||||
return;
|
||||
}
|
||||
|
||||
TimerHelper.mEasy.AddTimer(0.3f, () => { AppDispatcher.Instance.Dispatch(AppMsg.UI_HideLoadingUI); });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 670d339b2f75a144e8ba207f951e51bd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,164 @@
|
||||
// using System;
|
||||
// using System.Collections;
|
||||
// using System.Collections.Generic;
|
||||
// // using AppsFlyerSDK;
|
||||
// using ChillConnect;
|
||||
// using DG.Tweening;
|
||||
// using SGModule.Common.Helper;
|
||||
// using SGModule.Net;
|
||||
// using SGModule.NetKit;
|
||||
// // using Unity.Advertisement.IosSupport;
|
||||
// using UnityEngine;
|
||||
//
|
||||
// namespace IgnoreOPS
|
||||
// {
|
||||
//
|
||||
// internal class AppsFlyerObjectScript1 : MonoBehaviour, IAppsFlyerConversionData
|
||||
// {
|
||||
// public string appID;
|
||||
// public bool is_init;
|
||||
// public Coroutine m_Coroutine;
|
||||
//
|
||||
// void Start()
|
||||
// {
|
||||
// AddListener();
|
||||
//
|
||||
// AppsFlyer.setIsDebug(true);
|
||||
// // #if UNITY_IOS && !UNITY_EDITOR
|
||||
// // appID = "6746832797";
|
||||
// // m_Coroutine = CrazyAsyKit.StartCoroutine(loopWaitInitAf());
|
||||
// // #endif
|
||||
//
|
||||
//
|
||||
// // #if UNITY_EDITOR
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
// // #endif
|
||||
// }
|
||||
//
|
||||
// private void AddListener()
|
||||
// {
|
||||
// NetworkDispatcher.Instance.AddListener(NetworkMsg.NotNetwork, RequestLogin);
|
||||
// }
|
||||
//
|
||||
// private void RemoveListener()
|
||||
// {
|
||||
// NetworkDispatcher.Instance.RemoveListener(NetworkMsg.NotNetwork, RequestLogin);
|
||||
// }
|
||||
//
|
||||
// void OnDestroy()
|
||||
// {
|
||||
// RemoveListener();
|
||||
// }
|
||||
//
|
||||
// void RequestLogin(object obj = null)
|
||||
// {
|
||||
// if (GameHelper.IsConnect())
|
||||
// {
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.Network_reconnection);
|
||||
// }
|
||||
//
|
||||
// CrazyAsyKit.StopCoroutine(m_Coroutine);
|
||||
//
|
||||
// m_Coroutine = CrazyAsyKit.StartCoroutine(loopWaitInitAf());
|
||||
// }
|
||||
//
|
||||
// private IEnumerator loopWaitInitAf()
|
||||
// {
|
||||
// // yield return new WaitForSeconds(0.5f);
|
||||
// // #if !ChillConnectRelease
|
||||
// // if (!GameHelper.IsConnect()) GameHelper.ShowTips($"is link network:{GameHelper.IsConnect()}");
|
||||
// // #endif
|
||||
// var isConnect = GameHelper.IsConnect();
|
||||
// if (!isConnect)
|
||||
// {
|
||||
// float retryTime = 0f;
|
||||
// const float maxRetryTime = 3f;
|
||||
//
|
||||
// while (!GameHelper.IsConnect() && retryTime < maxRetryTime)
|
||||
// {
|
||||
// yield return new WaitForSeconds(0.2f);
|
||||
// retryTime += 0.2f;
|
||||
// }
|
||||
//
|
||||
// // 再次确认网络状态
|
||||
// isConnect = GameHelper.IsConnect();
|
||||
//
|
||||
// if (!isConnect)
|
||||
// {
|
||||
// // 超时且仍未连接,触发无网络提示
|
||||
// Action action = () =>
|
||||
// {
|
||||
// TimerHelper.mEasy.AddTimer(0.5f, () =>
|
||||
// {
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.NotNetwork);
|
||||
// });
|
||||
// };
|
||||
// UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.TipsViewUI_Open, action);
|
||||
// }
|
||||
// }
|
||||
// if (isConnect)
|
||||
// {
|
||||
// TrackKit.TrackLoginFunnel(LoginFunnelEventType.AfSend);
|
||||
//
|
||||
// float a = 0;
|
||||
// // if (ATTrackingStatusBinding.GetAuthorizationTrackingStatus() ==
|
||||
// // ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED)
|
||||
// // {
|
||||
// // ATTrackingStatusBinding.RequestAuthorizationTracking();
|
||||
// // }
|
||||
//
|
||||
// // while ((ATTrackingStatusBinding.GetAuthorizationTrackingStatus() ==
|
||||
// // ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED) && (a < 5.0f))
|
||||
// // {
|
||||
// // a += 0.5f;
|
||||
// // yield return new WaitForSeconds(0.5f);
|
||||
// // }
|
||||
//
|
||||
// AppsFlyer.initSDK("ZRPEXnZD9jgqWx8RmiQbiT", appID, this);
|
||||
// AppsFlyer.startSDK();
|
||||
// // AppsFlyer.AFLog("8888888888888888888",
|
||||
// // ATTrackingStatusBinding.GetAuthorizationTrackingStatus().ToString());
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// public void onConversionDataSuccess(string conversionData)
|
||||
// {
|
||||
// Debug.Log($"[AF] onConversionDataSuccess-------- {is_init}");
|
||||
// if (is_init) return;
|
||||
// is_init = true;
|
||||
// AppsFlyer.AFLog("onConversionDataSuccess", conversionData);
|
||||
// var conversionDataDictionary = AppsFlyer.CallbackStringToDictionary(conversionData);
|
||||
// var json = SerializeUtil.ToJsonIndented(conversionDataDictionary);
|
||||
// SuperApplication.Instance.attribution =
|
||||
// conversionDataDictionary.TryGetValue("af_status", out var afStatus)
|
||||
// ? afStatus.ToString().ToLower()
|
||||
// : "organic";
|
||||
//
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
// TrackKit.TrackLoginFunnel(LoginFunnelEventType.AfRecv, "success");
|
||||
// }
|
||||
//
|
||||
// public void onConversionDataFail(string error)
|
||||
// {
|
||||
// Debug.Log($"[AF] onConversionDataFail-------- {is_init}");
|
||||
// if (is_init) return;
|
||||
// is_init = true;
|
||||
// AppsFlyer.AFLog("onConversionDataFail", error);
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
// TrackKit.TrackLoginFunnel(LoginFunnelEventType.AfRecv, "fail");
|
||||
// }
|
||||
//
|
||||
// public void onAppOpenAttribution(string attributionData)
|
||||
// {
|
||||
// AppsFlyer.AFLog("onAppOpenAttribution", attributionData);
|
||||
// Dictionary<string, object> attributionDataDictionary =
|
||||
// AppsFlyer.CallbackStringToDictionary(attributionData);
|
||||
// }
|
||||
//
|
||||
// public void onAppOpenAttributionFailure(string error)
|
||||
// {
|
||||
// AppsFlyer.AFLog("onAppOpenAttributionFailure", error);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ee1dea4970f5e3b4b9299169c8b45c58
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc47593d8a04d3147a05e47aa376b7b8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,52 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class AsyncDealData
|
||||
{
|
||||
public delegate void DealMethod();
|
||||
|
||||
|
||||
private float _currentTime;
|
||||
|
||||
|
||||
public float DelayTime = 1f;
|
||||
|
||||
|
||||
public DealMethod dealMethod;
|
||||
|
||||
|
||||
public int RepeatCount = 1;
|
||||
|
||||
|
||||
public bool IsComplete => RepeatCount == 0;
|
||||
|
||||
|
||||
public void PassTime(float time)
|
||||
{
|
||||
_currentTime += time;
|
||||
if (!(_currentTime >= DelayTime))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_currentTime -= DelayTime;
|
||||
Run();
|
||||
}
|
||||
|
||||
|
||||
private void Run()
|
||||
{
|
||||
if (RepeatCount == -1)
|
||||
{
|
||||
dealMethod?.Invoke();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (RepeatCount > 0)
|
||||
{
|
||||
dealMethod?.Invoke();
|
||||
RepeatCount--;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4e51ff91679a44d1b1efe3438d508e74
|
||||
timeCreated: 1682577036
|
||||
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
internal class AsyncKitUnityBehaviour : SingletonUnity<AsyncKitUnityBehaviour>
|
||||
{
|
||||
private readonly Dictionary<string, AsyncDealData> _asyncDataDict = new Dictionary<string, AsyncDealData>();
|
||||
|
||||
|
||||
private readonly Dictionary<string, AsyncDealData> _updateActionDict = new Dictionary<string, AsyncDealData>();
|
||||
|
||||
private readonly List<string> _keyClean = new List<string>();
|
||||
|
||||
private void Update()
|
||||
{
|
||||
foreach (var temp in _asyncDataDict.Values)
|
||||
{
|
||||
temp.PassTime(Time.deltaTime);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var temp in _updateActionDict.Values)
|
||||
{
|
||||
temp?.dealMethod?.Invoke();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
ClearFinished();
|
||||
|
||||
|
||||
ClearUpdateActionFinished();
|
||||
}
|
||||
|
||||
|
||||
private void ClearFinished()
|
||||
{
|
||||
_keyClean.Clear();
|
||||
foreach (var dealData in _asyncDataDict)
|
||||
{
|
||||
if (dealData.Value.IsComplete)
|
||||
{
|
||||
_keyClean.Add(dealData.Key);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var key in _keyClean)
|
||||
{
|
||||
_asyncDataDict.Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void AddAsyncData(string key, AsyncDealData asyncDealData)
|
||||
{
|
||||
RemoveAsyncData(key);
|
||||
_asyncDataDict.Add(key, asyncDealData);
|
||||
}
|
||||
|
||||
|
||||
public void RemoveAsyncData(string key)
|
||||
{
|
||||
if (_asyncDataDict.ContainsKey(key))
|
||||
{
|
||||
_asyncDataDict.Remove(key);
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearUpdateActionFinished()
|
||||
{
|
||||
_keyClean.Clear();
|
||||
foreach (var dealData in _updateActionDict)
|
||||
{
|
||||
if (dealData.Value.IsComplete)
|
||||
{
|
||||
_keyClean.Add(dealData.Key);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var key in _keyClean)
|
||||
{
|
||||
_updateActionDict.Remove(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 984d18c5a4974e729d72276896426930
|
||||
timeCreated: 1682577036
|
||||
@@ -0,0 +1,63 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class CrazyAsyKit
|
||||
{
|
||||
private static AsyncKitUnityBehaviour sAsyncKitUnityBehaviour;
|
||||
|
||||
|
||||
private static readonly object SynClock = new object();
|
||||
|
||||
private static AsyncKitUnityBehaviour mAsyncKitUnityBehaviour
|
||||
{
|
||||
get
|
||||
{
|
||||
if (sAsyncKitUnityBehaviour != null)
|
||||
{
|
||||
return sAsyncKitUnityBehaviour;
|
||||
}
|
||||
|
||||
lock (SynClock)
|
||||
{
|
||||
if (sAsyncKitUnityBehaviour != null)
|
||||
{
|
||||
return sAsyncKitUnityBehaviour;
|
||||
}
|
||||
|
||||
|
||||
sAsyncKitUnityBehaviour = AsyncKitUnityBehaviour.Instance;
|
||||
if (sAsyncKitUnityBehaviour != null)
|
||||
{
|
||||
sAsyncKitUnityBehaviour.name = "[ CrazyAsyKit ]";
|
||||
}
|
||||
}
|
||||
|
||||
return sAsyncKitUnityBehaviour;
|
||||
}
|
||||
}
|
||||
|
||||
public static Coroutine StartCoroutine(IEnumerator enumerator)
|
||||
{
|
||||
return mAsyncKitUnityBehaviour.StartCoroutine(enumerator);
|
||||
}
|
||||
|
||||
public static void StopCoroutine(Coroutine enumerator)
|
||||
{
|
||||
mAsyncKitUnityBehaviour.StopCoroutine(enumerator);
|
||||
}
|
||||
|
||||
public static void StartAction(string key, AsyncDealData.DealMethod method, float delayTime, int repeat = 1)
|
||||
{
|
||||
var temp = new AsyncDealData { dealMethod = method, DelayTime = delayTime, RepeatCount = repeat };
|
||||
mAsyncKitUnityBehaviour.AddAsyncData(key, temp);
|
||||
}
|
||||
|
||||
|
||||
public static void StopAction(string key)
|
||||
{
|
||||
mAsyncKitUnityBehaviour.RemoveAsyncData(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93122ca4429e463aba586a345558ed8e
|
||||
timeCreated: 1682577036
|
||||
@@ -0,0 +1,29 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public abstract class BaseScene
|
||||
{
|
||||
public abstract int SceneIdx { get; }
|
||||
|
||||
public void Enter()
|
||||
{
|
||||
App.DisplayLoadingUI();
|
||||
OnEnter();
|
||||
}
|
||||
|
||||
public void Leave()
|
||||
{
|
||||
OnLeave();
|
||||
}
|
||||
|
||||
public void SwitchSceneComplete(object param)
|
||||
{
|
||||
OnSwitchSceneComplete(param);
|
||||
}
|
||||
|
||||
protected abstract void OnEnter();
|
||||
protected abstract void OnLeave();
|
||||
protected abstract void OnSwitchSceneComplete(object param);
|
||||
|
||||
public abstract void Dispose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8bdd23fc1e10e744a00b9cd6e28eae3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,29 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public abstract class BaseSystem
|
||||
{
|
||||
public virtual void Init()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void InitLate()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Update()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void LateUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void FixedUpdate()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d09f140354146564aa23e2896d940db2
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ChillConnectCore : SingletonUnity<ChillConnectCore>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e963a08d18f37d4886b21170d5fb6ed
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,39 @@
|
||||
using ChillConnect;
|
||||
using SGModule.Common;
|
||||
using SGModule.MarkdownKit;
|
||||
using SGModule.Net;
|
||||
using SGModule.NetKit;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
public class ChillConnectRoot : MonoBehaviour
|
||||
{
|
||||
public void Awake()
|
||||
{
|
||||
#if UNITY_EDITOR || GAME_RELEASE
|
||||
GameObject ingameDebugConsole = GameObject.Find("IngameDebugConsole");
|
||||
if (ingameDebugConsole != null) ingameDebugConsole.SetActive(false);
|
||||
#endif
|
||||
// GameObject.Find("IngameDebugConsole").SetActive(false);//zhushi
|
||||
|
||||
// NetworkKit.Instance.InitData(ConfigManager.GameConfig.packageName, ConfigManager.GameConfig.isRelease);
|
||||
|
||||
|
||||
MaxADKit.Init();
|
||||
|
||||
OnLauncher();
|
||||
|
||||
TrackKit.TrackLoginFunnel(LoginFunnelEventType.Bootstrap);
|
||||
}
|
||||
|
||||
public static void OnLauncher()
|
||||
{
|
||||
AppObjConst.FrameGo = new GameObject($"{AppObjConst.FrameGoName}");
|
||||
AppObjConst.FrameGo.AddComponent<ChillConnectCore>();
|
||||
DontDestroyOnLoad(AppObjConst.FrameGo);
|
||||
App.InitApplication(SuperApplication.Instance);
|
||||
|
||||
MarkdownKit.Instance.LoadText("privacy", "https://www.ballcrushbest.fun/privacy.md");
|
||||
MarkdownKit.Instance.LoadText("user", "https://www.ballcrushbest.fun/user.md");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c677bf10dae182441b932bf59cb07226
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 53c61377e4aa04508988b37359ba8082
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,44 @@
|
||||
public static partial class DataKeys
|
||||
{
|
||||
public const string UserID = "UserID";
|
||||
public const string FirstLogin = "FirstLogin";
|
||||
public const string currency101 = "currency101";
|
||||
public const string currency102 = "currency102";
|
||||
public const string maxCurrency101 = "maxCurrency101";
|
||||
public const string nextOpenWheelStampTime = "nextOpenWheelStampTime";
|
||||
public const string thisDayWatchSlyderVideoNum = "thisDayWatchSlyderVideoNum";
|
||||
public const string playerName = "playerName";
|
||||
public const string playerAvatarId = "playerAvatarId";
|
||||
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";
|
||||
public const string isShowRewardFly102 = "isShowRewardFly102";
|
||||
public const string playReawrd111 = "playReawrd111";
|
||||
public const string isShowRewardFly111 = "isShowRewardFly111";
|
||||
public const string isShowOpenReward = "isShowOpenReward";
|
||||
public const string isLastH5Tab = "isLastH5Tab";
|
||||
public const string adCashFlyShowTime = "adCashFlyShowTime";
|
||||
public const string h5StayTime = "h5StayTime";
|
||||
public const string videoWatchCount = "videoWatchCount";
|
||||
public const string makeupTaskHistory = "makeupTaskHistory";
|
||||
public const string makeupTaskH5Time = "makeupTaskH5Time";
|
||||
public const string gameStartCount = "gameStartCount";
|
||||
public const string loginGameTodayTimes = "loginGameTodayTimes";
|
||||
public const string date = "date";
|
||||
public const string ch_level = "ch_level";
|
||||
public const string SaveObject = "SaveObject";
|
||||
public const string LevelData = "LevelData";
|
||||
public const string AvailableDiceRolls = "AvailableDiceRolls"; // 可摇骰子次数
|
||||
public const string RankData = "RankData";
|
||||
public const string ApplePayTransactionID = "ApplePayTransactionID"; //ios购买后的非消耗性订单id
|
||||
public const string NewWatchCd = "NewWatchCd";
|
||||
public const string ArrowResultLevel = "ArrowResultLevel"; //箭头游戏的结算等级(1:免费,0:看广告)
|
||||
public const string ArrowDarkTheme = "ArrowDarkTheme"; //箭头游戏的黑夜模式(0:黑夜,1:白天)
|
||||
public const string ArrowTheme = "ArrowTheme"; //箭头游戏的主题(0:黑色 1:虫子 2:彩色)
|
||||
public const string ArrowChProgress = "ArrowChProgress"; //箭头cash 进度
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c59f64be7ea460a44bddc190831fbbcb
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,93 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using Assets.Scripts;
|
||||
using ChillConnect;
|
||||
using IgnoreOPS;
|
||||
using SGModule.DataStorage;
|
||||
|
||||
public static partial class DataMgr
|
||||
{
|
||||
public static string long_name;
|
||||
public static string short_name;
|
||||
|
||||
|
||||
private static DataStorage<T> BindDataStorage<T>(string key, string messageKey = null, T @default = default)
|
||||
{
|
||||
return new DataStorage<T>(key, @default, (oldValue, newValue) =>
|
||||
{
|
||||
// 构造 ChangeValue 对象
|
||||
if (messageKey == DataKeys.signState)
|
||||
{
|
||||
int a = 0;
|
||||
}
|
||||
var changeValue = new ChangeValue<T>
|
||||
{
|
||||
oldValue = oldValue,
|
||||
newValue = newValue
|
||||
};
|
||||
|
||||
if (messageKey.IsNullOrWhiteSpace())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// 调用特定类型的分发器
|
||||
PreferencesDispatcher<T>.Instance.Dispatch(messageKey, changeValue);
|
||||
|
||||
// 调用全局数据分发器(如果需要)
|
||||
DataDispatcher.Instance.Dispatch(messageKey);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
#region ValueType
|
||||
|
||||
public static DataStorage<bool> FirstLogin = new(DataKeys.FirstLogin, true);
|
||||
public static DataStorage<long> UserID = BindDataStorage(DataKeys.UserID, @default: -1L);
|
||||
public static DataStorage<long> NextOpenWheelStampTime = BindDataStorage<long>(DataKeys.nextOpenWheelStampTime);
|
||||
public static DataStorage<int> ThisDayWatchSlyderVideoNum = BindDataStorage<int>(DataKeys.thisDayWatchSlyderVideoNum);
|
||||
public static DataStorage<int> Coin = BindDataStorage<int>(DataKeys.currency101, DataMsg.currency101);
|
||||
public static DataStorage<decimal> Ticket = BindDataStorage<decimal>(DataKeys.currency102, DataMsg.currency102);
|
||||
public static DataStorage<int> MaxCurrency101 = BindDataStorage<int>(DataKeys.maxCurrency101);
|
||||
public static DataStorage<string> PlayerName = BindDataStorage<string>(DataKeys.playerName, DataMsg.playerName);
|
||||
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);
|
||||
public static DataStorage<bool> IsShowRewardFly102 = BindDataStorage<bool>(DataKeys.isShowRewardFly102);
|
||||
public static DataStorage<decimal> PlayReawrd111 = BindDataStorage<decimal>(DataKeys.playReawrd111, DataMsg.playReawrd111);
|
||||
public static DataStorage<bool> IsShowRewardFly111 = BindDataStorage<bool>(DataKeys.isShowRewardFly111, DataMsg.isShowRewardFly111);
|
||||
public static DataStorage<bool> IsShowOpenReward = BindDataStorage<bool>(DataKeys.isShowOpenReward);
|
||||
public static DataStorage<bool> IsLastH5Tab = BindDataStorage<bool>(DataKeys.isLastH5Tab);
|
||||
public static DataStorage<long> AdCashFlyShowTime = BindDataStorage<long>(DataKeys.adCashFlyShowTime);
|
||||
public static DataStorage<int> H5StayTime = BindDataStorage<int>(DataKeys.h5StayTime);
|
||||
public static DataStorage<int> VideoWatchCount = BindDataStorage<int>(DataKeys.videoWatchCount);
|
||||
public static DataStorage<decimal> MakeupTaskH5Time = BindDataStorage<decimal>(DataKeys.makeupTaskH5Time);
|
||||
public static DataStorage<int> GameStartCount = BindDataStorage<int>(DataKeys.gameStartCount);
|
||||
public static DataStorage<int> LoginGameTodayTimes = BindDataStorage<int>(DataKeys.loginGameTodayTimes);
|
||||
public static DataStorage<string> Date = BindDataStorage<string>(DataKeys.date);
|
||||
public static DataStorage<int> ChLevel = BindDataStorage<int>(DataKeys.ch_level);
|
||||
public static DataStorage<string> LevelData = new(DataKeys.LevelData, cloudSave: false);
|
||||
public static DataStorage<int> AvailableDiceRolls = BindDataStorage<int>(DataKeys.AvailableDiceRolls);
|
||||
public static DataStorage<int> ArrowResultLevel = BindDataStorage<int>(DataKeys.ArrowResultLevel,@default: 1);
|
||||
public static DataStorage<int> ArrowDarkTheme = BindDataStorage<int>(DataKeys.ArrowDarkTheme,@default: 1);
|
||||
public static DataStorage<int> ArrowTheme = BindDataStorage<int>(DataKeys.ArrowTheme,@default: 0);
|
||||
public static DataStorage<int> ArrowChProgress = BindDataStorage<int>(DataKeys.ArrowChProgress,@default: 0);
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region RefType
|
||||
|
||||
public static DataStorage<List<long>> SignState = BindDataStorage(DataKeys.signState, @default: new List<long>());
|
||||
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
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f5151422b80f61e4992ae51ac0b87787
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
public static class DataMsg {
|
||||
public const string currency101 = "Preferences_currency101";
|
||||
public const string currency102 = "Preferences_currency102";
|
||||
public const string playerName = "Preferences_playerName";
|
||||
public const string playerAvatarId = "Preferences_playerAvatarId";
|
||||
public const string isShowRewardFly101 = "Preferences_isShowRewardFly101";
|
||||
public const string playReawrd111 = "Preferences_playReawrd111";
|
||||
public const string isShowRewardFly111 = "Preferences_isShowRewardFly111";
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b104d17b32ee2404dadd6573d3d26ef5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,65 @@
|
||||
using System.Collections.Generic;
|
||||
using ChillConnect;
|
||||
using SGModule.NetKit;
|
||||
|
||||
namespace Assets.Scripts {
|
||||
public class PreferencesDataReadyCtrl : BaseCtrl {
|
||||
private readonly List<uint> msgList = new();
|
||||
|
||||
|
||||
public void PreferenceDataReady(object objs = null) {
|
||||
InspectionNewDay();
|
||||
|
||||
|
||||
DataMgr.GameStartCount.Value++;
|
||||
}
|
||||
|
||||
|
||||
public void InspectionNewDay() {
|
||||
var login_time = LoginKit.Instance.LoginModel.LoginTime;
|
||||
var data = DateTimeManager.Instance.GetDateTime(login_time);
|
||||
var dateStr = DateTimeManager.Instance.DateTimeToYYYYMMDD(data);
|
||||
if (!DataMgr.Date.Value.Equals(dateStr)) {
|
||||
DataMgr.Date.Value = dateStr;
|
||||
msgList.Add(CtrlMsg.NewDays);
|
||||
DataMgr.LoginGameTodayTimes.Value = 1;
|
||||
}
|
||||
else {
|
||||
DataMgr.LoginGameTodayTimes.Value++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void SendCtrlMsg(object args = null) {
|
||||
for (var i = 0; i < msgList.Count; i++) {
|
||||
ctrlDispatcher.Dispatch(msgList[i]);
|
||||
}
|
||||
|
||||
msgList.Clear();
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit() {
|
||||
}
|
||||
|
||||
protected override void OnDispose() {
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
|
||||
protected override void AddListener() {
|
||||
ctrlDispatcher.AddListener(CtrlMsg.Preferences_InitComplete, PreferenceDataReady);
|
||||
ctrlDispatcher.AddListener(CtrlMsg.Game_StartBefore, SendCtrlMsg);
|
||||
}
|
||||
|
||||
protected override void RemoveListener() {
|
||||
ctrlDispatcher.RemoveListener(CtrlMsg.Preferences_InitComplete, PreferenceDataReady);
|
||||
ctrlDispatcher.RemoveListener(CtrlMsg.Game_StartBefore, SendCtrlMsg);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae6043f24584f694ba73b736ad18bb6d
|
||||
timeCreated: 1692007381
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: be8781ff9378e5345a9f6188e990a359
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e7146600e94b62843b388e234c8ce824
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class AnimConst
|
||||
{
|
||||
public const float AnimFrameRate = 30;
|
||||
public const float SecondRateUnit = 1 / AnimFrameRate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: db177b3a2887ce0498712919fed1ee4f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,56 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class AppConst
|
||||
{
|
||||
#region Field
|
||||
|
||||
#if GAME_RELEASE
|
||||
public static bool IsEnabledEngineLog = false;
|
||||
#else
|
||||
public static bool IsEnabledEngineLog = true;
|
||||
#endif
|
||||
|
||||
public const LogType EnabledFilterLogType =
|
||||
LogType.Log | LogType.Warning | LogType.Error | LogType.Assert |
|
||||
LogType.Exception;
|
||||
|
||||
public const bool IsRunInBG = true;
|
||||
public const int SleepTimeoutMode = SleepTimeout.NeverSleep;
|
||||
public const int AntiAliasing = 0;
|
||||
public const int HighFrameRate = 60;
|
||||
public const int LowFrameRate = 45;
|
||||
public const float HDHighViewScale = 1f;
|
||||
public const float HDLowViewScale = 0.9f;
|
||||
public const float PixelsPerUnit = 100f;
|
||||
|
||||
public static Vector2Int StandardResolution = new Vector2Int(1080, 1920);
|
||||
|
||||
public static Vector2Int UIResolution = new Vector2Int(1080, 1920);
|
||||
|
||||
public static bool UseInternalSetting = true;
|
||||
|
||||
public static bool IsMultiLangue = true;
|
||||
|
||||
public static string CurrMultiLangue = "en";
|
||||
|
||||
public static string DefaultLangue = "en";
|
||||
|
||||
public static string InternalLangue = "en";
|
||||
|
||||
public static string DeviceLangue = "en";
|
||||
|
||||
|
||||
public static List<string> CtrlDisableList = new List<string>();
|
||||
|
||||
#endregion
|
||||
|
||||
public static bool isPt()
|
||||
{
|
||||
if (CurrMultiLangue == "pt") return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e2daa6b68221ec4f8e0b643de38afd1
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,38 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class AppObjConst
|
||||
{
|
||||
public const string FrameGoName = "[ Jarvis ]";
|
||||
public static GameObject FrameGo;
|
||||
|
||||
public const string LauncherGoName = "[Launcher]";
|
||||
|
||||
public const string EngineEventSystemGoName = "[EngineEventSystem]";
|
||||
public static GameObject EngineEventSystemGo;
|
||||
|
||||
public const string ApplicationGoName = "[ Application ]";
|
||||
public static GameObject ApplicationGo;
|
||||
|
||||
public const string EngineSingletonGoName = "[EngineSingleton]";
|
||||
public static GameObject EngineSingletonGo;
|
||||
public const string MonoManagerGoName = "[MonoManager]";
|
||||
public static GameObject MonoManagerGo;
|
||||
public const string DispatcherGoName = "[Dispatcher]";
|
||||
public static GameObject DispatcherGo;
|
||||
public const string LoaderGoName = "[Loader]";
|
||||
public static GameObject LoaderGo;
|
||||
|
||||
public const string CameraGoName = "[Camera]";
|
||||
public static GameObject CameraGo;
|
||||
|
||||
public const string UIGoName = "[UI]";
|
||||
public static GameObject UIGo;
|
||||
public const string UICacheGoName = "[UICache]";
|
||||
public static GameObject UICacheGo;
|
||||
|
||||
public const string DOTweenGoName = "[DOTween]";
|
||||
public const string SuperInvokeGoName = "[SuperInvoke]";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ce9826ccd786f9e46a1fb245b9fe4a04
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class AudioConst
|
||||
{
|
||||
public const string UIButtonDefault = "ui_ButtonDefault";
|
||||
public const string DailyBonusCollect = "dailyBonus_collect";
|
||||
public const string CoinFly = "coinfly";
|
||||
public const string MainBg = "hallBgm";
|
||||
public const string GameBg = "game_bgm";
|
||||
public const string dissolve = "dissolve";
|
||||
public const string fellshort = "fellshort";
|
||||
public const string Victoriously = "Victoriously";
|
||||
public const string MakeupDone = "makupdone";
|
||||
public const string wheel_spin = "wheel_spin";
|
||||
public const string game_open = "game_open";
|
||||
public const string gameclick = "gameclick";
|
||||
public const string egg = "egg";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: dbb65f81bcb66ff48abc55f1c1150765
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,17 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class CameraConst
|
||||
{
|
||||
public const int MainDepth = 0;
|
||||
public const int UICameraDepth = 10;
|
||||
|
||||
public const int MainCameraPosValue = 100;
|
||||
public const int MainCameraZPos = 0;
|
||||
public const int UICameraPosValue = 10000;
|
||||
|
||||
public static Vector3 MainCameraPos = new Vector3(MainCameraPosValue, MainCameraPosValue, MainCameraZPos);
|
||||
public static Vector3 UICameraPos = new Vector3(UICameraPosValue, UICameraPosValue, MainCameraZPos);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e2555d38a702f494ca13aaf957846be9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class LayerMaskConst
|
||||
{
|
||||
public const string Default_Name = "Default";
|
||||
public const string UI_Name = "UI";
|
||||
|
||||
public readonly static int Default = LayerMask.NameToLayer(Default_Name);
|
||||
public readonly static int UI = LayerMask.NameToLayer(UI_Name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f53446f031c27d4eae9f0ff7d3e4565
|
||||
timeCreated: 1530670154
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class PrefsConst
|
||||
{
|
||||
public const bool BoolDefault = false;
|
||||
public const int IntDefault = 0;
|
||||
public const int IntTrue = 1;
|
||||
public const int IntFalse = 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6cb940cabfde0ad4c8a849ca893d686c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,21 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class PrefsKeyConst
|
||||
{
|
||||
public const string Application_isHDMode = "Application_isHDMode";
|
||||
public const string Application_isHFRMode = "Application_isHFRMode";
|
||||
public const string UIMgr_switchLanguage = "UIMgr_switchLanguage";
|
||||
public const string AudioMgr_isOpenBGM = "AudioMgr_isOpenBGM";
|
||||
public const string AudioMgr_isOpenEffect = "AudioMgr_isOpenEffect";
|
||||
public const string App_isNewInstall = "App_isNewInstall";
|
||||
public const string JarvisToken = "JarvisToken";
|
||||
public const string C_ThroughMaxToday = "C_ThroughMaxToday";
|
||||
public const string C_ThroughPop = "C_ThroughPop";
|
||||
public const string C_ThroughOnline = "C_ThroughOnline";
|
||||
|
||||
public const string C_ThroughHide = "C_ThroughHide";
|
||||
|
||||
public const string C_ThroughFly = "C_ThroughFly";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: bec1a938462feda4eba6b162b9a387e0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class ScreenConst
|
||||
{
|
||||
public static Vector2 StandardResolution = new(AppConst.StandardResolution.x, AppConst.StandardResolution.y);
|
||||
public static float StandardWidth => AppConst.StandardResolution.x;
|
||||
public static float StandardHeight => AppConst.StandardResolution.y;
|
||||
public static Vector2 RawResolution = new(Screen.width, Screen.height);
|
||||
public static Vector2 CurrResolution = new(Screen.width, Screen.height);
|
||||
public static float OrthographicSize_1280H = StandardHeight / 2 / AppConst.PixelsPerUnit;
|
||||
public static float StandardAspectRatio = StandardHeight / StandardWidth;
|
||||
public static float CurrAspectRatio = (float)Screen.height / Screen.width;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 76e7d3de03bd12a44b19e935ea71697a
|
||||
timeCreated: 1534935298
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,41 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class UILayerConst
|
||||
{
|
||||
public const string Background = "Background";
|
||||
public const string Bottom = "Bottom";
|
||||
|
||||
public const string Normal = "Normal";
|
||||
public const string Top = "Top";
|
||||
|
||||
public const string FullScreen = "FullScreen";
|
||||
public const string Popup = "Popup";
|
||||
|
||||
public const string Highest = "Highest";
|
||||
public const string Animation = "Animation";
|
||||
public const string Tips = "Tips";
|
||||
|
||||
public const string Loading = "Loading";
|
||||
public const string System = "System";
|
||||
public const string NetworkError = "NetworkError";
|
||||
|
||||
public static readonly string[] AllUILayer = {
|
||||
Background,
|
||||
Bottom,
|
||||
|
||||
Normal,
|
||||
Top,
|
||||
|
||||
FullScreen,
|
||||
Popup,
|
||||
|
||||
Highest,
|
||||
Animation,
|
||||
Tips,
|
||||
|
||||
Loading,
|
||||
System,
|
||||
NetworkError
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a1cfef99d74aac943a6872498ec8fb4f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,11 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class VectorConst
|
||||
{
|
||||
public static Vector3 One = Vector3.one;
|
||||
public static Vector3 PPUOne = One * AppConst.PixelsPerUnit;
|
||||
public static Vector3 Half = new(0.5f, 0.5f, 0.5f);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae89e346ddf1a584382a1deb4b78193a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class YieldConst
|
||||
{
|
||||
public const float Time10ms = 0.01f;
|
||||
public const float Time100ms = 0.1f;
|
||||
|
||||
public static WaitForEndOfFrame WaitForEndOfFrame = new WaitForEndOfFrame();
|
||||
public static WaitForSeconds WaitFor100ms = new WaitForSeconds(Time100ms);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6248774d8e1b69d46a89ad1ea46081ac
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f14f42c47ff29474bb4170a49c3bc8c1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static partial class CtrlMsg
|
||||
{
|
||||
public const string NAME = "CtrlMsg";
|
||||
public const uint BASE = 0;
|
||||
private static uint Cursor_BASE = BASE;
|
||||
public static readonly uint Login_Succeed = ++Cursor_BASE;
|
||||
public static readonly uint Game_StartReady = ++Cursor_BASE;
|
||||
public static readonly uint Game_Start = ++Cursor_BASE;
|
||||
|
||||
public static readonly uint open_wb = ++Cursor_BASE;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 19bfc133c0819ad4486cceca51c8a2e3
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static partial class GameMsg
|
||||
{
|
||||
public const string NAME = "GameMsg";
|
||||
public const uint BASE = 0;
|
||||
private static uint Cursor_BASE = BASE;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7d7b577419d940f468e1a95a9afb1dd9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static partial class UICtrlMsg
|
||||
{
|
||||
public const string NAME = "UICtrlMsg";
|
||||
public const uint BASE = 0;
|
||||
private static uint Cursor_BASE = BASE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fb50862938136744db6a10a950ab4a27
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05068ae3f93705047a7ad62030047667
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,18 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ChangeValue<T>
|
||||
{
|
||||
public T oldValue;
|
||||
public T newValue;
|
||||
|
||||
public ChangeValue()
|
||||
{
|
||||
}
|
||||
|
||||
public ChangeValue(T oldValue, T newValue)
|
||||
{
|
||||
this.oldValue = oldValue;
|
||||
this.newValue = newValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c53b34a8fdfa77143b24d0660057d5a7
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f185af0ac6ec3f548bed55863e2f65e8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 10e424129050f3a4ab3fdc991bf91318
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,132 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public abstract class BaseDispatcher<T, Msg, Param> : IDisposable where T : class, new() where Param : class
|
||||
{
|
||||
private static T m_instance;
|
||||
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_instance == null)
|
||||
{
|
||||
m_instance = new T();
|
||||
}
|
||||
|
||||
return m_instance;
|
||||
}
|
||||
}
|
||||
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgPriorityDict = new();
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgDict = new();
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgFinallyDict = new();
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgOnceDict = new();
|
||||
|
||||
public void AddListener(Msg msgId, Action<Param> listener)
|
||||
{
|
||||
if (m_msgDict.TryGetValue(msgId, out var value))
|
||||
{
|
||||
value.Add(listener);
|
||||
}
|
||||
else
|
||||
{
|
||||
var list = ListPool<Action<Param>>.Get();
|
||||
list.Add(listener);
|
||||
m_msgDict.Add(msgId, list);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddOnceListener(Msg msgId, Action<Param> listener)
|
||||
{
|
||||
if (m_msgOnceDict.TryGetValue(msgId, out var value))
|
||||
{
|
||||
value.Add(listener);
|
||||
}
|
||||
else
|
||||
{
|
||||
var list = ListPool<Action<Param>>.Get();
|
||||
list.Add(listener);
|
||||
m_msgOnceDict.Add(msgId, list);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveListener(Msg msgId, Action<Param> listener)
|
||||
{
|
||||
if (m_msgDict.TryGetValue(msgId, out var list))
|
||||
{
|
||||
if (list.Contains(listener))
|
||||
{
|
||||
list.Remove(listener);
|
||||
if (list.Count == 0)
|
||||
{
|
||||
ListPool<Action<Param>>.Release(list);
|
||||
m_msgDict.Remove(msgId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispatch(Msg msgId, Param param = null)
|
||||
{
|
||||
InvokeMethods(m_msgPriorityDict, msgId, param);
|
||||
InvokeMethods(m_msgDict, msgId, param);
|
||||
InvokeMethods(m_msgFinallyDict, msgId, param);
|
||||
InvokeMethods(m_msgOnceDict, msgId, param);
|
||||
|
||||
if (m_msgOnceDict.ContainsKey(msgId))
|
||||
{
|
||||
ListPool<Action<Param>>.Release(m_msgOnceDict[msgId]);
|
||||
m_msgOnceDict.Remove(msgId);
|
||||
}
|
||||
}
|
||||
|
||||
private void InvokeMethods(Dictionary<Msg, List<Action<Param>>> msgDict, Msg msgId, Param param)
|
||||
{
|
||||
if (!msgDict.ContainsKey(msgId)) return;
|
||||
|
||||
var rawList = msgDict[msgId];
|
||||
int funcCount = rawList.Count;
|
||||
if (funcCount == 1)
|
||||
{
|
||||
Action<Param> onEvent = rawList[0];
|
||||
onEvent(param);
|
||||
return;
|
||||
}
|
||||
|
||||
var invokeFuncs = ListPool<Action<Param>>.Get();
|
||||
invokeFuncs.AddRange(rawList);
|
||||
for (var i = 0; i < funcCount; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
var onEvent = invokeFuncs[i];
|
||||
onEvent(param);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
}
|
||||
}
|
||||
|
||||
ListPool<Action<Param>>.Release(invokeFuncs);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
m_instance = null;
|
||||
|
||||
m_msgPriorityDict.Clear();
|
||||
m_msgDict.Clear();
|
||||
m_msgFinallyDict.Clear();
|
||||
m_msgOnceDict.Clear();
|
||||
m_msgPriorityDict = null;
|
||||
m_msgDict = null;
|
||||
m_msgFinallyDict = null;
|
||||
m_msgOnceDict = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c4b55125cefc9754888cccfc76bee4c9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class BaseMainThreadDispatcher<T, Msg, Param> : SingletonUnity<T>
|
||||
where T : SingletonUnity<T>
|
||||
where Param : class
|
||||
{
|
||||
private class MainThreadMsgClass
|
||||
{
|
||||
public Msg currMsgId;
|
||||
public Param currParam;
|
||||
}
|
||||
|
||||
private Queue<MainThreadMsgClass> m_msgQueue = new Queue<MainThreadMsgClass>();
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgPriorityDict = new Dictionary<Msg, List<Action<Param>>>();
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgDict = new Dictionary<Msg, List<Action<Param>>>();
|
||||
private Dictionary<Msg, List<Action<Param>>> m_msgOnceDict = new Dictionary<Msg, List<Action<Param>>>();
|
||||
|
||||
private object m_queueLock = new object();
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (m_msgQueue.Count <= 0) return;
|
||||
|
||||
while (m_msgQueue.Count > 0)
|
||||
{
|
||||
MainThreadMsgClass msg;
|
||||
lock (m_queueLock)
|
||||
{
|
||||
msg = m_msgQueue.Dequeue();
|
||||
}
|
||||
|
||||
AutoDispatch(msg.currMsgId, msg.currParam);
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispatch(Msg msgId, Param param = null)
|
||||
{
|
||||
if (!m_msgPriorityDict.ContainsKey(msgId)
|
||||
&& !m_msgDict.ContainsKey(msgId)
|
||||
&& !m_msgOnceDict.ContainsKey(msgId))
|
||||
return;
|
||||
|
||||
MainThreadMsgClass msg = new MainThreadMsgClass
|
||||
{
|
||||
currMsgId = msgId,
|
||||
currParam = param,
|
||||
};
|
||||
lock (m_queueLock)
|
||||
{
|
||||
m_msgQueue.Enqueue(msg);
|
||||
}
|
||||
}
|
||||
|
||||
private void AutoDispatch(Msg msgId, Param param)
|
||||
{
|
||||
InvokeMethods(m_msgPriorityDict, msgId, param);
|
||||
InvokeMethods(m_msgDict, msgId, param);
|
||||
InvokeMethods(m_msgOnceDict, msgId, param);
|
||||
|
||||
if (m_msgOnceDict.ContainsKey(msgId))
|
||||
{
|
||||
ListPool<Action<Param>>.Release(m_msgOnceDict[msgId]);
|
||||
m_msgOnceDict.Remove(msgId);
|
||||
}
|
||||
}
|
||||
|
||||
private void InvokeMethods(Dictionary<Msg, List<Action<Param>>> msgDict, Msg msgId, Param param)
|
||||
{
|
||||
if (!msgDict.ContainsKey(msgId)) return;
|
||||
|
||||
List<Action<Param>> rawList = msgDict[msgId];
|
||||
int funcCount = rawList.Count;
|
||||
if (funcCount == 1)
|
||||
{
|
||||
Action<Param> onEvent = rawList[0];
|
||||
onEvent(param);
|
||||
return;
|
||||
}
|
||||
|
||||
List<Action<Param>> invokeFuncs = ListPool<Action<Param>>.Get();
|
||||
invokeFuncs.AddRange(rawList);
|
||||
for (int i = 0; i < funcCount; i++)
|
||||
{
|
||||
try
|
||||
{
|
||||
Action<Param> onEvent = invokeFuncs[i];
|
||||
onEvent(param);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError(e);
|
||||
}
|
||||
}
|
||||
|
||||
ListPool<Action<Param>>.Release(invokeFuncs);
|
||||
}
|
||||
|
||||
protected override string ParentRootName
|
||||
{
|
||||
get { return AppObjConst.DispatcherGoName; }
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
|
||||
m_msgPriorityDict.Clear();
|
||||
m_msgDict.Clear();
|
||||
m_msgOnceDict.Clear();
|
||||
m_msgPriorityDict = null;
|
||||
m_msgDict = null;
|
||||
m_msgOnceDict = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e02321e1c5d556b4484a914fec6eafbd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7926ab78fe6049f3bff905262b9b4695
|
||||
timeCreated: 1682307945
|
||||
@@ -0,0 +1,4 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class AppDispatcher : BaseDispatcher<AppDispatcher, uint, object> { }
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38ec268add4ac6743a27b7167bdcb36a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class CtrlDispatcher : BaseDispatcher<CtrlDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f627301519ad9ac43ba05e525564d3a5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class DataDispatcher : BaseDispatcher<DataDispatcher, string, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 080dce14c0be15a448f7a6f1d316700f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class GameDispatcher : BaseDispatcher<GameDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ab8a1624eafed174385147056385f287
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class MainThreadDispatcher : BaseMainThreadDispatcher<MainThreadDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cc759fa7eaebc574da1d3990ca6acfa5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class ModelDispatcher : BaseDispatcher<ModelDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 730ba6382f4f49444a8219f08543f431
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class NetworkDispatcher : BaseDispatcher<NetworkDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 81a02ff4d9ca458aa70fe26ab514bb99
|
||||
timeCreated: 1681977441
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class PreferencesDispatcher<T> : BaseDispatcher<PreferencesDispatcher<T>, string, ChangeValue<T>>
|
||||
{
|
||||
public ChangeValue<T> changeValue;
|
||||
|
||||
public PreferencesDispatcher()
|
||||
{
|
||||
changeValue = new ChangeValue<T>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9387267f575e6bb4ca279738a461ad61
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public class UICtrlDispatcher : BaseDispatcher<UICtrlDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f1a26910085caa349b769e0be54a023a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 29aecd4f55584cddae5eb19c86727362
|
||||
timeCreated: 1682308355
|
||||
@@ -0,0 +1,26 @@
|
||||
public static class AppMsg
|
||||
{
|
||||
public const uint BASE = 0;
|
||||
private static uint Cursor_BASE = BASE;
|
||||
public static readonly uint App_Quit = ++Cursor_BASE;
|
||||
public static readonly uint App_Focus_False = ++Cursor_BASE;
|
||||
public static readonly uint App_Pause_True = ++Cursor_BASE;
|
||||
public static readonly uint App_GamePause = ++Cursor_BASE;
|
||||
public static readonly uint App_GameResume = ++Cursor_BASE;
|
||||
public static readonly uint App_SwitchLanguage = ++Cursor_BASE;
|
||||
public static readonly uint UI_DisplayLoadingUI = ++Cursor_BASE;
|
||||
public static readonly uint UI_HideLoadingUI = ++Cursor_BASE;
|
||||
public static readonly uint UI_LoadingInitAsset = ++Cursor_BASE;
|
||||
public static readonly uint AppManagerRegister = ++Cursor_BASE;
|
||||
public static readonly uint InitUIMgr = ++Cursor_BASE;
|
||||
public static readonly uint UIEvent_UIOpen = ++Cursor_BASE;
|
||||
public static readonly uint UIEvent_UIClose = ++Cursor_BASE;
|
||||
public static readonly uint UIEvent_UIDisplay = ++Cursor_BASE;
|
||||
public static readonly uint UIEvent_UIHide = ++Cursor_BASE;
|
||||
public static readonly uint KeyCode_Home = ++Cursor_BASE;
|
||||
public static readonly uint KeyCode_Escape = ++Cursor_BASE;
|
||||
public static readonly uint TimeScale_Change = ++Cursor_BASE;
|
||||
public static readonly uint WorldRaycast_EnableChange = ++Cursor_BASE;
|
||||
public static readonly uint App_Focus_True = ++Cursor_BASE;
|
||||
public static readonly uint LoginInit = ++Cursor_BASE;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2b87eaa2cadb1da4f8dba83b0b9d3731
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
public static class MainThreadMsg
|
||||
{
|
||||
public const uint BASE = 0;
|
||||
private static uint Cursor_BASE = BASE;
|
||||
public static readonly uint App_Focus_True = ++Cursor_BASE;
|
||||
public static readonly uint App_Pause_False = ++Cursor_BASE;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0061a4ff521ce154c8ca284f91d1cf8f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,53 @@
|
||||
using System.Collections.Generic;
|
||||
using SGModule.Net;
|
||||
using UnityEngine;
|
||||
using RespDebugData = ChillConnect.RespDebugData;
|
||||
|
||||
|
||||
public class ErrorLogger : MonoBehaviour
|
||||
{
|
||||
// 用于存储报错信息的列表
|
||||
private List<string> errorLogs = new List<string>();
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
// 注册事件处理函数
|
||||
Application.logMessageReceived += HandleLog;
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
// 注销事件处理函数
|
||||
Application.logMessageReceived -= HandleLog;
|
||||
}
|
||||
|
||||
// 事件处理函数
|
||||
void HandleLog(string logString, string stackTrace, LogType type)
|
||||
{
|
||||
// 只处理错误和异常类型的日志
|
||||
if (type == LogType.Error || type == LogType.Exception)
|
||||
{
|
||||
// 将报错信息和堆栈跟踪添加到列表中
|
||||
errorLogs.Add(logString);
|
||||
errorLogs.Add(stackTrace);
|
||||
|
||||
// 这里可以添加代码将报错信息发送给服务器
|
||||
SendErrorToServer(logString, stackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
// 如何将报错信息发送给服务器
|
||||
void SendErrorToServer(string error, string stackTrace)
|
||||
{
|
||||
// Debug.Log($"SendErrorToServer-----------error\n{error}");
|
||||
// Debug.Log($"SendErrorToServer-----------stackTrace\n{stackTrace}");
|
||||
// 这里填写将报错信息发送到服务器的代码
|
||||
// var reqData = new RespDebugData
|
||||
// {
|
||||
// level = "error",
|
||||
// message = error,
|
||||
// stacktrace = stackTrace
|
||||
// };
|
||||
// ErrorLogManager.GetInstance.SendLog("error",error,stackTrace);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 09f1ea8ad17232b42b0cf5073edbaec0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b5af2e719d8d8cd4891e2098b3dad9e8
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,24 @@
|
||||
namespace ChillConnect
|
||||
{
|
||||
public static class StringExtend
|
||||
{
|
||||
public static double ToDouble(this string str)
|
||||
{
|
||||
double temp = 0d;
|
||||
double.TryParse(str, out temp);
|
||||
return temp;
|
||||
}
|
||||
|
||||
public static float ToFloat(this string str)
|
||||
{
|
||||
float temp = 0;
|
||||
float.TryParse(str, out temp);
|
||||
return temp;
|
||||
}
|
||||
|
||||
public static bool IsNullOrWhiteSpace(this string str)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user