fix:1、添加项目
This commit is contained in:
@@ -0,0 +1,401 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using FGUI.P01_Common;
|
||||
using FlowerPower;
|
||||
using UnityEngine;
|
||||
public class AdRdManager
|
||||
{
|
||||
public static readonly AdRdManager Instance = new AdRdManager();
|
||||
|
||||
AdRdManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public const string MakeupAd = "MakeupAd";
|
||||
public const string SavingPotMakeupAd = "SavingPotMakeupAd";
|
||||
public const string MakeupLVAd = "MakeupLVAd";
|
||||
|
||||
|
||||
public void Rd(AdRdData _data)
|
||||
{
|
||||
if (Time.time - SaveData.rd_time < 2)
|
||||
{
|
||||
GameHelper.ShowTips("Clicks are too frequent");
|
||||
return;
|
||||
}
|
||||
SaveData.rd_time = Time.time;
|
||||
|
||||
int myAdNum = GetLookRewardADNum();
|
||||
if (myAdNum >= _data.ad_count)
|
||||
{
|
||||
if (_data.type == PurchasingManager.pack_reward || _data.type == PurchasingManager.remove_ad || _data.type.StartsWith("buy_gold"))
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.BuyConfirmUI_Open, _data);
|
||||
}
|
||||
else
|
||||
{
|
||||
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.pack_reward && SaveData.GetSaveobject().is_get_packreward;
|
||||
bool is_get1 = item.Key == PurchasingManager.remove_ad && SaveData.GetSaveobject().is_get_removead;
|
||||
|
||||
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;
|
||||
switch (name)
|
||||
{
|
||||
case PurchasingManager.buy_one:
|
||||
double addspace = config.addspace;
|
||||
needAds = (int)Math.Ceiling(addspace);
|
||||
break;
|
||||
case PurchasingManager.buy_one_off:
|
||||
double addspace1 = config.AddDiscount;
|
||||
needAds = (int)Math.Ceiling(addspace1);
|
||||
break;
|
||||
case PurchasingManager.battle_pass:
|
||||
double Passportgift = config.Passportgift;
|
||||
needAds = (int)Math.Ceiling(Passportgift);
|
||||
break;
|
||||
case PurchasingManager.pack_reward:
|
||||
double Paid_price = packdata[0].Paid_price;
|
||||
needAds = (int)Math.Ceiling(Paid_price);
|
||||
break;
|
||||
case PurchasingManager.remove_ad:
|
||||
double move_price = packdata[1].Paid_price;
|
||||
needAds = (int)Math.Ceiling(move_price);
|
||||
break;
|
||||
case PurchasingManager.buy_gold_1:
|
||||
needAds = (int)Math.Ceiling(getCoinNeedAds(name));
|
||||
break;
|
||||
case PurchasingManager.buy_gold_2:
|
||||
needAds = (int)Math.Ceiling(getCoinNeedAds(name));
|
||||
break;
|
||||
case PurchasingManager.buy_gold_3:
|
||||
needAds = (int)Math.Ceiling(getCoinNeedAds(name));
|
||||
break;
|
||||
case PurchasingManager.buy_gold_4:
|
||||
needAds = (int)Math.Ceiling(getCoinNeedAds(name));
|
||||
break;
|
||||
case PurchasingManager.buy_gold_5:
|
||||
needAds = (int)Math.Ceiling(getCoinNeedAds(name));
|
||||
break;
|
||||
case MakeupAd:
|
||||
needAds = 99999;
|
||||
break;
|
||||
case SavingPotMakeupAd:
|
||||
needAds = 99999;
|
||||
break;
|
||||
case MakeupLVAd:
|
||||
needAds = 99999;
|
||||
break;
|
||||
}
|
||||
|
||||
// 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 double getCoinNeedAds(string sku)
|
||||
{
|
||||
Paidcoins result = coinList.FirstOrDefault(c => c.SKU == sku);
|
||||
if (result != null)
|
||||
{
|
||||
return result.Payment_amount;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
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;
|
||||
AdRdData adRdData = new AdRdData()
|
||||
{
|
||||
type = key,
|
||||
ad_count = GetCeilingNeedAds(key)
|
||||
};
|
||||
Rd(adRdData);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
item.buy_state.selectedIndex = btn_watchAd.Buy_state_ad;
|
||||
bool is_get = key == PurchasingManager.pack_reward && SaveData.GetSaveobject().is_get_packreward;
|
||||
bool is_get1 = key == PurchasingManager.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 eventClickName = "";
|
||||
string eventSuccName = "";
|
||||
switch (name)
|
||||
{
|
||||
case PurchasingManager.pack_reward:
|
||||
eventClickName = BuriedPointEvent.pack_click;
|
||||
eventSuccName = BuriedPointEvent.pack_success;
|
||||
break;
|
||||
case PurchasingManager.remove_ad:
|
||||
eventClickName = BuriedPointEvent.remove_ad_click;
|
||||
eventSuccName = BuriedPointEvent.remove_ad_success;
|
||||
break;
|
||||
// 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;
|
||||
case PurchasingManager.battle_pass:
|
||||
eventClickName = BuriedPointEvent.pass_click;
|
||||
eventSuccName = BuriedPointEvent.pass_success;
|
||||
break;
|
||||
case PurchasingManager.buy_one:
|
||||
eventClickName = BuriedPointEvent.buy_one_click;
|
||||
eventSuccName = BuriedPointEvent.buy_one_success;
|
||||
break;
|
||||
case PurchasingManager.buy_one_off:
|
||||
eventClickName = BuriedPointEvent.BuyOneOffClick;
|
||||
eventSuccName = BuriedPointEvent.BuyOneOffSuccess;
|
||||
break;
|
||||
}
|
||||
|
||||
if (name.StartsWith("buy_gold"))
|
||||
{
|
||||
int startIndex = "buy_gold".Length;
|
||||
string suffix = name[startIndex..]; // 截取 "gold" 后的所有字符
|
||||
eventClickName = $"gold_click_{suffix}";
|
||||
eventSuccName = $"gold_success_{suffix}";
|
||||
}
|
||||
|
||||
if (type == "success" && eventSuccName != "")
|
||||
{
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_AD_event, eventSuccName, 1);
|
||||
}
|
||||
else if (type == "click" && eventClickName != "")
|
||||
{
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_AD_event, eventClickName, 1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class AdRdData
|
||||
{
|
||||
public string type;
|
||||
public int ad_count;
|
||||
public string shopName;
|
||||
}
|
||||
public class orderState
|
||||
{
|
||||
public string order_id;
|
||||
public int status;
|
||||
|
||||
}
|
||||
public class orderData
|
||||
{
|
||||
public string order_id;
|
||||
public string pay_url;
|
||||
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 FlowerPower
|
||||
{
|
||||
public static class App
|
||||
{
|
||||
private static SApplication _sCurrSApplication = null;
|
||||
|
||||
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.5f, () => { 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,169 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using AppsFlyerSDK;
|
||||
using System.Collections.Generic;
|
||||
using FlowerPower;
|
||||
using Unity.Advertisement.IosSupport;
|
||||
using System;
|
||||
using DG.Tweening;
|
||||
|
||||
namespace IgnoreOPS
|
||||
{
|
||||
|
||||
|
||||
internal class AppsFlyerObjectScript1 : MonoBehaviour, IAppsFlyerConversionData
|
||||
{
|
||||
public string appID = null;
|
||||
public bool is_init = false;
|
||||
|
||||
public Coroutine m_Coroutine;
|
||||
void Start()
|
||||
{
|
||||
AddListener();
|
||||
AppsFlyer.setIsDebug(true);
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
appID = "6745081004";
|
||||
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 RequestLogin(object obj = null)
|
||||
{
|
||||
if (GameHelper.IsConnect())
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Network_reconnection);
|
||||
}
|
||||
|
||||
CrazyAsyKit.StopCoroutine(m_Coroutine);
|
||||
|
||||
m_Coroutine = CrazyAsyKit.StartCoroutine(loopWaitInitAf());
|
||||
}
|
||||
|
||||
void OnDestroy() {
|
||||
RemoveListener();
|
||||
}
|
||||
|
||||
public IEnumerator loopWaitInitAf()
|
||||
{
|
||||
// Debug.Log($"barry !GameHelper.IsConnect()==== {!GameHelper.IsConnect()}");
|
||||
|
||||
#if !FlowerPowerRelease
|
||||
GameHelper.ShowTips($"is link network:{GameHelper.IsConnect()}");
|
||||
#endif
|
||||
if (!GameHelper.IsConnect())
|
||||
{
|
||||
Action action = () =>
|
||||
{
|
||||
DOVirtual.DelayedCall(0.5f, ()=>
|
||||
{
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.NotNetwork);
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
});
|
||||
};
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.TipsViewUI_Open,action);
|
||||
yield return null;
|
||||
}
|
||||
|
||||
var reqData = new RespLoginFunnelData
|
||||
{
|
||||
type = "afSend",
|
||||
payload = ""
|
||||
};
|
||||
NetworkKit.PostFunnelLogin(reqData);
|
||||
|
||||
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("MoPyHQ7ZLXpqouczgQkNdU", appID, this);
|
||||
AppsFlyer.startSDK();
|
||||
AppsFlyer.AFLog("8888888888888888888", ATTrackingStatusBinding.GetAuthorizationTrackingStatus().ToString());
|
||||
//yield return new WaitForSeconds(0.5f);
|
||||
|
||||
}
|
||||
|
||||
public void onConversionDataSuccess(string conversionData)
|
||||
{
|
||||
if (is_init) return;
|
||||
is_init = true;
|
||||
AppsFlyer.AFLog("onConversionDataSuccess", conversionData);
|
||||
Debug.Log("hunxiao0000000000000000000000-1");
|
||||
var conversionDataDictionary = AppsFlyer.CallbackStringToDictionary(conversionData);
|
||||
var json = SerializeUtil.ToJsonIndented(conversionDataDictionary);
|
||||
// Debug.Log("hunxiao0000000000000000000000-2");
|
||||
SuperApplication.Instance.attribution =
|
||||
conversionDataDictionary.TryGetValue("af_status", out var afStatus)
|
||||
? afStatus.ToString().ToLower()
|
||||
: "organic";
|
||||
|
||||
// Debug.Log("hunxiao0000000000000000000000");
|
||||
// if (GameHelper.IsConnect())
|
||||
// {
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
// }
|
||||
|
||||
var reqData = new RespLoginFunnelData
|
||||
{
|
||||
type = "afRecv",
|
||||
payload = "success"
|
||||
};
|
||||
NetworkKit.PostFunnelLogin(reqData);
|
||||
}
|
||||
|
||||
public void onConversionDataFail(string error)
|
||||
{
|
||||
if (is_init) return;
|
||||
is_init = true;
|
||||
AppsFlyer.AFLog("onConversionDataFail", error);
|
||||
Debug.Log("hunxiao0000000000000000000000-2");
|
||||
// if (GameHelper.IsConnect())
|
||||
// {
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
// }
|
||||
|
||||
var reqData = new RespLoginFunnelData
|
||||
{
|
||||
type = "afRecv",
|
||||
payload = "fail"
|
||||
};
|
||||
NetworkKit.PostFunnelLogin(reqData);
|
||||
}
|
||||
|
||||
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: 5c0b9181be750404f8e1e5d21eb8fa14
|
||||
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 FlowerPower
|
||||
{
|
||||
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 @@
|
||||
namespace FlowerPower
|
||||
{
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
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 @@
|
||||
namespace FlowerPower
|
||||
{
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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,20 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using System.Runtime.InteropServices;
|
||||
using UnityEditor;
|
||||
|
||||
|
||||
public class BrigdeIOS
|
||||
{
|
||||
#if UNITY_IOS
|
||||
[DllImport("__Internal")]
|
||||
public static extern void DakaiACT();
|
||||
[DllImport("__Internal")]
|
||||
public static extern void initACTData();
|
||||
[DllImport("__Internal")]
|
||||
public static extern void ShezhiACT(bool act);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void copyText(string text);
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0aa81e3804f74072ac4386673f77421
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,281 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Spine.Unity;
|
||||
using UnityEngine;
|
||||
using FlowerPower;
|
||||
|
||||
public class CreatAnimalCard : MonoBehaviour
|
||||
{
|
||||
private GameObject card_item;
|
||||
|
||||
public static CreatAnimalCard instance;
|
||||
private List<Sprite> img_list;
|
||||
|
||||
public Camera orthoCamera; // 这个变量应该被设置为您想要调整大小的正交相机
|
||||
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
card_item = Resources.Load<GameObject>("card/card_item/card_");
|
||||
img_list = new List<Sprite>();
|
||||
// img_list = Resources.LoadAll<Sprite>("card/card_sprite").ToList();
|
||||
// img_list.Sort((x, y) => String.Compare(x.name, y.name));
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
img_list.Add(Resources.Load<Sprite>("card/card_sprite/" + i));
|
||||
|
||||
}
|
||||
orthoCamera = GameObject.Find("GameCamera").GetComponent<Camera>();
|
||||
|
||||
float size = 49.9f;
|
||||
string type = SystemInfo.deviceModel.ToLower().Trim();
|
||||
// Debug.Log($"type========={type}=={type.Substring(0, 3)}");
|
||||
if (type.Substring(0, 3) == "iph")
|
||||
{//iPad机型
|
||||
size = (float)Math.Round(28.125f / ((float)Screen.width / Screen.height), 4);
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
size = (float)Math.Round(28.125f / ((float)Screen.width / Screen.height), 4);
|
||||
#endif
|
||||
|
||||
orthoCamera.orthographicSize = size;
|
||||
|
||||
}
|
||||
|
||||
public void SetCameraVisible(bool visible)
|
||||
{
|
||||
orthoCamera.SetActive(visible);
|
||||
GameHelper.ShowSheepPlayUI(visible);
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
|
||||
public List<List<Card_item>> card_item_list = new List<List<Card_item>>();
|
||||
public List<List<Card_item>> CreatCardNew(int all_card_numbers, int card_type_max, int card_layer, int extra_max, List<List<Vector2>> map_list, List<Vector2> left_extra_list,
|
||||
List<Vector2> right_extra_list)
|
||||
|
||||
{
|
||||
|
||||
//all_card_numbers *= 3;
|
||||
int money_rate = ConfigSystem.GetConfig<CommonModel>().rewardrate;
|
||||
List<int> type_list = new List<int>();
|
||||
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;
|
||||
// }
|
||||
|
||||
for (int i = 0; i < all_card_numbers; i++)
|
||||
{
|
||||
int type = 0;
|
||||
if (GameHelper.IsGiftSwitch() && UnityEngine.Random.Range(0, 100) < money_rate) type = 15;
|
||||
else type = UnityEngine.Random.Range(0, card_type_max);
|
||||
if (!GameHelper.IsGiftSwitch() && type == 15){
|
||||
type = UnityEngine.Random.Range(0, card_type_max-1);
|
||||
}
|
||||
|
||||
type_list.Add(type);
|
||||
type_list.Add(type);
|
||||
type_list.Add(type);
|
||||
if (!this_timetype_list.Contains(type)) this_timetype_list.Add(type);
|
||||
}
|
||||
SaveData.GetSaveobject().this_time_cardtype = this_timetype_list.Count;
|
||||
|
||||
for (int i = 0; i < card_layer; i++)
|
||||
{
|
||||
card_item_list.Add(new List<Card_item>());
|
||||
}
|
||||
if (left_extra_list.Count > 0 || right_extra_list.Count > 0)
|
||||
{
|
||||
for (int i = 0; i < left_extra_list.Count; i++)
|
||||
{
|
||||
|
||||
Card_item _tempObject = new()
|
||||
{
|
||||
pos_x = left_extra_list[i].x,
|
||||
pos_y = left_extra_list[i].y,
|
||||
_layer = i
|
||||
};
|
||||
card_item_list[i].Add(_tempObject);
|
||||
|
||||
}
|
||||
for (int i = 0; i < right_extra_list.Count; i++)
|
||||
{
|
||||
Card_item _tempObject1 = new()
|
||||
{
|
||||
pos_x = right_extra_list[i].x,
|
||||
pos_y = right_extra_list[i].y,
|
||||
_layer = i
|
||||
};
|
||||
card_item_list[i].Add(_tempObject1);
|
||||
}
|
||||
}
|
||||
|
||||
var nums = 0;
|
||||
for (int i = 0; i < map_list.Count; i++)
|
||||
{
|
||||
nums += map_list[i].Count;
|
||||
}
|
||||
|
||||
for (int i = 0; i < nums; i++)
|
||||
{
|
||||
Card_item _tempObject = new();
|
||||
|
||||
int layer = getMaplayer(map_list);//确定层数
|
||||
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;
|
||||
|
||||
card_item_list[layer].Add(_tempObject);
|
||||
map_list[layer].RemoveAt(pos);
|
||||
|
||||
}
|
||||
for (int i = 0; i < card_item_list.Count; i++)
|
||||
{
|
||||
card_item_list[i].Sort((x, y) => y.pos_y.CompareTo(x.pos_y));
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
for (int i = 0; i < card_item_list.Count; i++)
|
||||
{
|
||||
float z_offset = 0;//用来微调每层之间的z值,让下层盖住上层
|
||||
float last_posy = 0;
|
||||
for (int j = 0; j < card_item_list[i].Count; j++)
|
||||
{
|
||||
if (last_posy != card_item_list[i][j].pos_y)
|
||||
{
|
||||
z_offset += 0.05f;
|
||||
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 = 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];
|
||||
temp.gameObject.name = i + "-" + j;
|
||||
type_list.RemoveAt(index);
|
||||
}
|
||||
}
|
||||
return card_item_list;
|
||||
|
||||
|
||||
}
|
||||
public void creatSaveCard(List<List<Card_item>> card_item_list)
|
||||
{
|
||||
this.card_item_list = card_item_list;
|
||||
for (int i = 0; i < card_item_list.Count; i++)
|
||||
{
|
||||
for (int j = 0; j < card_item_list[i].Count; j++)
|
||||
{
|
||||
GameObject temp;
|
||||
// if (card_item_list[i][j].is_out)
|
||||
// {
|
||||
// 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].out_layer), Quaternion.identity, gameObject.transform);
|
||||
// }
|
||||
// else
|
||||
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.628f, 4.628f, 1);
|
||||
temp.gameObject.name = i + "-" + j;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
private GameObject Popup;
|
||||
|
||||
private GameObject Normal;
|
||||
#if UNITY_EDITOR || UNITY_IOS
|
||||
void Update()
|
||||
{
|
||||
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
|
||||
if (Popup == null) Popup = GameObject.Find("Popup");
|
||||
if (Popup.transform.childCount != 0) return;
|
||||
|
||||
if (Normal == null) Normal = GameObject.Find("Normal");
|
||||
if (Normal.transform.childCount != 0) return;
|
||||
|
||||
Ray ray = orthoCamera.ScreenPointToRay(Input.mousePosition);
|
||||
RaycastHit hit;
|
||||
int layerMask = 1 << 6; // 只与第8层的碰撞器碰撞
|
||||
// 如果射线与layerMask指定层的碰撞器发生碰撞
|
||||
if (Physics.Raycast(ray, out hit, Mathf.Infinity, layerMask))
|
||||
{
|
||||
Debug.Log("Hit " + hit.collider.gameObject.name);
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.card_click, hit.collider.gameObject.name);
|
||||
// 在此处添加点击物体后的逻辑
|
||||
}
|
||||
else
|
||||
{
|
||||
// Debug.Log("No hit");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
private GameObject disappear01;
|
||||
private GameObject disappear02;
|
||||
private static Dictionary<int, GameObject> aniDict = new Dictionary<int, GameObject>();
|
||||
|
||||
public void creatSpine(int type, Vector3 vec3)
|
||||
{
|
||||
// if (disappear01 == null) disappear01 = Resources.Load<GameObject>("card/bg_img/fx_disaappear_01");
|
||||
// if (disappear02 == null) disappear02 = Resources.Load<GameObject>("card/bg_img/fx_disaappear_01");
|
||||
|
||||
// if (type == 0)
|
||||
// {
|
||||
// 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) =>
|
||||
// {
|
||||
// Destroy(temp.gameObject);
|
||||
// };
|
||||
// }
|
||||
// if (type == 2)
|
||||
// {
|
||||
// SkeletonAnimation temp = Instantiate(disappear02, new Vector3(vec3.x, vec3.y, 110), Quaternion.identity, gameObject.transform).GetComponent<SkeletonAnimation>();
|
||||
// temp.AnimationState.SetAnimation(0, "fx_disaappear_01", true);
|
||||
// temp.AnimationState.Complete += (trackEntry) =>
|
||||
// {
|
||||
// Destroy(temp.gameObject);
|
||||
// };
|
||||
// }
|
||||
|
||||
GameObject ani = GetObject(type);
|
||||
SkeletonAnimation temp = Instantiate(ani, new Vector3(vec3.x, vec3.y, 100.5f), Quaternion.identity, gameObject.transform).GetComponent<SkeletonAnimation>();
|
||||
temp.AnimationState.SetAnimation(0, "disappear02", true);
|
||||
// temp.timeScale = 2.5f;
|
||||
temp.AnimationState.Complete += (trackEntry) =>
|
||||
{
|
||||
Destroy(temp.gameObject);
|
||||
};
|
||||
}
|
||||
|
||||
GameObject GetObject(int type) {
|
||||
if (!aniDict.ContainsKey(type)) {
|
||||
if (type == 15) {
|
||||
aniDict[type] = Resources.Load<GameObject>("card/bg_img/fx_disaappear_2");
|
||||
} else {
|
||||
aniDict[type] = Resources.Load<GameObject>("card/bg_img/fx_disaappear_0" + (type + 1));
|
||||
}
|
||||
}
|
||||
return aniDict[type];
|
||||
}
|
||||
|
||||
int getMaplayer(List<List<Vector2>> map_list)
|
||||
{
|
||||
int layer = UnityEngine.Random.Range(0, map_list.Count);//确定层数
|
||||
if (map_list[layer].Count == 0)
|
||||
{
|
||||
layer = getMaplayer(map_list);
|
||||
}
|
||||
return layer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9fb9475b4182b354b84f97ae3ed0a002
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -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 FlowerPower
|
||||
{
|
||||
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 UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlowerPower
|
||||
{
|
||||
public static class AppConst
|
||||
{
|
||||
#region Field
|
||||
|
||||
#if FlowerPowerRelease
|
||||
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 FlowerPower
|
||||
{
|
||||
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,21 @@
|
||||
namespace FlowerPower
|
||||
{
|
||||
public static class AudioConst
|
||||
{
|
||||
public const string click = "click";
|
||||
public const string DailyBonusCollect = "dailyBonus_collect";
|
||||
public const string Coinfly04 = "Coinfly04";
|
||||
public const string hallbgm = "hallbgm";
|
||||
public const string gamebgm = "gamebgm";
|
||||
public const string match = "match";
|
||||
public const string proptips = "proptips";
|
||||
public const string defeat = "defeat";
|
||||
public const string Victory05 = "Victory05";
|
||||
public const string MakeupDone = "makupdone";
|
||||
public const string wheel_spin = "wheel_spin";
|
||||
|
||||
public const string BroadTips = "BroadTips";
|
||||
public const string gamestart = "gamestart";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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,12 @@
|
||||
namespace FlowerPower
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
public class NetworkDispatcher : BaseDispatcher<NetworkDispatcher, uint, object>
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 81a02ff4d9ca458aa70fe26ab514bb99
|
||||
timeCreated: 1681977441
|
||||
@@ -0,0 +1,12 @@
|
||||
namespace FlowerPower
|
||||
{
|
||||
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 FlowerPower
|
||||
{
|
||||
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 UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using FlowerPower;
|
||||
|
||||
|
||||
|
||||
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
|
||||
};
|
||||
NetworkKit.SendLogToServer(reqData);
|
||||
}
|
||||
}
|
||||
@@ -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 FlowerPower
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 79592f013fcf6dc439f2a2940770a250
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07cf9660c4614ccca70ef0f5889aae92
|
||||
timeCreated: 1682316629
|
||||
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
{
|
||||
public static class GameObjectExtend
|
||||
{
|
||||
public static void SetParent(this GameObject gameObject, GameObject parentGo, bool worldPositionStays = false)
|
||||
{
|
||||
if (parentGo)
|
||||
{
|
||||
gameObject.transform.SetParent(parentGo.transform, worldPositionStays);
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetLayer(this GameObject gameObject, string layerName)
|
||||
{
|
||||
Transform[] transArr = gameObject.transform.GetComponentsInChildren<Transform>();
|
||||
for (int i = 0; i < transArr.Length; i++)
|
||||
{
|
||||
transArr[i].gameObject.layer = LayerMask.NameToLayer(layerName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f33a4adea56c7dc41944ee83d4ef3f84
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace FlowerPower
|
||||
{
|
||||
public class GemCrushCore : SingletonUnity<GemCrushCore>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5e963a08d18f37d4886b21170d5fb6ed
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,31 @@
|
||||
using FlowerPower;
|
||||
using UnityEngine;
|
||||
|
||||
public class GemCrushRoot : MonoBehaviour
|
||||
{
|
||||
public void Awake()
|
||||
{
|
||||
#if UNITY_EDITOR || FlowerPowerRelease
|
||||
GameObject.Find("IngameDebugConsole").SetActive(false);
|
||||
#endif
|
||||
MaxADKit.Init();
|
||||
OnLauncher();
|
||||
var reqData = new RespLoginFunnelData
|
||||
{
|
||||
type = "bootstrap",
|
||||
payload = ""
|
||||
};
|
||||
NetworkKit.PostFunnelLogin(reqData);
|
||||
}
|
||||
|
||||
public static void OnLauncher()
|
||||
{
|
||||
AppObjConst.FrameGo = new GameObject($"{AppObjConst.FrameGoName}");
|
||||
AppObjConst.FrameGo.AddComponent<GemCrushCore>();
|
||||
DontDestroyOnLoad(AppObjConst.FrameGo);
|
||||
App.InitApplication(SuperApplication.Instance);
|
||||
|
||||
MarkdownTextManager.Instance.LoadText("privacy", "https://www.flowerlazypower.fun//privacy.md");
|
||||
MarkdownTextManager.Instance.LoadText("user", "https://www.flowerlazypower.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: 291877299927e1d48b21ef2f54bba0eb
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user