fix:1、更换项目,使用winter来创建
This commit is contained in:
@@ -0,0 +1,439 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using LoveLegend;
|
||||
using DG.Tweening;
|
||||
using FGUI.ZM_Common_01;
|
||||
using UnityEngine;
|
||||
using Newtonsoft.Json;
|
||||
using SGModule.Common.Helper;
|
||||
using SGModule.NetKit;
|
||||
using System.Linq;
|
||||
|
||||
public class AdExchangeManager
|
||||
{
|
||||
public static readonly AdExchangeManager Instance = new AdExchangeManager();
|
||||
|
||||
AdExchangeManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// public const string buy_one = "com.rainforestworld.space.24.99";
|
||||
// // public const string buy_gold_1 = "com.rainforestworld.shop.1.99";
|
||||
// // public const string buy_gold_2 = "com.rainforestworld.shop.3.99";
|
||||
// // public const string buy_gold_3 = "com.rainforestworld.shop.19.99";
|
||||
// // public const string buy_gold_4 = "com.rainforestworld.shop.39.99";
|
||||
// public const string remove_ad = "com.rainforestworld.remove.2.99";
|
||||
// public const string battle_pass = "com.rainforestworld.pass.9.99";
|
||||
// public const string pack_reward = "com.rainforestworld.reward.1.99";
|
||||
// public const string fail_pack = "com.rainforestworld.fail.1.99";
|
||||
// public const string three_days_gift = "com.rainforestworld.three.1.99";
|
||||
// public const string secret_albnums = "com.rainforestworld.secret_albnums.3.99";
|
||||
|
||||
|
||||
// private static readonly Dictionary<string, EventTrackMapping> _trackMappings = new()
|
||||
// {
|
||||
// [pack_reward] = new EventTrackMapping
|
||||
// {
|
||||
// EventKey = ADEventTrack.Event,
|
||||
// ClickProperty = _ => ADEventTrack.Property.lucky_gift_click,
|
||||
// SuccessProperty = _ => ADEventTrack.Property.lucky_gift_receive
|
||||
// },
|
||||
// [remove_ad] = new EventTrackMapping
|
||||
// {
|
||||
// EventKey = ADEventTrack.Event,
|
||||
// ClickProperty = _ => ADEventTrack.Property.remove_ad_click,
|
||||
// SuccessProperty = _ => ADEventTrack.Property.remove_ad_receive
|
||||
// },
|
||||
// [battle_pass] = new EventTrackMapping
|
||||
// {
|
||||
// EventKey = ADEventTrack.Event,
|
||||
// ClickProperty = _ => ADEventTrack.Property.master_pass_click,
|
||||
// SuccessProperty = _ => ADEventTrack.Property.master_pass_receive
|
||||
// },
|
||||
// [buy_one] = new EventTrackMapping
|
||||
// {
|
||||
// EventKey = ADEventTrack.Event,
|
||||
// ClickProperty = _ => ADEventTrack.Property.buy_one_click,
|
||||
// SuccessProperty = _ => ADEventTrack.Property.buy_one_success
|
||||
// },
|
||||
// ["buy_gold"] = new EventTrackMapping
|
||||
// {
|
||||
// EventKey = ADEventTrack.Event,
|
||||
// ClickProperty = suffix => ADEventTrack.Property.gold_click_ + suffix,
|
||||
// SuccessProperty = suffix => ADEventTrack.Property.shop_receive_ + suffix
|
||||
// }
|
||||
// };
|
||||
|
||||
public void Exchange(AdExchangeData _data)
|
||||
{
|
||||
if (Time.time - SaveData.rm_time < 5)
|
||||
{
|
||||
GameHelper.ShowTips("click_too_frequent", true);
|
||||
return;
|
||||
}
|
||||
SaveData.rm_time = Time.time;
|
||||
|
||||
int myAdNum = GetLookRewardADNum();
|
||||
if (myAdNum >= _data.ad_count)
|
||||
{
|
||||
SetLookRewardADNum(myAdNum - _data.ad_count);
|
||||
|
||||
SendEventClickByName(_data.type, "success");
|
||||
|
||||
DOVirtual.DelayedCall(0.1f, () =>
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.apple_pay_success, _data.type);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
GameHelper.ShowTips("no_ad_count", true);
|
||||
}
|
||||
}
|
||||
|
||||
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.GetCommonConf().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 (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.GetCommonConf();
|
||||
private List<Paidgift> packdata = ConfigSystem.GetConfig<Paidgift>();
|
||||
private List<Multigift> threeDayData = ConfigSystem.GetConfig<Multigift>();
|
||||
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 == PurchasingManager.GetPaySku(PayType.three_days_gift))
|
||||
{
|
||||
double move_price = threeDayData[2].Paid_price;
|
||||
needAds = (int)Math.Ceiling(move_price);
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.buy_gold_1))
|
||||
{
|
||||
needAds = (int)Math.Ceiling(getCoinNeedAds(name));
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.buy_gold_2))
|
||||
{
|
||||
needAds = (int)Math.Ceiling(getCoinNeedAds(name));
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.buy_gold_3))
|
||||
{
|
||||
needAds = (int)Math.Ceiling(getCoinNeedAds(name));
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.buy_gold_4))
|
||||
{
|
||||
needAds = (int)Math.Ceiling(getCoinNeedAds(name));
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.buy_gold_5))
|
||||
{
|
||||
needAds = (int)Math.Ceiling(getCoinNeedAds(name));
|
||||
}
|
||||
|
||||
return needAds;
|
||||
|
||||
}
|
||||
private List<Paidcoins> coinList = ConfigSystem.GetConfig<Paidcoins>();
|
||||
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;
|
||||
|
||||
item.SetClick(() =>
|
||||
{
|
||||
item.enabled = false;
|
||||
AdExchangeData adExchangeData = new AdExchangeData()
|
||||
{
|
||||
type = key,
|
||||
ad_count = GetCeilingNeedAds(key)
|
||||
};
|
||||
Exchange(adExchangeData);
|
||||
});
|
||||
}
|
||||
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
|
||||
{
|
||||
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()
|
||||
{
|
||||
return DataMgr.AdWatchCount.Value;
|
||||
}
|
||||
|
||||
public void SetLookRewardADNum(int nums)
|
||||
{
|
||||
DataMgr.AdWatchCount.Value = nums;
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
startAction();
|
||||
updateWatchCD();
|
||||
}
|
||||
|
||||
public void Destroy()
|
||||
{
|
||||
stopAction();
|
||||
removeWatchAd();
|
||||
ActionSetText.Clear();
|
||||
}
|
||||
|
||||
public void SendEventClickByName(string name, string type)
|
||||
{
|
||||
string eventClickName = "";
|
||||
string eventSuccName = "";
|
||||
if (name == PurchasingManager.GetPaySku(PayType.pack_reward))
|
||||
{
|
||||
eventClickName = ADEventTrack.Property.lucky_gift_click;
|
||||
eventSuccName = ADEventTrack.Property.lucky_gift_receive;
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.remove_ad))
|
||||
{
|
||||
eventClickName = ADEventTrack.Property.remove_ad_click;
|
||||
eventSuccName = ADEventTrack.Property.remove_ad_receive;
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.battle_pass))
|
||||
{
|
||||
eventClickName = ADEventTrack.Property.master_pass_click;
|
||||
eventSuccName = ADEventTrack.Property.master_pass_receive;
|
||||
}
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.buy_one))
|
||||
{
|
||||
eventClickName = ADEventTrack.Property.buy_one_click;
|
||||
eventSuccName = ADEventTrack.Property.buy_one_success;
|
||||
}
|
||||
// else if (name == PurchasingManager.GetPaySku(PayType.buy_one_off))
|
||||
// {
|
||||
// eventClickName = ADEventTrack.Property.BuyOneOffClick;
|
||||
// eventSuccName = ADEventTrack.Property.BuyOneOffSuccess;
|
||||
// }
|
||||
else if (name == PurchasingManager.GetPaySku(PayType.three_days_gift))
|
||||
{
|
||||
eventClickName = ADEventTrack.Property.three_days_gift_click;
|
||||
eventSuccName = ADEventTrack.Property.three_days_gift_buy_success;
|
||||
}
|
||||
else if (name.StartsWith("buy_gold"))
|
||||
{
|
||||
int startIndex = "buy_gold".Length;
|
||||
string suffix = name[startIndex..]; // 截取 "gold" 后的所有字符
|
||||
eventClickName = ADEventTrack.Property.gold_click_ + suffix;
|
||||
eventSuccName = ADEventTrack.Property.shop_receive_ + suffix;
|
||||
}
|
||||
|
||||
if (type == "success" && eventSuccName != "")
|
||||
{
|
||||
TrackKit.SendEvent(ADEventTrack.Event, eventSuccName);
|
||||
}
|
||||
else if (type == "click" && eventClickName != "")
|
||||
{
|
||||
TrackKit.SendEvent(ADEventTrack.Event, eventClickName);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public class EventTrackMapping
|
||||
{
|
||||
public string EventKey
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Func<string, string> ClickProperty
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public Func<string, string> SuccessProperty
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
}
|
||||
public class AdExchangeData
|
||||
{
|
||||
[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;
|
||||
|
||||
}
|
||||
@@ -1,401 +0,0 @@
|
||||
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;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class App
|
||||
{
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
using System.Collections.Generic;
|
||||
using SGModule.ApplePay;
|
||||
using SGModule.ConfigLoader;
|
||||
namespace LoveLegend
|
||||
{
|
||||
[ConfigKey("applePay")]
|
||||
public class ApplePay
|
||||
{
|
||||
public int id;
|
||||
public string payKey;
|
||||
public string sku;
|
||||
}
|
||||
[ConfigKey("applePay2")]
|
||||
public class ApplePay2
|
||||
{
|
||||
|
||||
public string name;
|
||||
public string sku;
|
||||
public float price;
|
||||
public string type;
|
||||
}
|
||||
}
|
||||
|
||||
// namespace LoveLegend
|
||||
// {
|
||||
|
||||
// public class ApplePayModel: ConfigModel<ApplePayModel, ApplePay>
|
||||
// {
|
||||
// public ApplePayModel(string key) : base(key)
|
||||
// {
|
||||
// }
|
||||
// }
|
||||
|
||||
// public class ApplePay
|
||||
// {
|
||||
// public int id;
|
||||
// public string payKey;
|
||||
// public string sku;
|
||||
// }
|
||||
|
||||
|
||||
// public class ApplePayModel2: ConfigModel<ApplePayModel2, ProductConfig>
|
||||
// {
|
||||
// public ApplePayModel2(string key) : base(key)
|
||||
// {
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
// }
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6254fab7306ab4f54b9ddc37e9f9c554
|
||||
guid: a1fc4bc6ac4c74207bc26610e90056b4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,30 +1,28 @@
|
||||
using System.Collections;
|
||||
using UnityEngine;
|
||||
using AppsFlyerSDK;
|
||||
using System.Collections.Generic;
|
||||
using FlowerPower;
|
||||
using Unity.Advertisement.IosSupport;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using AppsFlyerSDK;
|
||||
using LoveLegend;
|
||||
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 = null;
|
||||
public bool is_init = false;
|
||||
|
||||
namespace IgnoreOPS {
|
||||
internal class AppsFlyerObjectScript1 : MonoBehaviour, IAppsFlyerConversionData {
|
||||
public string appID;
|
||||
public bool is_init;
|
||||
public Coroutine m_Coroutine;
|
||||
void Start()
|
||||
{
|
||||
|
||||
void Start() {
|
||||
AddListener();
|
||||
|
||||
AppsFlyer.setIsDebug(true);
|
||||
#if UNITY_IOS && !UNITY_EDITOR
|
||||
appID = "6745081004";
|
||||
m_Coroutine = CrazyAsyKit.StartCoroutine(loopWaitInitAf());
|
||||
|
||||
appID = "6749253378";
|
||||
m_Coroutine = CrazyAsyKit.StartCoroutine(loopWaitInitAf());
|
||||
#endif
|
||||
|
||||
|
||||
@@ -32,19 +30,21 @@ namespace IgnoreOPS
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
#endif
|
||||
}
|
||||
private void AddListener()
|
||||
{
|
||||
|
||||
private void AddListener() {
|
||||
NetworkDispatcher.Instance.AddListener(NetworkMsg.NotNetwork, RequestLogin);
|
||||
}
|
||||
|
||||
private void RemoveListener()
|
||||
{
|
||||
private void RemoveListener() {
|
||||
NetworkDispatcher.Instance.RemoveListener(NetworkMsg.NotNetwork, RequestLogin);
|
||||
}
|
||||
void RequestLogin(object obj = null)
|
||||
{
|
||||
if (GameHelper.IsConnect())
|
||||
{
|
||||
|
||||
void OnDestroy() {
|
||||
RemoveListener();
|
||||
}
|
||||
|
||||
void RequestLogin(object obj = null) {
|
||||
if (GameHelper.IsConnect()) {
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Network_reconnection);
|
||||
}
|
||||
|
||||
@@ -53,116 +53,99 @@ namespace IgnoreOPS
|
||||
m_Coroutine = CrazyAsyKit.StartCoroutine(loopWaitInitAf());
|
||||
}
|
||||
|
||||
void OnDestroy() {
|
||||
RemoveListener();
|
||||
}
|
||||
private IEnumerator loopWaitInitAf() {
|
||||
|
||||
public IEnumerator loopWaitInitAf()
|
||||
{
|
||||
// Debug.Log($"barry !GameHelper.IsConnect()==== {!GameHelper.IsConnect()}");
|
||||
|
||||
#if !FlowerPowerRelease
|
||||
GameHelper.ShowTips($"is link network:{GameHelper.IsConnect()}");
|
||||
#endif
|
||||
if (!GameHelper.IsConnect())
|
||||
var isConnect = GameHelper.IsConnect();
|
||||
if (!isConnect)
|
||||
{
|
||||
Action action = () =>
|
||||
float retryTime = 0f;
|
||||
const float maxRetryTime = 3f;
|
||||
|
||||
while (!GameHelper.IsConnect() && retryTime < maxRetryTime)
|
||||
{
|
||||
DOVirtual.DelayedCall(0.5f, ()=>
|
||||
{
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.NotNetwork);
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
});
|
||||
};
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.TipsViewUI_Open,action);
|
||||
yield return null;
|
||||
yield return new WaitForSeconds(0.2f);
|
||||
retryTime += 0.2f;
|
||||
}
|
||||
|
||||
// 再次确认网络状态
|
||||
isConnect = GameHelper.IsConnect();
|
||||
|
||||
Log.Info("AF",$"[AF] loopWaitInitAf------1-- {isConnect}");
|
||||
|
||||
if (!isConnect)
|
||||
{
|
||||
// 超时且仍未连接,触发无网络提示
|
||||
Action action = () => {
|
||||
TimerHelper.mEasy.AddTimer(0.5f, () => {
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.NotNetwork);
|
||||
});
|
||||
};
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.TipsViewUI_Open, action);
|
||||
}
|
||||
}
|
||||
|
||||
Log.Info("AF",$"[AF] loopWaitInitAf------2-- {isConnect}");
|
||||
|
||||
var reqData = new RespLoginFunnelData
|
||||
if (isConnect)
|
||||
{
|
||||
type = "afSend",
|
||||
payload = ""
|
||||
};
|
||||
NetworkKit.PostFunnelLogin(reqData);
|
||||
TrackKit.TrackLoginFunnel(LoginFunnelEventType.AfSend);
|
||||
|
||||
float a = 0;
|
||||
if (ATTrackingStatusBinding.GetAuthorizationTrackingStatus() ==
|
||||
ATTrackingStatusBinding.AuthorizationTrackingStatus.NOT_DETERMINED)
|
||||
{
|
||||
ATTrackingStatusBinding.RequestAuthorizationTracking();
|
||||
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("3e36AQrQTJWsVebUrLpexJ", appID, this);
|
||||
AppsFlyer.startSDK();
|
||||
AppsFlyer.AFLog("8888888888888888888",
|
||||
ATTrackingStatusBinding.GetAuthorizationTrackingStatus().ToString());
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
{
|
||||
public void onConversionDataSuccess(string conversionData) {
|
||||
Log.Info("AF",$"[AF] onConversionDataSuccess-------- {is_init}");
|
||||
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";
|
||||
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);
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
|
||||
TrackKit.TrackLoginFunnel(LoginFunnelEventType.AfRecv, "success");
|
||||
}
|
||||
|
||||
public void onConversionDataFail(string error)
|
||||
{
|
||||
public void onConversionDataFail(string error) {
|
||||
Log.Info("AF",$"[AF] onConversionDataFail-------- {is_init}");
|
||||
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);
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
|
||||
TrackKit.TrackLoginFunnel(LoginFunnelEventType.AfRecv, "fail");
|
||||
}
|
||||
|
||||
public void onAppOpenAttribution(string attributionData)
|
||||
{
|
||||
public void onAppOpenAttribution(string attributionData) {
|
||||
AppsFlyer.AFLog("onAppOpenAttribution", attributionData);
|
||||
Dictionary<string, object> attributionDataDictionary =
|
||||
AppsFlyer.CallbackStringToDictionary(attributionData);
|
||||
}
|
||||
|
||||
public void onAppOpenAttributionFailure(string error)
|
||||
{
|
||||
public void onAppOpenAttributionFailure(string error) {
|
||||
AppsFlyer.AFLog("onAppOpenAttributionFailure", error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5c0b9181be750404f8e1e5d21eb8fa14
|
||||
guid: 8d13b62194dfc4aa881356f7e410b7ec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class AsyncDealData
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
using UnityEngine;
|
||||
using System.Collections;
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class BIManager : MonoBehaviour
|
||||
{
|
||||
private static BIManager _instance;
|
||||
public static BIManager Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_instance == null)
|
||||
{
|
||||
var go = new GameObject("BIManager");
|
||||
DontDestroyOnLoad(go);
|
||||
_instance = go.AddComponent<BIManager>();
|
||||
}
|
||||
|
||||
return _instance;
|
||||
}
|
||||
}
|
||||
// ================= 通用埋点 =================
|
||||
public void TrackEvent(string eventName, Dictionary<string, object> properties = null)
|
||||
{
|
||||
if (properties == null)
|
||||
properties = new Dictionary<string, object>();
|
||||
|
||||
// DataEyeAnalyticsAPI.Track(eventName, properties);
|
||||
// DataEyeAnalyticsAPI.Flush();
|
||||
#if UNITY_IOS&&!UNITY_EDITOR
|
||||
BrigdeIOS.TrackProduct(eventName, JsonConvert.SerializeObject(properties));
|
||||
#endif
|
||||
Debug.Log($"[BI] 事件上报: {eventName}, 属性={JsonConvert.SerializeObject(properties)}");
|
||||
}
|
||||
|
||||
// ================= 预制事件封装 =================
|
||||
|
||||
/// <summary>
|
||||
/// 上报广告事件
|
||||
/// </summary>
|
||||
/// <param name="eventName"></param>
|
||||
/// <param name="adType">Native,RewardedVideo,Banner,Interstitial,Splash</param>
|
||||
/// <param name="placementId">聚合广告位id</param>
|
||||
/// <param name="networkFirmId">广告网络ID</param>
|
||||
public void TrackAdEvent(string eventName, string adType, string placementId = null,
|
||||
string networkFirmId = null, double revenue = 0, string scene = null, string currency = "USD")
|
||||
{
|
||||
var props = new Dictionary<string, object>
|
||||
{
|
||||
{ "ad_type", adType }
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(placementId))
|
||||
props["PlacementId"] = placementId;
|
||||
|
||||
if (!string.IsNullOrEmpty(networkFirmId))
|
||||
props["NetworkFirmId"] = networkFirmId;
|
||||
|
||||
if (revenue > 0)
|
||||
{
|
||||
props["Revenue"] = revenue;
|
||||
props["Ecpm"] = revenue * 1000;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(scene))
|
||||
props["scene"] = scene;
|
||||
|
||||
if (!string.IsNullOrEmpty(currency))
|
||||
props["Currency"] = currency;
|
||||
|
||||
|
||||
TrackEvent(eventName, props);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上报内购事件
|
||||
/// </summary>
|
||||
/// <param name="revenue">收入</param>
|
||||
/// <param name="currency">币种</param>
|
||||
/// <param name="payType">支付方式 0=商店支付,1=三方支付</param>
|
||||
/// <param name="itemId">sku</param>
|
||||
/// <param name="status">order:下单 paid:付费成功 paid_err:扣款失败</param>
|
||||
/// <param name="itemName">商品名称</param>
|
||||
/// <param name="msg">如果遇到异常或相关情况,将err_msg进行上报</param>
|
||||
public void TrackPurchase(double revenue, string currency, string payType, string itemId,
|
||||
string status, string itemName = null, string msg = null)
|
||||
{
|
||||
var props = new Dictionary<string, object>
|
||||
{
|
||||
{ "Revenue", revenue },
|
||||
{ "Currency", currency },
|
||||
{ "type", payType },
|
||||
{ "item_id", itemId },
|
||||
{ "purchase_status", status }
|
||||
};
|
||||
|
||||
if (!string.IsNullOrEmpty(itemName))
|
||||
props["item_name"] = itemName;
|
||||
if (!string.IsNullOrEmpty(msg))
|
||||
props["msg"] = msg;
|
||||
|
||||
TrackEvent(BIEvent.PURCHASE, props);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上报页面浏览
|
||||
/// </summary>
|
||||
public void TrackPageView(string pageName)
|
||||
{
|
||||
var props = new Dictionary<string, object>
|
||||
{
|
||||
{ "page_name", pageName } // 例如 "loading"、"game"
|
||||
};
|
||||
|
||||
TrackEvent(BIEvent.PAGE_VIEW, props);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// AB 分组埋点
|
||||
/// </summary>
|
||||
public void TrackABConfig(int responseTime)
|
||||
{
|
||||
var props = new Dictionary<string, object>
|
||||
{
|
||||
{ "response_time", responseTime }
|
||||
};
|
||||
|
||||
TrackEvent(BIEvent.AB_CONFIG, props);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class BIEvent
|
||||
{
|
||||
// 自动采集(SDK 开启自动采集即可,不需要手动埋点)
|
||||
public const string APP_INSTALL = "app_install";
|
||||
public const string APP_START = "app_start";
|
||||
public const string APP_END = "app_end";
|
||||
public const string APP_VIEW = "app_view";
|
||||
public const string APP_CRASH = "app_crash";
|
||||
|
||||
// 内部预制事件
|
||||
public const string AD_REQUEST = "ad_request"; // 广告请求
|
||||
public const string AD_INVENTORY = "ad_inventory"; // 广告填充的时候
|
||||
public const string AD_IMP = "ad_imp"; // 广告展示
|
||||
public const string AD_CLICK = "ad_click"; // 广告点击
|
||||
|
||||
public const string PURCHASE = "purchase"; // 内购
|
||||
|
||||
// 页面相关
|
||||
public const string PAGE_VIEW = "page_view_customize";
|
||||
|
||||
// 其他业务事件(AB 测试等)
|
||||
public const string AB_CONFIG = "config"; // AB
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8927197c6cb1f412d83d93ded8cf1589
|
||||
guid: ca019e8aa557c43ad990801d4ccc6d0d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public abstract class BaseScene
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public abstract class BaseSystem
|
||||
{
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
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);
|
||||
public static extern void ShezhiACT(bool though);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void copyText(string text);
|
||||
#endif
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SaveVideoWithCustomDate(string videoPath);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void SaveImageWithCustomDate(string imagePath);
|
||||
[DllImport("__Internal")]
|
||||
public static extern void TrackProduct(string eventName, string dictionaryJson);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e0aa81e3804f74072ac4386673f77421
|
||||
guid: 4fc20097e76a7465ab018001e2158c84
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
|
||||
@@ -0,0 +1,328 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using Newtonsoft.Json;
|
||||
using SGModule.Common.Helper;
|
||||
using SGModule.NetKit;
|
||||
using LoveLegend;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
public class ChatSendClass
|
||||
{
|
||||
[JsonProperty("role")] public string role;
|
||||
[JsonProperty("content")] public string content;
|
||||
[JsonProperty("style")] public string style;
|
||||
}
|
||||
public class ChatetClass
|
||||
{
|
||||
[JsonProperty("role")] public string role;
|
||||
[JsonProperty("style")] public string style;
|
||||
}
|
||||
public class ChatHelper : MonoBehaviour
|
||||
{
|
||||
|
||||
public static void SendMessage(int type, string text)
|
||||
{
|
||||
|
||||
ChatSendClass respData = new ChatSendClass
|
||||
{
|
||||
role = ChatType.GetType(type),
|
||||
content = text,
|
||||
style = ChatType.GetStyle(type)
|
||||
};
|
||||
|
||||
NetKit.Instance.Post<object>("chat/sendAiMsg", respData, response =>
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
Debug.Log(JsonConvert.SerializeObject(response.Data));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void GetMessage(int type)
|
||||
{
|
||||
|
||||
ChatetClass respData = new ChatetClass
|
||||
{
|
||||
role = ChatType.GetType(type),
|
||||
style = ChatType.GetStyle(type),
|
||||
};
|
||||
|
||||
NetKit.Instance.Post<object>("chat/initiateAi", respData, response =>
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
Debug.Log(JsonConvert.SerializeObject(response.Data));
|
||||
}
|
||||
});
|
||||
}
|
||||
public static void ResetMessage(int type)
|
||||
{
|
||||
|
||||
var respData = new
|
||||
{
|
||||
role = ChatType.GetType(type),
|
||||
};
|
||||
|
||||
NetKit.Instance.Post<object>("chat/resetAiChat", respData, response =>
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
Debug.Log(JsonConvert.SerializeObject(response.Data));
|
||||
}
|
||||
});
|
||||
}
|
||||
public static void CheckReply()
|
||||
{
|
||||
if (DataMgr.ChatData.Value == null)
|
||||
{
|
||||
DataMgr.ChatData.Value = new List<ChatItem>();
|
||||
}
|
||||
if (pollingCoroutine == null) pollingCoroutine = CrazyAsyKit.StartCoroutine(CheckReplyLoop());
|
||||
// NetKit.Instance.Post<List<ReplyItem>>("chat/checkAiReply", null, response =>
|
||||
// {
|
||||
// if (response.IsSuccess)
|
||||
// {
|
||||
// Debug.Log(response.Data);
|
||||
// Debug.Log(JsonConvert.SerializeObject(response.Data));
|
||||
// Debug.Log(JsonConvert.SerializeObject(response.Data[0]));
|
||||
// Debug.Log(JsonConvert.SerializeObject(response.Data[0].list));
|
||||
// Debug.Log(response.Data[0].list == null);
|
||||
// Debug.Log(response.Data[0].list.Count);
|
||||
// for (int i = 0; i < response.Data.Count; i++)
|
||||
// {
|
||||
// if (response.Data[i].list.Count > 0)
|
||||
// {
|
||||
// for (int j = 0; j < response.Data[i].list.Count; j++)
|
||||
// {
|
||||
// Debug.Log(response.Data[i].list[j].content);
|
||||
// ChatItem item = DataMgr.ChatData.Value.FirstOrDefault(c => c.role == response.Data[i].role);
|
||||
// Debug.Log(JsonConvert.SerializeObject(item));
|
||||
// if (item == null)
|
||||
// {
|
||||
// item = new ChatItem()
|
||||
// {
|
||||
// role = response.Data[i].role,
|
||||
// content_list = new List<ChatText>(),
|
||||
// chat_time = GameHelper.GetNowTime(),
|
||||
// };
|
||||
// DataMgr.ChatData.Value.Add(item);
|
||||
// }
|
||||
// item.content_list.Add(new ChatText()
|
||||
// {
|
||||
// type = 1,
|
||||
// text_content = response.Data[i].list[j].content
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
// Debug.Log(JsonConvert.SerializeObject(DataMgr.ChatData.Value));
|
||||
// DataMgr.ChatData.Save();
|
||||
// }
|
||||
// });
|
||||
|
||||
}
|
||||
// public static List<ChatItem> Chat_Object;
|
||||
|
||||
// public static List<ChatItem> GetChatObject()
|
||||
// {
|
||||
// if (DataMgr.ChatData.Value == null)
|
||||
// {
|
||||
// DataMgr.ChatData.Value = new List<ChatItem>();
|
||||
// }
|
||||
// return DataMgr.ChatData.Value;
|
||||
|
||||
// }
|
||||
private static Coroutine pollingCoroutine;
|
||||
private static IEnumerator CheckReplyLoop()
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
bool shouldStop = true;
|
||||
|
||||
NetKit.Instance.Post<List<ReplyItem>>("chat/checkAiReply", null, response =>
|
||||
{
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
//Debug.Log(response.Data);
|
||||
Debug.Log(JsonConvert.SerializeObject(response.Data));
|
||||
// Debug.Log(JsonConvert.SerializeObject(response.Data[0]));
|
||||
// Debug.Log(JsonConvert.SerializeObject(response.Data[0].list));
|
||||
// Debug.Log(response.Data[0].list == null);
|
||||
// Debug.Log(response.Data[0].list.Count);
|
||||
|
||||
for (int i = 0; i < response.Data.Count; i++)
|
||||
{
|
||||
|
||||
if (response.Data[i].list.Count > 0)
|
||||
{
|
||||
for (int j = 0; j < response.Data[i].list.Count; j++)
|
||||
{
|
||||
string content = response.Data[i].list[j].content;
|
||||
string role = response.Data[i].role;
|
||||
|
||||
ChatItem item = DataMgr.ChatData.Value.FirstOrDefault(c => c.role == role);
|
||||
if (item == null)
|
||||
{
|
||||
item = new ChatItem()
|
||||
{
|
||||
role = role,
|
||||
content_list = new List<ChatText>(),
|
||||
};
|
||||
DataMgr.ChatData.Value.Add(item); // ⚠️ 注意:要在这里添加,否则闭包中可能重复添加
|
||||
}
|
||||
unshow_message[ChatType.GetIndex(role)]++;
|
||||
int delay_time = j * 2; // 每条消息延迟2秒
|
||||
|
||||
DOVirtual.DelayedCall(delay_time, () =>
|
||||
{
|
||||
item.content_list.Add(new ChatText()
|
||||
{
|
||||
type = 1,
|
||||
text_content = content,
|
||||
chat_time = GameHelper.GetNowTime(),
|
||||
});
|
||||
chat_red_list[ChatType.GetIndex(role)] = true;
|
||||
unshow_message[ChatType.GetIndex(role)]--;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.RefreshRedDot);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.LiveChange);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
if (response.Data[i].status == "pending") shouldStop = false;
|
||||
|
||||
}
|
||||
// Debug.Log(JsonConvert.SerializeObject(DataMgr.ChatData.Value));
|
||||
DataMgr.ChatData.Save();
|
||||
}
|
||||
});
|
||||
|
||||
if (UIManager.Instance.IsExistUI(UIConst.ChatUI)) yield return new WaitForSeconds(3f);
|
||||
else yield return new WaitForSeconds(10f);
|
||||
|
||||
// 等待回调完成 + 间隔一秒
|
||||
if (shouldStop)
|
||||
{
|
||||
Debug.Log("检测到 status 为 done,停止轮询");
|
||||
// StopCoroutine("CheckReplyLoop");
|
||||
// pollingCoroutine = null;
|
||||
pollingCoroutine = null;
|
||||
yield break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public static List<int> unshow_message = new List<int> { 0, 0, 0 };
|
||||
public static List<bool> chat_red_list = new List<bool> { false, false, false };
|
||||
public static bool GetChatRed(int index = -1)
|
||||
{
|
||||
if (index >= 0)
|
||||
{
|
||||
return chat_red_list[index];
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < chat_red_list.Count; i++)
|
||||
{
|
||||
if (chat_red_list[i]) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ChatItem
|
||||
{
|
||||
[JsonProperty("role")] public string role;
|
||||
[JsonProperty("content_list")] public List<ChatText> content_list;
|
||||
|
||||
}
|
||||
public class ChatText
|
||||
{
|
||||
[JsonProperty("type")] public int type;
|
||||
[JsonProperty("text_content")] public string text_content;
|
||||
[JsonProperty("chat_time")] public long chat_time;
|
||||
}
|
||||
public class ReplyItem
|
||||
{
|
||||
[JsonProperty("role")] public string role { get; set; }
|
||||
[JsonProperty("list")] public List<ReplyContent> list { get; set; }
|
||||
[JsonProperty("status")] public string status { get; set; }
|
||||
}
|
||||
|
||||
public class ReplyContent
|
||||
{
|
||||
[JsonProperty("type")] public int type { get; set; }
|
||||
[JsonProperty("content")] public string content { get; set; }
|
||||
}
|
||||
|
||||
public static class ChatType
|
||||
{
|
||||
public const string Ainsley = "Ainsley";
|
||||
public const string Lacey = "Lacey";
|
||||
public const string Beatrice = "Beatrice";
|
||||
public const string Taffy = "Taffy";
|
||||
public const string Quinn = "Quinn";
|
||||
|
||||
public static string GetType(int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
return Ainsley;
|
||||
case 1:
|
||||
return Lacey;
|
||||
case 2:
|
||||
return Beatrice;
|
||||
case 3:
|
||||
return Taffy;
|
||||
case 4:
|
||||
return Quinn;
|
||||
}
|
||||
return Ainsley;
|
||||
}
|
||||
public static string GetStyle(int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case 0:
|
||||
return "playful";
|
||||
case 1:
|
||||
return "nurturing";
|
||||
case 2:
|
||||
return "confident";
|
||||
case 3:
|
||||
return "affectionate";
|
||||
case 4:
|
||||
return "reserved";
|
||||
}
|
||||
return "playful";
|
||||
}
|
||||
public static int GetIndex(string type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case Ainsley:
|
||||
return 0;
|
||||
case Lacey:
|
||||
return 1;
|
||||
case Beatrice:
|
||||
return 2;
|
||||
case Taffy:
|
||||
return 3;
|
||||
case Quinn:
|
||||
return 4;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 95a4ab1450a704a8a86208f20b15f859
|
||||
guid: ff3b145e4056947d69838d9c469acb58
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using IgnoreOPS;
|
||||
using Spine.Unity;
|
||||
using LoveLegend;
|
||||
using UnityEngine;
|
||||
using FlowerPower;
|
||||
|
||||
public class CreatAnimalCard : MonoBehaviour
|
||||
{
|
||||
@@ -28,16 +30,13 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
}
|
||||
orthoCamera = GameObject.Find("GameCamera").GetComponent<Camera>();
|
||||
|
||||
float size = 49.9f;
|
||||
float size = (float)Math.Round(28.125f / ((float)Screen.width / Screen.height), 4);
|
||||
string type = SystemInfo.deviceModel.ToLower().Trim();
|
||||
// Debug.Log($"type========={type}=={type.Substring(0, 3)}");
|
||||
if (type.Substring(0, 3) == "iph")
|
||||
// Debug.Log($"type==========={type}");
|
||||
if (type.Substring(0, 3) == "ipa")
|
||||
{//iPad机型
|
||||
size = (float)Math.Round(28.125f / ((float)Screen.width / Screen.height), 4);
|
||||
size = 49.9f;
|
||||
}
|
||||
#if UNITY_EDITOR
|
||||
size = (float)Math.Round(28.125f / ((float)Screen.width / Screen.height), 4);
|
||||
#endif
|
||||
|
||||
orthoCamera.orthographicSize = size;
|
||||
|
||||
@@ -58,31 +57,54 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
{
|
||||
|
||||
//all_card_numbers *= 3;
|
||||
int money_rate = ConfigSystem.GetConfig<CommonModel>().rewardrate;
|
||||
int money_rate = ConfigSystem.GetCommonConf().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;
|
||||
// }
|
||||
|
||||
// ---------- 新增:先从0~15中挑选 card_type_max 个不同的类型 ----------
|
||||
List<int> allTypes = Enumerable.Range(0, 15).ToList(); // [0,1,2,...,15]
|
||||
List<int> chosenTypes = new List<int>();
|
||||
for (int i = 0; i < card_type_max; i++)
|
||||
{
|
||||
int idx = UnityEngine.Random.Range(0, allTypes.Count);
|
||||
chosenTypes.Add(allTypes[idx]);
|
||||
allTypes.RemoveAt(idx); // 确保不重复
|
||||
}
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
// 打印选出来的类型池
|
||||
Debug.Log($"[CreatCardNew] 随机选出的 {card_type_max} 个类型: {string.Join(",", chosenTypes)}");
|
||||
|
||||
for (int i = 0; i < all_card_numbers; i++)
|
||||
{
|
||||
int type = 0;
|
||||
if (GameHelper.IsGiftSwitch() && 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);
|
||||
var randomNum = UnityEngine.Random.Range(0, 100);
|
||||
// Debug.Log($"[creat] money_rate------------ {randomNum}==={money_rate}");
|
||||
if (GameHelper.IsGiftSwitch() && randomNum < money_rate)
|
||||
{
|
||||
type = 15; // 金币
|
||||
}
|
||||
else
|
||||
{
|
||||
// 在挑选好的类型池里再随机
|
||||
type = chosenTypes[UnityEngine.Random.Range(0, chosenTypes.Count)];
|
||||
}
|
||||
|
||||
// if (GameHelper.IsGiftSwitch() && type == 15)
|
||||
// {
|
||||
// type = UnityEngine.Random.Range(0, card_type_max - 1);
|
||||
// }
|
||||
#if UNITY_EDITOR
|
||||
// type = 1;
|
||||
#endif
|
||||
type_list.Add(type);
|
||||
type_list.Add(type);
|
||||
type_list.Add(type);
|
||||
if (!this_timetype_list.Contains(type)) this_timetype_list.Add(type);
|
||||
}
|
||||
SaveData.GetSaveobject().this_time_cardtype = this_timetype_list.Count;
|
||||
SaveData.GetSaveObject().this_time_cardtype = this_timetype_list.Count;
|
||||
|
||||
for (int i = 0; i < card_layer; i++)
|
||||
{
|
||||
@@ -188,8 +210,7 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
}
|
||||
private GameObject Popup;
|
||||
|
||||
private GameObject Normal;
|
||||
#if UNITY_EDITOR || UNITY_IOS
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
@@ -199,16 +220,13 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
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);
|
||||
// Debug.Log("Hit " + hit.collider.gameObject.name);
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.card_click, hit.collider.gameObject.name);
|
||||
// 在此处添加点击物体后的逻辑
|
||||
@@ -219,54 +237,33 @@ public class CreatAnimalCard : MonoBehaviour
|
||||
}
|
||||
}
|
||||
}
|
||||
#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) =>
|
||||
if (disappear01 == null) disappear01 = Resources.Load<GameObject>("card/bg_img/fx_disaappear_1");
|
||||
if (disappear02 == null) disappear02 = Resources.Load<GameObject>("card/bg_img/fx_disaappear_2");
|
||||
if (type == 1)
|
||||
{
|
||||
Destroy(temp.gameObject);
|
||||
};
|
||||
}
|
||||
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, "disappear02", true);
|
||||
temp.AnimationState.Complete += (trackEntry) =>
|
||||
{
|
||||
Destroy(temp.gameObject);
|
||||
};
|
||||
}
|
||||
// temp.GetComponent<SpriteRenderer>().sprite = img_list[card_item_list[i][j].card_type];
|
||||
|
||||
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)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 461f4ab1eea545959e3ea8ea1a1b841b
|
||||
timeCreated: 1750658885
|
||||
@@ -0,0 +1,28 @@
|
||||
using SGModule.Common.Helper;
|
||||
using SGModule.NetKit;
|
||||
|
||||
namespace LoveLegend {
|
||||
public class CloudDataSaver {
|
||||
public static void UpdateData(string json, long version, bool onQuit) {
|
||||
Log.Info("CloudDataSaver", $"最新数据版本: {version}, onQuit: {onQuit} ,数据: {json}");
|
||||
if (json == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 应用直接退出或者退到后台, 直接保存数据到服务器, 不启用协程发送
|
||||
if (onQuit) {
|
||||
NetApi.UploadPlayerDataUpdate(version, json);
|
||||
return;
|
||||
}
|
||||
|
||||
NetApi.UploadPlayerDataUpdate(version, json, result => {
|
||||
if (result) {
|
||||
Log.Info("CloudDataSaver", $"最新数据版本: {version} ,更新成功");
|
||||
}
|
||||
else {
|
||||
Log.Warning("CloudDataSaver", $"最新数据版本: {version} ,更新失败");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e430f51fc26d4125843615d8de9e7f6c
|
||||
timeCreated: 1750659159
|
||||
@@ -0,0 +1,69 @@
|
||||
public static class DataKeys
|
||||
{
|
||||
public const string UserID = "UserID";
|
||||
public const string FirstLogin = "FirstLogin";
|
||||
public const string coin = "coin";
|
||||
public const string ticket = "ticket";
|
||||
public const string maxCoin = "maxCoin";
|
||||
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 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 adChFlyShowTime = "adChFlyShowTime";
|
||||
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 AdWatchCount = "AdWatchCount"; // 看广告次数
|
||||
public const string AvailableDiceRolls = "AvailableDiceRolls"; // 可摇骰子次数
|
||||
public const string propBackNum = "propBackNum"; // 返回道具数量
|
||||
public const string propRefreshNum = "propRefreshNum"; // 刷新道具数量
|
||||
public const string propRemoveNum = "propRemoveNum"; // 移除道具数量
|
||||
public const string resurrectionState = "resurrectionState"; //复活状态:4种,数字3为可以用广告和金币复活,2为只能用广告,1为只能用金币。0为不能复活
|
||||
public const string gameExperience = "gameExperience";
|
||||
public const string getFirstReaward = "getFirstReaward"; // 是否已领取新手奖励
|
||||
public const string noviceGuide = "noviceGuide"; // 是否新手引导
|
||||
public const string gameTime = "gameTime"; // 游戏时长
|
||||
public const string gameDay = "gameDay";
|
||||
public const string SecretUnlockList = "SecretUnlockList"; // 秘密相册解锁列表
|
||||
public const string SecretUnlockCd = "SecretUnlockCd"; // 秘密相册看广告的剩余时间
|
||||
public const string SecretUnlockADs = "SecretUnlockADs"; // 秘密相册看广告数(每一个图集的广告数不通用)
|
||||
public const string IsUnlockSecret = "IsUnlockSecret"; // 秘密相册是否解锁(-1:未解锁 0:刚解锁 1:已打开秘密相册)
|
||||
public const string VipLevel = "VipLevel"; // vip等级(1:7天 2:30天 3:365天)
|
||||
public const string VipExpirationTime = "VipExpirationTime"; // vip失效时间(默认为0)
|
||||
public const string LiveDataList = "LiveDataList";
|
||||
|
||||
public const string IsUnlockLive = "IsUnlockLive"; // live是否解锁(-1:未解锁 0:刚解锁 1:已打开live)
|
||||
public const string ApplePayTransactionID = "ApplePayTransactionID"; //ios购买后的非消耗性订单id
|
||||
public const string LiveDataDic = "LiveDataDic";
|
||||
public const string LevelUnlockList = "LevelUnlockList"; // 图鉴已解锁的index列表
|
||||
public const string IsUnlockChat = "IsUnlockChat";
|
||||
public const string ChatData = "ChatData";
|
||||
public const string ChatNumber = "ChatNumber";
|
||||
public const string ChatRecoverDays = "ChatRecoverDays";
|
||||
public const string ChatFreeNumber = "ChatFreeNumber";
|
||||
public const string curResVersion = "curResVersion";
|
||||
public const string LevelUnlockListFree = "LevelUnlockListFree";
|
||||
public const string LevelUnlockListAD = "LevelUnlockListAD";
|
||||
public const string LevelUnlockListSpecial = "LevelUnlockListSpecial";
|
||||
public const string LevelUnlockListVIP = "LevelUnlockListVIP";
|
||||
public const string LevelUnlockListNew = "LevelUnlockListNew";
|
||||
public const string clearAllOrder = "clearAllOrder";
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using System.Collections.Generic;
|
||||
using SGModule.DataStorage;
|
||||
using LoveLegend;
|
||||
|
||||
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 对象
|
||||
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.coin, DataMsg.currency101);
|
||||
public static DataStorage<decimal> Ticket = BindDataStorage<decimal>(DataKeys.ticket, DataMsg.currency102);
|
||||
public static DataStorage<int> MaxCurrency101 = BindDataStorage<int>(DataKeys.maxCoin);
|
||||
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<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> AdChFlyShowTime = BindDataStorage<long>(DataKeys.adChFlyShowTime);
|
||||
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> AdWatchCount = BindDataStorage<int>(DataKeys.AdWatchCount);
|
||||
public static DataStorage<int> AvailableDiceRolls = BindDataStorage<int>(DataKeys.AvailableDiceRolls);
|
||||
public static DataStorage<int> PropBackNum = BindDataStorage<int>(DataKeys.propBackNum);
|
||||
public static DataStorage<int> PropRefreshNum = BindDataStorage<int>(DataKeys.propRefreshNum);
|
||||
public static DataStorage<int> PropRemoveNum = BindDataStorage<int>(DataKeys.propRemoveNum);
|
||||
public static DataStorage<int> ResurrectionState = BindDataStorage<int>(DataKeys.resurrectionState, null, 3);
|
||||
public static DataStorage<int> GameExperience = BindDataStorage<int>(DataKeys.gameExperience);
|
||||
public static DataStorage<bool> GetFirstReaward = BindDataStorage<bool>(DataKeys.getFirstReaward);
|
||||
public static DataStorage<bool> NoviceGuide = BindDataStorage<bool>(DataKeys.noviceGuide);
|
||||
public static DataStorage<int> GameTime = BindDataStorage<int>(DataKeys.gameTime);
|
||||
public static DataStorage<int> GameDay = BindDataStorage<int>(DataKeys.gameDay);
|
||||
public static DataStorage<int> IsUnlockSecret = BindDataStorage<int>(DataKeys.IsUnlockSecret, null, -1);
|
||||
public static DataStorage<int> VipLevel = BindDataStorage<int>(DataKeys.VipLevel, null, -1);
|
||||
public static DataStorage<long> VipExpirationTime = BindDataStorage<long>(DataKeys.VipExpirationTime);
|
||||
|
||||
public static DataStorage<int> IsUnlockLive = BindDataStorage<int>(DataKeys.IsUnlockLive, null, -1);
|
||||
public static DataStorage<string> curResVersion = new(DataKeys.curResVersion, cloudSave: false);
|
||||
|
||||
public static DataStorage<bool> clearAllOrder = BindDataStorage<bool>(DataKeys.clearAllOrder);
|
||||
|
||||
#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<int>> SecretUnlockList = BindDataStorage(DataKeys.SecretUnlockList, @default: new List<int>());
|
||||
public static DataStorage<Dictionary<int, int>> SecretUnlockCd = new(DataKeys.SecretUnlockCd, defaultValue: new Dictionary<int, int>(), cloudSave: false);
|
||||
public static DataStorage<Dictionary<int, int>> SecretUnlockADs = new(DataKeys.SecretUnlockADs, defaultValue: new Dictionary<int, int>());
|
||||
public static DataStorage<List<LiveData>> LiveDataList = new(DataKeys.LiveDataList, defaultValue: new List<LiveData>());
|
||||
public static DataStorage<List<string>> ApplePayTransactionID = BindDataStorage(DataKeys.ApplePayTransactionID, @default: new List<string>());
|
||||
public static DataStorage<Dictionary<int, LiveData>> LiveDataDic = new(DataKeys.LiveDataDic, defaultValue: new Dictionary<int, LiveData>());
|
||||
public static DataStorage<List<int>> LevelUnlockList = new(DataKeys.LevelUnlockList, defaultValue: new List<int>());
|
||||
public static DataStorage<int> IsUnlockChat = BindDataStorage<int>(DataKeys.IsUnlockChat, null, -1);
|
||||
public static DataStorage<List<ChatItem>> ChatData = new(DataKeys.ChatData, cloudSave: false);
|
||||
public static DataStorage<int> ChatNumber = BindDataStorage<int>(DataKeys.ChatNumber, null, 0);
|
||||
public static DataStorage<int> ChatFreeNumber = BindDataStorage<int>(DataKeys.ChatFreeNumber, null, 0);
|
||||
public static DataStorage<int> ChatRecoverDays = BindDataStorage<int>(DataKeys.ChatRecoverDays, null, -1);
|
||||
|
||||
public static DataStorage<int> LevelUnlockFree = new(DataKeys.LevelUnlockListFree, defaultValue: -1);
|
||||
public static DataStorage<int> LevelUnlockAD = new(DataKeys.LevelUnlockListAD, defaultValue: -1);
|
||||
public static DataStorage<int> LevelUnlockSpecial = new(DataKeys.LevelUnlockListSpecial, defaultValue: -1);
|
||||
public static DataStorage<int> LevelUnlockVIP = new(DataKeys.LevelUnlockListVIP, defaultValue: -1);
|
||||
public static DataStorage<List<Levelunlock>> LevelUnlockListNew = new(DataKeys.LevelUnlockListNew, defaultValue: new List<Levelunlock>());
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -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,64 @@
|
||||
using System.Collections.Generic;
|
||||
using SGModule.NetKit;
|
||||
|
||||
namespace LoveLegend {
|
||||
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,31 @@
|
||||
namespace LoveLegend
|
||||
{
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class Throttle
|
||||
{
|
||||
private float _lastTime;
|
||||
private readonly float _interval;
|
||||
|
||||
public Throttle(float intervalSeconds)
|
||||
{
|
||||
_interval = intervalSeconds;
|
||||
_lastTime = -intervalSeconds; // 确保一开始就能执行
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 节流调用:在时间窗口内只执行一次
|
||||
/// </summary>
|
||||
public void Execute(Action action)
|
||||
{
|
||||
if (Time.time - _lastTime >= _interval)
|
||||
{
|
||||
_lastTime = Time.time;
|
||||
action?.Invoke();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0482db053a1ce45d989a2e4a715dff81
|
||||
guid: a38aa4bb7436148318f6c3577b8758f5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class AnimConst
|
||||
{
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using SGModule.Common;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class AppConst
|
||||
{
|
||||
#region Field
|
||||
|
||||
#if FlowerPowerRelease
|
||||
public static bool IsEnabledEngineLog = false;
|
||||
#else
|
||||
public static bool IsEnabledEngineLog = true;
|
||||
#endif
|
||||
public static bool IsEnabledEngineLog = ConfigManager.GameConfig.enabledLog;
|
||||
|
||||
public const LogType EnabledFilterLogType =
|
||||
LogType.Log | LogType.Warning | LogType.Error | LogType.Assert |
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class AppObjConst
|
||||
{
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class AudioConst
|
||||
{
|
||||
public const string click = "click";
|
||||
public const string UIButtonDefault = "ui_ButtonDefault";
|
||||
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 CoinFly = "coinfly";
|
||||
public const string MainBg = "hall_bgm";
|
||||
public const string GameBg = "game_bgm";
|
||||
public const string dissolve = "dissolve";
|
||||
public const string fail = "fail";
|
||||
public const string Victoriously = "Victoriously";
|
||||
public const string MakeupDone = "makupdone";
|
||||
public const string wheel_spin = "wheel_spin";
|
||||
|
||||
public const string BroadTips = "BroadTips";
|
||||
public const string gamestart = "gamestart";
|
||||
public const string game_open = "game_open";
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class CameraConst
|
||||
{
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class FolderNames
|
||||
{
|
||||
public const string SecretName = "SecretAlbums";
|
||||
public const string AlbumName = "LevelAlbums";
|
||||
public const string BackgroundName = "Background";
|
||||
public const string VideoName = "LiveVideos";
|
||||
public const string VideoCoversName = "LiveVideoCovers";
|
||||
public const string GameCache = "GameCache";
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e4da890320dd03c4f837d9dc3c8c31c9
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class LayerMaskConst
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class PrefsConst
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class PrefsKeyConst
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class ScreenConst
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class UILayerConst
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class VectorConst
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class YieldConst
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static partial class CtrlMsg
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static partial class GameMsg
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static partial class UICtrlMsg
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class ChangeValue<T>
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public abstract class BaseDispatcher<T, Msg, Param> : IDisposable where T : class, new() where Param : class
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class BaseMainThreadDispatcher<T, Msg, Param> : SingletonUnity<T>
|
||||
where T : SingletonUnity<T>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class AppDispatcher : BaseDispatcher<AppDispatcher, uint, object> { }
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class CtrlDispatcher : BaseDispatcher<CtrlDispatcher, uint, object>
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class DataDispatcher : BaseDispatcher<DataDispatcher, string, object>
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class GameDispatcher : BaseDispatcher<GameDispatcher, uint, object>
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class MainThreadDispatcher : BaseMainThreadDispatcher<MainThreadDispatcher, uint, object>
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class ModelDispatcher : BaseDispatcher<ModelDispatcher, uint, object>
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class NetworkDispatcher : BaseDispatcher<NetworkDispatcher, uint, object>
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class PreferencesDispatcher<T> : BaseDispatcher<PreferencesDispatcher<T>, string, ChangeValue<T>>
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class UICtrlDispatcher : BaseDispatcher<UICtrlDispatcher, uint, object>
|
||||
{
|
||||
|
||||
@@ -1,28 +1,27 @@
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using FlowerPower;
|
||||
|
||||
|
||||
using SGModule.NetKit;
|
||||
using LoveLegend;
|
||||
using UnityEngine;
|
||||
|
||||
public class ErrorLogger : MonoBehaviour
|
||||
{
|
||||
// 用于存储报错信息的列表
|
||||
private List<string> errorLogs = new List<string>();
|
||||
private readonly List<string> errorLogs = new();
|
||||
|
||||
void OnEnable()
|
||||
private void OnEnable()
|
||||
{
|
||||
// 注册事件处理函数
|
||||
Application.logMessageReceived += HandleLog;
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
private void OnDisable()
|
||||
{
|
||||
// 注销事件处理函数
|
||||
Application.logMessageReceived -= HandleLog;
|
||||
}
|
||||
|
||||
// 事件处理函数
|
||||
void HandleLog(string logString, string stackTrace, LogType type)
|
||||
private void HandleLog(string logString, string stackTrace, LogType type)
|
||||
{
|
||||
// 只处理错误和异常类型的日志
|
||||
if (type == LogType.Error || type == LogType.Exception)
|
||||
@@ -37,17 +36,11 @@ public class ErrorLogger : MonoBehaviour
|
||||
}
|
||||
|
||||
// 如何将报错信息发送给服务器
|
||||
void SendErrorToServer(string error, string stackTrace)
|
||||
private 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);
|
||||
ErrorLogKit.Send("error", error, stackTrace, SuperApplication.Instance.attribution);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class StringExtend
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class GameObjectExtend
|
||||
{
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace FlowerPower
|
||||
{
|
||||
public class GemCrushCore : SingletonUnity<GemCrushCore>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
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,7 @@
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class LoveLegendCore : SingletonUnity<LoveLegendCore>
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using SGModule.MarkdownKit;
|
||||
using SGModule.NetKit;
|
||||
using LoveLegend;
|
||||
using SGModule.Common.Helper;
|
||||
using UnityEngine;
|
||||
|
||||
public class LoveLegendRoot : MonoBehaviour
|
||||
{
|
||||
public void Awake()
|
||||
{
|
||||
#if UNITY_EDITOR || GAME_RELEASE
|
||||
GameObject.Find("IngameDebugConsole").SetActive(false);
|
||||
#endif
|
||||
MaxADKit.Init();
|
||||
// SGModule.Net.NetworkKit.Instance.InitData(NetworkManager.identifier,true);
|
||||
OnLauncher();
|
||||
TrackKit.TrackLoginFunnel(LoginFunnelEventType.Bootstrap);
|
||||
|
||||
BuildGMTool();
|
||||
NetGmTool.Instance.Init();
|
||||
}
|
||||
|
||||
public static void OnLauncher()
|
||||
{
|
||||
Language.LoadLocalizedText();
|
||||
Language.Initialize();
|
||||
AppObjConst.FrameGo = new GameObject($"{AppObjConst.FrameGoName}");
|
||||
AppObjConst.FrameGo.AddComponent<LoveLegendCore>();
|
||||
DontDestroyOnLoad(AppObjConst.FrameGo);
|
||||
App.InitApplication(SuperApplication.Instance);
|
||||
|
||||
|
||||
|
||||
MarkdownKit.Instance.LoadText("privacy", "https://www.dreamlovelegend.com/privacy.md");
|
||||
MarkdownKit.Instance.LoadText("user", "https://www.dreamlovelegend.com/user.md");
|
||||
}
|
||||
|
||||
private static string adInfoLabel = "";
|
||||
private static void BuildGMTool()
|
||||
{
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Separator, () => "测试工具"));
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Separator, () => "测试工具"));
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Button,
|
||||
() => "清空签到记录",
|
||||
s =>
|
||||
{
|
||||
DataMgr.SignState.Value = new List<long>();
|
||||
}));
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Button,
|
||||
() => "测试签到",
|
||||
s =>
|
||||
{
|
||||
DataMgr.SignState.Value.Add(GameHelper.GetNowTime() + (long)TimeSpan.FromDays(DataMgr.SignState.Value.Count).TotalSeconds);
|
||||
DataMgr.SignState.Save();
|
||||
}));
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Button,
|
||||
() => "打开礼包界面",
|
||||
s =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PackrewardUI_Open, true);
|
||||
}));
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Button,
|
||||
() => "加广告次数+1",
|
||||
s =>
|
||||
{
|
||||
var adNums = AdExchangeManager.Instance.GetLookRewardADNum();
|
||||
adNums += 1;
|
||||
AdExchangeManager.Instance.SetLookRewardADNum(adNums);
|
||||
}));
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Button,
|
||||
() => "加广告次数+10",
|
||||
s =>
|
||||
{
|
||||
var adNums = AdExchangeManager.Instance.GetLookRewardADNum();
|
||||
adNums += 10;
|
||||
AdExchangeManager.Instance.SetLookRewardADNum(adNums);
|
||||
}));
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Button,
|
||||
() => "类型测试+10",
|
||||
s =>
|
||||
{
|
||||
DataMgr.Ticket.Value += 10;
|
||||
}));
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Button,
|
||||
() => "客户端日志上传",
|
||||
s =>
|
||||
{
|
||||
// ErrorLogKit.Send("error", "客户端日志上传", "GM工具点击测试",SuperApplication.Instance.attribution);
|
||||
|
||||
}));
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Button,
|
||||
() => "广告ID信息打印",
|
||||
s =>
|
||||
{
|
||||
adInfoLabel += $"Max token: {MaxADKit.SDKKey} \n 激励广告Id: {MaxADKit.rewardedADUnitID} \n 插屏广告Id: {MaxADKit.interstitialADUnitID} \n";
|
||||
|
||||
}));
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Button, () => "关卡+1",
|
||||
s =>
|
||||
{
|
||||
DataMgr.GameLevel.Value = DataMgr.GameLevel.Value + 1;
|
||||
}));
|
||||
// 输入设置等级
|
||||
GMTool.Instance.AddItem(new GMToolItem(
|
||||
GUIType.InputField,
|
||||
() => "设置等级",
|
||||
s =>
|
||||
{
|
||||
if (int.TryParse(s, out int level))
|
||||
{
|
||||
DataMgr.GameLevel.Value = level;
|
||||
adInfoLabel += $"手动设置等级 = {level}\n";
|
||||
|
||||
// 如果需要额外刷新,例如保存一下等级(可选)
|
||||
DataMgr.GameLevel.Save();
|
||||
}
|
||||
else
|
||||
{
|
||||
adInfoLabel += $"等级输入错误:{s}\n";
|
||||
}
|
||||
}
|
||||
));
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Label, () => $"{DataMgr.Ticket} 类型测试"));
|
||||
// 来显示 adInfoLabel 的内容
|
||||
GMTool.Instance.AddItem(new GMToolItem(GUIType.Label, () => adInfoLabel));
|
||||
GMTool.Instance.AddItem(new GMToolItem(
|
||||
GUIType.InputField,
|
||||
() => "设置等级",
|
||||
s =>
|
||||
{
|
||||
if (int.TryParse(s, out int level))
|
||||
{
|
||||
DataMgr.GameLevel.Value = level;
|
||||
adInfoLabel += $"手动设置等级 = {level}\n";
|
||||
|
||||
// 如果需要额外刷新,例如保存一下等级(可选)
|
||||
DataMgr.GameLevel.Save();
|
||||
}
|
||||
else
|
||||
{
|
||||
adInfoLabel += $"等级输入错误:{s}\n";
|
||||
}
|
||||
}
|
||||
));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public abstract class BaseCtrl
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public abstract class BaseUICtrl : BaseCtrl
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public abstract class BaseModel
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using FairyGUI;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public abstract class BaseUI
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using FairyGUI;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class SubUI
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class UIInfoConst
|
||||
{
|
||||
|
||||
@@ -0,0 +1,406 @@
|
||||
#if UNITY_EDITOR
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace FutureEditor
|
||||
{
|
||||
public class MVCBuildWindow : EditorWindow
|
||||
{
|
||||
private static string mvcClassName; //mvc 模块名
|
||||
private static string fguiPackageName; //FGUI 包名
|
||||
private static string fguiCompName; //FGUI 组建名
|
||||
private static string foldePath;
|
||||
static string mvcRootPath = "/Scripts/ModuleUI/"; //创建MVC模块的目录
|
||||
|
||||
[MenuItem("Jarvis/MVC/创建MVC代码模板", false, 0)]
|
||||
private static void ShowWindow()
|
||||
{
|
||||
MVCBuildWindow window = GetWindow<MVCBuildWindow>(true, "创建MVC代码模板窗口");
|
||||
window.minSize = new Vector2(280f, 170f);
|
||||
window.maxSize = window.minSize;
|
||||
window.Show();
|
||||
}
|
||||
|
||||
private void OnGUI()
|
||||
{
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.BeginVertical();
|
||||
|
||||
GUILayout.Space(5);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("MVC模块名:");
|
||||
mvcClassName = EditorGUILayout.TextField(mvcClassName, GUILayout.Height(20));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(10);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("FGUI包名:");
|
||||
fguiPackageName = EditorGUILayout.TextField(fguiPackageName, GUILayout.Height(20));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(10);
|
||||
GUILayout.BeginHorizontal();
|
||||
GUILayout.Label("FGUI组件名:");
|
||||
fguiCompName = EditorGUILayout.TextField(fguiCompName, GUILayout.Height(20));
|
||||
GUILayout.EndHorizontal();
|
||||
GUILayout.Space(10);
|
||||
if (GUILayout.Button("创建", GUILayout.Height(25)))
|
||||
{
|
||||
CreateMVC(mvcClassName);
|
||||
}
|
||||
EditorGUILayout.EndVertical();
|
||||
}
|
||||
|
||||
private static void CreateMVC(string mvcName)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(mvcName))
|
||||
{
|
||||
string mvcPath = mvcRootPath + mvcName;
|
||||
foldePath = Application.dataPath + mvcPath;
|
||||
if (Directory.Exists(foldePath))
|
||||
{
|
||||
Debug.LogError("[MVCBuildWindow]Folde is exist!!!: " + foldePath);
|
||||
Debug.LogError("[MVCBuildWindow]Create MVC Fail:" + mvcName);
|
||||
return;
|
||||
}
|
||||
Directory.CreateDirectory(foldePath);
|
||||
|
||||
CreateModel(mvcName);
|
||||
CreateUI(mvcName);
|
||||
CreateCtrl(mvcName);
|
||||
CreateUICtrl(mvcName);
|
||||
RegisterModule(mvcName);
|
||||
|
||||
AssetDatabase.SaveAssets();
|
||||
AssetDatabase.Refresh();
|
||||
|
||||
SelectObject("Assets/" + mvcPath);
|
||||
Debug.Log("[MVCBuildWindow]创建MVC代码模板完成");
|
||||
}
|
||||
}
|
||||
|
||||
private static void SelectObject(string path)
|
||||
{
|
||||
Object obj = AssetDatabase.LoadMainAssetAtPath(path);
|
||||
if (obj == null) return;
|
||||
|
||||
EditorGUIUtility.PingObject(obj);
|
||||
Selection.activeObject = obj;
|
||||
}
|
||||
|
||||
private static void CreateModel(string className)
|
||||
{
|
||||
string modelClassStr =
|
||||
@"
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class #ClassName#Model : BaseModel
|
||||
{
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
}
|
||||
}";
|
||||
|
||||
string replaceClassName = "#ClassName#";
|
||||
modelClassStr = modelClassStr.Replace(replaceClassName, className);
|
||||
string targetPath = foldePath + "/" + className + "Model.cs";
|
||||
File.WriteAllText(targetPath, modelClassStr, new UTF8Encoding(false));
|
||||
}
|
||||
|
||||
private static void CreateUI(string className)
|
||||
{
|
||||
string uiClassStr =
|
||||
@"
|
||||
using FGUI.ZM_Common_01;
|
||||
using UnityEngine;
|
||||
using FairyGUI;
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class #ClassName#UI : BaseUI
|
||||
{
|
||||
private #ClassName#UICtrl ctrl;
|
||||
private #ClassName#Model model;
|
||||
private FGUI.#PackageName#.#CompName# ui;
|
||||
|
||||
public #ClassName#UI(#ClassName#UICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.#ClassName#UI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = ""#PackageName#"";
|
||||
uiInfo.assetName = ""#CompName#"";
|
||||
uiInfo.layerType = UILayerType.Normal;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.#ClassName#Model) as #ClassName#Model;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.#PackageName#.#CompName#;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
//初始化页面逻辑
|
||||
private void InitView()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}";
|
||||
string replacePackageName = "#PackageName#";
|
||||
uiClassStr = uiClassStr.Replace(replacePackageName, fguiPackageName);
|
||||
string replaceCompName = "#CompName#";
|
||||
uiClassStr = uiClassStr.Replace(replaceCompName, fguiCompName);
|
||||
string replaceClassName = "#ClassName#";
|
||||
uiClassStr = uiClassStr.Replace(replaceClassName, className);
|
||||
string targetPath = foldePath + "/" + className + "UI.cs";
|
||||
File.WriteAllText(targetPath, uiClassStr, new UTF8Encoding(false));
|
||||
}
|
||||
|
||||
private static void CreateCtrl(string className)
|
||||
{
|
||||
string ctrlClassStr =
|
||||
@"
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class #ClassName#Ctrl : BaseCtrl
|
||||
{
|
||||
public static #ClassName#Ctrl Instance { get; private set; }
|
||||
|
||||
private #ClassName#Model model;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
//model = ModuleManager.Instance..GetModel(ModelConst.#ClassName#Model) as #ClassName#Model;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}";
|
||||
|
||||
string replaceClassName = "#ClassName#";
|
||||
ctrlClassStr = ctrlClassStr.Replace(replaceClassName, className);
|
||||
string targetPath = foldePath + "/" + className + "Ctrl.cs";
|
||||
File.WriteAllText(targetPath, ctrlClassStr, new UTF8Encoding(false));
|
||||
}
|
||||
|
||||
private static void CreateUICtrl(string className)
|
||||
{
|
||||
string uiCtrlClassStr =
|
||||
@"
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class #ClassName#UICtrl : BaseUICtrl
|
||||
{
|
||||
private #ClassName#UI ui;
|
||||
private #ClassName#Model model;
|
||||
|
||||
private uint openUIMsg = UICtrlMsg.#ClassName#UI_Open;
|
||||
private uint closeUIMsg = UICtrlMsg.#ClassName#UI_Close;
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
//model = ModuleManager.Instance.GetModel(ModelConst.#ClassName#Model) as #ClassName#Model;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new #ClassName#UI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
ui = null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
public override uint GetOpenUIMsg(string uiName)
|
||||
{
|
||||
return openUIMsg;
|
||||
}
|
||||
public override uint GetCloseUIMsg(string uiName)
|
||||
{
|
||||
return closeUIMsg;
|
||||
}
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
uiCtrlDispatcher.AddListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.AddListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
}
|
||||
|
||||
protected override void AddServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
protected override void RemoveServerListener()
|
||||
{
|
||||
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}";
|
||||
|
||||
string replaceClassName = "#ClassName#";
|
||||
uiCtrlClassStr = uiCtrlClassStr.Replace(replaceClassName, className);
|
||||
string targetPath = foldePath + "/" + className + "UICtrl.cs";
|
||||
File.WriteAllText(targetPath, uiCtrlClassStr, new UTF8Encoding(false));
|
||||
}
|
||||
|
||||
//测试
|
||||
// [MenuItem("Jarvis/MVC/RegisterModuleXXX", false, 0)]
|
||||
// static void RegisterModuleXXX(){
|
||||
// RegisterModule("mmm");
|
||||
// AssetDatabase.SaveAssets();
|
||||
// AssetDatabase.Refresh();
|
||||
// }
|
||||
|
||||
//注册模块
|
||||
static void RegisterModule(string name)
|
||||
{
|
||||
//模块管理路径以及相关文件路径
|
||||
string moduleMngRootPath = Application.dataPath + "/Scripts/ModuleManager/";
|
||||
string ctrlPath = moduleMngRootPath + "CtrlConst.cs";
|
||||
string modelPath = moduleMngRootPath + "ModelConst.cs";
|
||||
string uiConstPath = moduleMngRootPath + "UIConst.cs";
|
||||
string uiCtrlPath = moduleMngRootPath + "UICtrlConst.cs";
|
||||
string moduleMngPath = moduleMngRootPath + "ModuleManagerRegister.cs";
|
||||
string UICtrlMsgPath = Application.dataPath + "/Legend/Define/Message/UICtrlMsg_OpenClose.cs";
|
||||
|
||||
//注册模块的常量
|
||||
InsertString(ctrlPath, $"\tpublic const string {name}Ctrl = \"{name}Ctrl\";\n\t");
|
||||
InsertString(modelPath, $"\tpublic const string {name}Model = \"{name}Model\";\n\t");
|
||||
InsertString(uiConstPath, $"\tpublic const string {name}UI = \"{name}UI\";\n\t");
|
||||
InsertString(uiCtrlPath, $"\tpublic const string {name}UICtrl = \"{name}UICtrl\";\n\t");
|
||||
|
||||
//在模块类注册新模块
|
||||
InsertStringBeforeCharIndex(moduleMngPath, 0, $"\tmoduleManager.AddModel(ModelConst.{name}Model, new {name}Model());\n\t\t");
|
||||
InsertStringBeforeCharIndex(moduleMngPath, 1, $"\tmoduleManager.AddUICtrl(UICtrlConst.{name}UICtrl, new {name}UICtrl());\n\t\t");
|
||||
InsertStringBeforeCharIndex(moduleMngPath, 2, $"\tmoduleManager.AddCtrl(CtrlConst.{name}Ctrl, new {name}Ctrl());\n\t\t");
|
||||
InsertStringBeforeCharIndex(moduleMngPath, 3, $"\tmoduleManager.AddUIType(UIConst.{name}UI, typeof({name}UI));\n\t\t");
|
||||
|
||||
|
||||
|
||||
InsertString(UICtrlMsgPath, $"\tpublic static uint {name}UI_Open = ++cursor_OpenClose;\n\t\tpublic static uint {name}UI_Close = ++cursor_OpenClose;\n\t");
|
||||
}
|
||||
|
||||
static void InsertString(string path, string str)
|
||||
{
|
||||
string f = File.ReadAllText(path);
|
||||
int index = f.IndexOf('}');
|
||||
f = f.Insert(index, str);
|
||||
File.WriteAllText(path, f);
|
||||
}
|
||||
|
||||
static void InsertStringBeforeCharIndex(string path, int charIndex, string str)
|
||||
{
|
||||
string f = File.ReadAllText(path);
|
||||
int indexCount = 0;
|
||||
int index = -1;
|
||||
for (int i = 0; i < f.Length; i++)
|
||||
{
|
||||
char c = f[i];
|
||||
if (c == '}')
|
||||
{
|
||||
if (indexCount == charIndex)
|
||||
{
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
indexCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (index != -1)
|
||||
{
|
||||
f = f.Insert(index, str);
|
||||
File.WriteAllText(path, f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8f2bb149d8a4d4acb8fdbd0faa2ca023
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
+40
-54
@@ -1,13 +1,15 @@
|
||||
// #if UNITY_EDITOR
|
||||
// #endif
|
||||
|
||||
using System.Collections.Generic;
|
||||
using FairyGUI;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using DG.Tweening;
|
||||
using IgnoreOPS;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using SGModule.ApplePay;
|
||||
using SGModule.NetKit;
|
||||
|
||||
namespace FlowerPower
|
||||
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class MainScene : BaseScene
|
||||
{
|
||||
@@ -41,10 +43,9 @@ namespace FlowerPower
|
||||
|
||||
// SuperApplication.Instance.AddComponent<AppsFlyerObjectScript1>();
|
||||
|
||||
// no net
|
||||
// #if !UNITY_EDITOR && UNITY_IOS
|
||||
// MaxADKit.Init();
|
||||
// #endif
|
||||
#if !UNITY_EDITOR && UNITY_ANDROID
|
||||
// MaxADKit.Init();
|
||||
#endif
|
||||
|
||||
#if UNITY_EDITOR
|
||||
isAssetBundleLoad = false;
|
||||
@@ -54,7 +55,7 @@ namespace FlowerPower
|
||||
if (isAssetBundleLoad)
|
||||
{
|
||||
int value = 0;
|
||||
GemCrushFileKit.GetLocalAssetBundle(
|
||||
LegendFileKit.GetLocalAssetBundle(
|
||||
max => { GameDispatcher.Instance.Dispatch(GameMsg.UpdateHotFixMax, max + 1); }, () =>
|
||||
{
|
||||
value++;
|
||||
@@ -65,9 +66,10 @@ namespace FlowerPower
|
||||
{
|
||||
OnInitAsset();
|
||||
}
|
||||
UnityManager.Instance.DakaiACT();
|
||||
|
||||
AppDispatcher.Instance.AddListener(AppMsg.UI_LoadingInitAsset, OnInitAsset);
|
||||
|
||||
TrackKit.TrackLoginFunnel(LoginFunnelEventType.AfSend);
|
||||
TrackKit.TrackLoginFunnel(LoginFunnelEventType.AfRecv, "success");
|
||||
}
|
||||
|
||||
private void OnLoginSucceed(object param = null)
|
||||
@@ -77,13 +79,14 @@ namespace FlowerPower
|
||||
|
||||
private void OnInitAsset(object param = null)
|
||||
{
|
||||
|
||||
AppDispatcher.Instance.Dispatch(AppMsg.AppManagerRegister);
|
||||
AppDispatcher.Instance.Dispatch(AppMsg.InitUIMgr);
|
||||
NetworkDispatcher.Instance.Dispatch(NetworkMsg.Login);
|
||||
|
||||
AppDispatcher.Instance.AddListener(AppMsg.LoginInit, OnLoadingComplete);
|
||||
|
||||
PreferencesMgr.Instance.InitPreferences();
|
||||
|
||||
// no net
|
||||
// PreferencesMgr.Instance.InitPreferences();
|
||||
// NetworkDispatcher.Instance.Dispatch(NetworkMsg.GetConfig);
|
||||
}
|
||||
|
||||
@@ -92,50 +95,15 @@ namespace FlowerPower
|
||||
|
||||
// Debug.Log("OnLoadingComplete------------");
|
||||
CtrlDispatcher.Instance.Dispatch(CtrlMsg.Game_StartReady);
|
||||
if (GameHelper.IsGiftSwitch()) CrazyAsyKit.StartCoroutine(TextureHelper.WriteTempBeforeOpenCoroutine_());
|
||||
|
||||
TimerHelper.mEasy.AddTimer(3.0f, () =>
|
||||
TimerHelper.mEasy.AddTimer(0.5f, () =>
|
||||
{
|
||||
AudioManager.Instance.InitDefaultButtonClickSound(AudioConst.click);
|
||||
AudioManager.Instance.InitDefaultButtonClickSound(AudioConst.UIButtonDefault);
|
||||
ModuleManager.Instance.AllModuleGameStart();
|
||||
ShowScene();
|
||||
SaveingPotHelper.CheckSaveingPot();
|
||||
SaveingPotHelper.TestingClearTime();
|
||||
// if (GameHelper.IsGiftSwitch())
|
||||
// {
|
||||
|
||||
// WebviewManager.Instance.SetFullScreen();
|
||||
// int flyswitch = ConfigSystem.GetConfig<CommonModel>().flyswitch;
|
||||
// int propswitch = ConfigSystem.GetConfig<CommonModel>().propswitch;
|
||||
// int offset_y = ConfigSystem.GetConfig<CommonModel>().WVOffset[0];
|
||||
// int offset_y1 = ConfigSystem.GetConfig<CommonModel>().WVOffset[1];
|
||||
//
|
||||
// float top_offset = 0;//fgui中的顶部信息的高度
|
||||
// float buttom_offset = 157;
|
||||
// if (Screen.safeArea.y != 0)
|
||||
// {//刘海屏
|
||||
// top_offset += Screen.safeArea.y;
|
||||
// }
|
||||
// // Debug.Log(ConfigSystem.GetConfig<CommonModel>().NewWVswitch);
|
||||
// //ConfigSystem.GetConfig<CommonModel>().NewWVswitch = 0;
|
||||
// if ((Random.Range(0, 100) < ConfigSystem.GetConfig<CommonModel>().NewWVswitch)&&GameHelper.IsGiftSwitch())
|
||||
// {
|
||||
// WebviewManager.Instance.is_use_otherweb = true;
|
||||
// WebviewManager.Instance.useOtherWeb(WebviewManager.Instance.is_use_otherweb);
|
||||
// }
|
||||
// else WebviewManager.Instance.useOtherWeb(false);
|
||||
// WebviewManager.Instance.SetOffset(offset_y, offset_y1);
|
||||
// WebviewManager.Instance.SetPadding(0, top_offset / GRoot.inst.height, 0, buttom_offset / GRoot.inst.height);
|
||||
//
|
||||
// WebviewManager.Instance.RefreshUrl();
|
||||
// // Debug.Log($"flyswitch==1 ------ {flyswitch == 1}");
|
||||
// // Debug.Log($"propswitch==1 ------ {propswitch == 1}");
|
||||
// WebviewManager.Instance.setFlyBtnTag(flyswitch == 1);
|
||||
// WebviewManager.Instance.setRewardBtnTag(propswitch == 1);
|
||||
//
|
||||
// WebviewManager.Instance.ShowH5View(false);
|
||||
// WebviewManager.Instance.SetBtn(ConfigSystem.GetConfig<CommonModel>().propCoord[0], ConfigSystem.GetConfig<CommonModel>().propCoord[1], 60, 60);
|
||||
//
|
||||
// // }
|
||||
});
|
||||
}
|
||||
|
||||
@@ -144,11 +112,29 @@ namespace FlowerPower
|
||||
{
|
||||
if (is_open) return;
|
||||
is_open = true;
|
||||
PreDownloadManager.InitializeLiveData();
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.GameLoginUI_Open);
|
||||
ChatHelper.CheckReply();
|
||||
|
||||
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
PreDownloadManager.StartDownloadLivePicture();
|
||||
PreDownloadManager.StartDownloadAlbumsPicture();
|
||||
//预下载视频
|
||||
PreDownloadManager.StartDownload();
|
||||
|
||||
PreDownloadManager.StartDownloadSecretPicture();
|
||||
// DOVirtual.DelayedCall(2, () =>
|
||||
// {
|
||||
// ApplePayManager.GetVipHistory();
|
||||
// });
|
||||
}
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
|
||||
public abstract class BaseInterfaceManager<T> : IDisposable, InterfaceManager where T : BaseInterfaceManager<T>, new()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
|
||||
public abstract class BaseUnityManager<T> : SingletonUnity<T>, InterfaceManager
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public interface InterfaceManager
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using FairyGUI;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public sealed class CameraManager : BaseInterfaceManager<CameraManager>
|
||||
{
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
using System;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public enum MonthType : int
|
||||
public enum MonthType : int
|
||||
{
|
||||
None = 0,
|
||||
January = 1,
|
||||
@@ -32,7 +32,7 @@ namespace FlowerPower
|
||||
private long HeartBeatInterval = 7;
|
||||
|
||||
|
||||
|
||||
private int FixTimeOffset = 0;
|
||||
|
||||
public int ServerRTTOneWayTimeOffset { get; private set; }
|
||||
|
||||
@@ -102,12 +102,20 @@ namespace FlowerPower
|
||||
|
||||
|
||||
|
||||
public long GetServerCurrTimestamp()
|
||||
public long GetServerCurrTimestamp(bool isFix = false)
|
||||
{
|
||||
return GetCurrTimestamp() - ServerRTTOneWayTimeOffset;
|
||||
var servertimes = GetCurrTimestamp() - ServerRTTOneWayTimeOffset;
|
||||
if(isFix)
|
||||
{
|
||||
servertimes += FixTimeOffset;
|
||||
}
|
||||
return servertimes;
|
||||
}
|
||||
|
||||
|
||||
public void SetTimeOffset(int offset)
|
||||
{
|
||||
FixTimeOffset += offset;
|
||||
}
|
||||
|
||||
|
||||
public DateTime GetServerCurrDateTime()
|
||||
@@ -397,7 +405,7 @@ namespace FlowerPower
|
||||
}
|
||||
public string DateTimeToFFFString(DateTime time)
|
||||
{
|
||||
return time.ToString("HH:mm:ss");
|
||||
return time.ToString("HH:mm:ss ff");
|
||||
}
|
||||
public long GetServerCurrTimestampByMillisecond()
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public sealed class GameIManager : BaseInterfaceManager<GameIManager>
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public sealed class ModuleManager : BaseInterfaceManager<ModuleManager>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public sealed class SceneManager : BaseInterfaceManager<SceneManager>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public sealed class ManagerOfManager : Singleton<ManagerOfManager>
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using UnityEngine.Events;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public sealed class AudioManager : BaseUnityManager<AudioManager>
|
||||
{
|
||||
@@ -107,7 +107,7 @@ namespace FlowerPower
|
||||
|
||||
public void InitDefaultButtonClickSound(string btnSound)
|
||||
{
|
||||
string defaultSound = AudioConst.click;
|
||||
string defaultSound = AudioConst.UIButtonDefault;
|
||||
if (!string.IsNullOrEmpty(btnSound))
|
||||
{
|
||||
defaultSound = btnSound;
|
||||
|
||||
@@ -3,7 +3,7 @@ using UnityEngine;
|
||||
using System.Collections;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public sealed class SceneSwitchManager : BaseUnityManager<SceneSwitchManager>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public enum TimerTimeType : int
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ using UnityEngine.EventSystems;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public class UISequenceInfo
|
||||
{
|
||||
@@ -694,7 +694,7 @@ namespace FlowerPower
|
||||
{
|
||||
GameObject engineEventSystemGo = new GameObject("[EngineEventSystem]");
|
||||
engineEventSystemGo.AddComponent<EngineEventSystem>();
|
||||
engineEventSystemGo.transform.SetParent(GemCrushCore.Instance.transform, false);
|
||||
engineEventSystemGo.transform.SetParent(LoveLegendCore.Instance.transform, false);
|
||||
}
|
||||
|
||||
private void InitFguiConfig()
|
||||
@@ -763,7 +763,7 @@ namespace FlowerPower
|
||||
{
|
||||
if (AppConst.IsMultiLangue)
|
||||
{
|
||||
Stage.inst.currLang = AppConst.InternalLangue;
|
||||
Stage.inst.currLang = Language.getCurrentLanguage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -823,7 +823,7 @@ namespace FlowerPower
|
||||
if (multiLangueConfigList == null || multiLangueConfigList.Count == 0) return;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(switchLang)) return;
|
||||
if (switchLang == Stage.inst.currLang && switchLang == AppConst.InternalLangue) return;
|
||||
if (switchLang == Stage.inst.currLang) return;
|
||||
if (!multiLangueConfigList.Contains(switchLang)) return;
|
||||
|
||||
var switchLangXML = LoadKit.Instance.LoadAsset<TextAsset>("TextAsset.I18N", switchLang);
|
||||
@@ -832,6 +832,9 @@ namespace FlowerPower
|
||||
|
||||
var xml = new FairyGUI.Utils.XML(switchLangXML.text);
|
||||
UIPackage.SetStringsSource(xml);
|
||||
|
||||
|
||||
|
||||
Stage.inst.currLang = switchLang;
|
||||
|
||||
AppConst.CurrMultiLangue = switchLang;
|
||||
|
||||
+195
-169
@@ -6,7 +6,12 @@ using System.Collections;
|
||||
using UnityEngine.UI;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using FlowerPower;
|
||||
using IgnoreOPS;
|
||||
using SGModule.ApplePay;
|
||||
using SGModule.Common.Helper;
|
||||
using SGModule.NetKit;
|
||||
using LoveLegend;
|
||||
using Unity.VisualScripting;
|
||||
|
||||
public class MaxPayManager
|
||||
{
|
||||
@@ -14,30 +19,93 @@ public class MaxPayManager
|
||||
|
||||
public static bool isPay = false;
|
||||
|
||||
public static bool isIOSPay = false;
|
||||
|
||||
// public static Dictionary<string, int> statusDictionary = new();
|
||||
MaxPayManager()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// public static string buy_one = "com.rainforestworld.space.24.99";
|
||||
//
|
||||
// // public static string buy_gold_1 = "com.rainforestworld.shop.1.99";
|
||||
// // public static string buy_gold_2 = "com.rainforestworld.shop.3.99";
|
||||
// // public static string buy_gold_3 = "com.rainforestworld.shop.19.99";
|
||||
// // public static string buy_gold_4 = "com.rainforestworld.shop.39.99";
|
||||
// public static string remove_ad = "com.rainforestworld.remove.2.99";
|
||||
// public static string battle_pass = "com.rainforestworld.pass.9.99";
|
||||
// public static string pack_reward = "com.rainforestworld.reward.1.99";
|
||||
// public static string fail_pack = "com.rainforestworld.fail.1.99";
|
||||
// public static string three_days_gift = "com.rainforestworld.three.1.99";
|
||||
// public static string secret_albnums = "com.rainforestworld.secret_albnums.3.99";
|
||||
|
||||
|
||||
public static bool isIOSPay = false;
|
||||
|
||||
// private static readonly Dictionary<string, PayTrackMapping> _payTrackMap = new()
|
||||
// {
|
||||
// [buy_one] = new PayTrackMapping
|
||||
// {
|
||||
// EventKey = ADEventTrack.MaxPayEvent,
|
||||
// ClickPropertyKey = _ => ADEventTrack.Property.buy_one_click,
|
||||
// },
|
||||
// [remove_ad] = new PayTrackMapping
|
||||
// {
|
||||
// EventKey = ADEventTrack.MaxPayEvent,
|
||||
// ClickPropertyKey = _ => ADEventTrack.Property.remove_ad_click
|
||||
// },
|
||||
// [pack_reward] = new PayTrackMapping
|
||||
// {
|
||||
// EventKey = ADEventTrack.MaxPayEvent,
|
||||
// ClickPropertyKey = _ => ADEventTrack.Property.lucky_gift_click
|
||||
// },
|
||||
// [battle_pass] = new PayTrackMapping
|
||||
// {
|
||||
// EventKey = ADEventTrack.MaxPayEvent,
|
||||
// ClickPropertyKey = _ => ADEventTrack.Property.master_pass_click
|
||||
// },
|
||||
// ["buy_gold"] = new PayTrackMapping
|
||||
// {
|
||||
// EventKey = ADEventTrack.MaxPayEvent,
|
||||
// ClickPropertyKey = suffix => ADEventTrack.Property.gold_click_ + suffix
|
||||
// },
|
||||
// ["secret_albnums"] = new PayTrackMapping
|
||||
// {
|
||||
// EventKey = ADEventTrack.MaxPayEvent,
|
||||
// ClickPropertyKey = suffix => ADEventTrack.Property.secret_click_ + suffix
|
||||
// },
|
||||
// ["vip_club"] = new PayTrackMapping
|
||||
// {
|
||||
// EventKey = ADEventTrack.MaxPayEvent,
|
||||
// ClickPropertyKey = suffix => ADEventTrack.Property.vip_click_ + suffix
|
||||
// },
|
||||
//
|
||||
// };
|
||||
|
||||
public void Buy(ApplePayClass _data)
|
||||
{
|
||||
if (!GameHelper.IsConnect()) {
|
||||
GameHelper.ShowTips("Network error, please try again later.");
|
||||
if (!GameHelper.IsConnect())
|
||||
{
|
||||
GameHelper.ShowTips("no_connect", true);
|
||||
return;
|
||||
}
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Open);
|
||||
System.Random random = new();
|
||||
int paymentMethod = random.Next(0, 100); // 生成0到100之间的随机整数,包括0-99
|
||||
int PayRate = GameHelper.GetCommonModel().PayRate;
|
||||
if (!GameHelper.IsGiftSwitch() || paymentMethod < PayRate)
|
||||
Debug.Log($"[max] paymentMethod:{paymentMethod} PayRate:{PayRate} _data.sku=={_data.sku}");
|
||||
if ((!GameHelper.IsGiftSwitch() || paymentMethod < PayRate) && !_data.sku.Contains("secret_albnums"))
|
||||
{
|
||||
Debug.Log("barry ios pay");
|
||||
// Debug.Log("barry ios pay");
|
||||
// 调用官方支付逻辑
|
||||
isIOSPay = true;
|
||||
PurchasingManager.Instance.Purchase(_data);
|
||||
var appleData = new ApplePayData
|
||||
{
|
||||
sku = _data.sku,
|
||||
amount = _data.amount,
|
||||
currency = _data.currency,
|
||||
shopName = _data.shopName,
|
||||
type = _data.type
|
||||
};
|
||||
PurchasingManager.Purchase(appleData);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -45,7 +113,7 @@ public class MaxPayManager
|
||||
// 调用三方支付逻辑
|
||||
StopPayCoroutine();
|
||||
isIOSPay = false;
|
||||
SaveData.GetSaveobject().max_pay_object = _data;
|
||||
SaveData.GetSaveObject().max_pay_object = _data;
|
||||
MaxPay(_data);
|
||||
}
|
||||
}
|
||||
@@ -55,75 +123,78 @@ public class MaxPayManager
|
||||
/// </summary>
|
||||
public void MaxPay(ApplePayClass data_)
|
||||
{
|
||||
//is debug test--------测试代码
|
||||
// if (Application.identifier != AppConst.AppName)
|
||||
// // if (Application.identifier == AppConst.AppName)
|
||||
// {
|
||||
Debug.Log($"[barry] MaxPay----- {JsonConvert.SerializeObject(data_)}");
|
||||
|
||||
ApplePayClass paydata = data_;
|
||||
SaveData.pay_time = Time.time;
|
||||
|
||||
if (data_.sku == PurchasingManager.buy_one)
|
||||
if (data_.sku == PurchasingManager.GetPaySku(PayType.buy_one))
|
||||
{
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.buy_one_click, 1);
|
||||
TrackKit.SendEvent(ADEventTrack.MaxPayEvent, ADEventTrack.Property.buy_one_click);
|
||||
}
|
||||
else if (data_.sku == PurchasingManager.buy_one_off) {
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.BuyOneOffClick, 1);
|
||||
}
|
||||
else if (data_.sku != null && data_.sku == PurchasingManager.remove_ad)
|
||||
else if (data_.sku == PurchasingManager.GetPaySku(PayType.buy_one_off))
|
||||
{
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.remove_ad_click, 1);
|
||||
// TrackKit.SendEvent(ADEventTrack.MaxPayEvent, ADEventTrack.Property.BuyOneOffClick);
|
||||
}
|
||||
else if (data_.sku == PurchasingManager.pack_reward)
|
||||
else if (data_.sku != null && data_.sku == PurchasingManager.GetPaySku(PayType.remove_ad))
|
||||
{
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.pack_click, 1);
|
||||
TrackKit.SendEvent(ADEventTrack.MaxPayEvent, ADEventTrack.Property.remove_ad_click);
|
||||
}
|
||||
else if (data_.sku == PurchasingManager.GetPaySku(PayType.pack_reward))
|
||||
{
|
||||
TrackKit.SendEvent(ADEventTrack.MaxPayEvent, ADEventTrack.Property.lucky_gift_click);
|
||||
}
|
||||
else if (data_.shopName != null && data_.shopName.StartsWith("buy_gold"))
|
||||
{
|
||||
int startIndex = "buy_gold".Length;
|
||||
string suffix = paydata.shopName[startIndex..]; // 截取 "gold" 后的所有字符
|
||||
string eventClickName = $"gold_click_{suffix}";
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, eventClickName, 1);
|
||||
TrackKit.SendEvent(ADEventTrack.MaxPayEvent, ADEventTrack.Property.gold_click_ + suffix);
|
||||
|
||||
}
|
||||
else if (data_.sku == PurchasingManager.battle_pass)
|
||||
else if (data_.sku.StartsWith("secret_albnums"))
|
||||
{
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.pass_click, 1);
|
||||
string suffix = data_.sku["secret_albnums".Length..];
|
||||
TrackKit.SendEvent(ADEventTrack.MaxPayEvent, ADEventTrack.Property.secret_albums_click_ + suffix);
|
||||
}
|
||||
else if (data_.sku == PurchasingManager.fail_pack)
|
||||
else if (data_.sku.StartsWith("vip_club"))
|
||||
{
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.fail_click, 1);
|
||||
string suffix = data_.sku["vip_club".Length..];
|
||||
TrackKit.SendEvent(ADEventTrack.MaxPayEvent, ADEventTrack.Property.vip_click_ + suffix);
|
||||
}
|
||||
else if (data_.sku == PurchasingManager.three_days_gift)
|
||||
else if (data_.sku == PurchasingManager.GetPaySku(PayType.battle_pass))
|
||||
{
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, BuriedPointEvent.three_days_gift_click, 1);
|
||||
TrackKit.SendEvent(ADEventTrack.MaxPayEvent, ADEventTrack.Property.master_pass_click);
|
||||
}
|
||||
PayerData test = new PayerData()
|
||||
else if (data_.sku == PurchasingManager.GetPaySku(PayType.fail_pack))
|
||||
{
|
||||
TrackKit.SendEvent(ADEventTrack.MaxPayEvent, ADEventTrack.Property.fail_click);
|
||||
}
|
||||
else if (data_.sku == PurchasingManager.GetPaySku(PayType.three_days_gift))
|
||||
{
|
||||
TrackKit.SendEvent(ADEventTrack.MaxPayEvent, ADEventTrack.Property.three_days_gift_click);
|
||||
}
|
||||
|
||||
PayerData requestData = new PayerData()
|
||||
{
|
||||
amount = data_.amount,
|
||||
};
|
||||
|
||||
//max 支付订单创建
|
||||
NetworkKit.PostWithHeader<orderData>("shop/maxPayIn", test, (isSuccess, obj) =>
|
||||
NetKit.Instance.Post<orderData>("shop/paMPayIn", requestData, response =>
|
||||
{
|
||||
if (isSuccess)
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
||||
|
||||
// Debug.Log($"max 支付订单创建:{JsonConvert.SerializeObject(obj)}");
|
||||
SaveData.GetSaveobject().max_pay_object.innerOrderId = obj.order_id;
|
||||
SaveData.GetSaveObject().max_pay_object.innerOrderId = response.Data.order_id;
|
||||
paydata.status = 1;
|
||||
SavePayData(obj.order_id, paydata);
|
||||
SavePayData(response.Data.order_id, paydata);
|
||||
isPay = true;
|
||||
OpenBrowser.OpenURL(obj.pay_url);
|
||||
|
||||
OpenBrowser.OpenURL(response.Data.pay_url);
|
||||
}
|
||||
});
|
||||
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // GameDispatcher.Instance.Dispatch(GameMsg.apple_pay_success, data_.sku);
|
||||
// }
|
||||
}
|
||||
|
||||
public void SavePayData(string orderId, ApplePayClass payData)
|
||||
@@ -151,7 +222,6 @@ public class MaxPayManager
|
||||
// 保存更新后的数据
|
||||
PlayerPrefs.SetString("three_pay_data", JsonConvert.SerializeObject(statusDictionary));
|
||||
// Debug.Log($"max 支付 three_pay_data {JsonConvert.SerializeObject(statusDictionary)}");
|
||||
|
||||
}
|
||||
|
||||
public ApplePayClass GetPayData(string orderId)
|
||||
@@ -189,6 +259,7 @@ public class MaxPayManager
|
||||
private int PayStatus = -1;
|
||||
|
||||
private Coroutine PayCoroutine;
|
||||
|
||||
public IEnumerator ProcessPayData()
|
||||
{
|
||||
var payDataJson = PlayerPrefs.GetString("three_pay_data", "{}");
|
||||
@@ -210,7 +281,6 @@ public class MaxPayManager
|
||||
if (PayStatus == 1)
|
||||
{
|
||||
// 如果返回值为1,则等待5秒后再次请求
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -220,7 +290,6 @@ public class MaxPayManager
|
||||
}
|
||||
|
||||
yield return null; // 等待本次请求完成
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -239,81 +308,97 @@ public class MaxPayManager
|
||||
// Debug.Log("max 支付 StartCoroutine------");
|
||||
PayCoroutine = CrazyAsyKit.StartCoroutine(ProcessPayData());
|
||||
}
|
||||
|
||||
public void PaySuccess(string orderId)
|
||||
{
|
||||
var test = new maxOrder();
|
||||
test.order_id = orderId;
|
||||
//max 支付订单查询
|
||||
NetworkKit.PostWithHeader<orderState>("shop/maxPayOrderQuery", test, (isSuccess, obj) =>
|
||||
NetKit.Instance.Post<orderState>("shop/paMPayOrderQuery", test, response =>
|
||||
{
|
||||
// Debug.Log($"max 支付订单查询: id= {orderId} is succ={isSuccess}");
|
||||
if (isSuccess)
|
||||
Debug.Log($"max 支付订单查询: id= {orderId} is succ={response.IsSuccess}");
|
||||
if (response.IsSuccess)
|
||||
{
|
||||
// Debug.Log($"max 支付订单查询: 成功,statu====: {obj.status}");
|
||||
// Debug.Log($"max 支付订单查询: {JsonConvert.SerializeObject(obj)}");
|
||||
PayStatus = obj.status;
|
||||
PayStatus = response.Data.status;
|
||||
|
||||
//1:支付中,需要定时查询
|
||||
if (obj.status == 1)
|
||||
if (response.Data.status == 1)
|
||||
{
|
||||
var paydata = GetPayData(orderId);
|
||||
if (paydata != null)
|
||||
{
|
||||
paydata.status = 1;
|
||||
SavePayData(obj.order_id, paydata);
|
||||
SavePayData(response.Data.order_id, paydata);
|
||||
}
|
||||
|
||||
// reCreatPur();
|
||||
}
|
||||
//2:支付成功,发奖
|
||||
else if (obj.status == 2)
|
||||
else if (response.Data.status == 2)
|
||||
{
|
||||
var paydata = GetPayData(orderId);
|
||||
if (paydata != null)
|
||||
{
|
||||
paydata.status = 2;
|
||||
SavePayData(obj.order_id, paydata);
|
||||
SavePayData(response.Data.order_id, paydata);
|
||||
}
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
||||
|
||||
bool isOpen = false;
|
||||
if (paydata.sku == PurchasingManager.buy_one)
|
||||
if (paydata.sku == PurchasingManager.GetPaySku(PayType.buy_one))
|
||||
{
|
||||
isOpen = HandleSku(paydata.sku, UIConst.AddViewUI, BuriedPointEvent.buy_one_open, BuriedPointEvent.buy_one_success);
|
||||
isOpen = HandleSku(paydata.sku, UIConst.AddViewUI, ADEventTrack.Property.buy_one_success);
|
||||
}
|
||||
else if (paydata.sku == PurchasingManager.buy_one_off) {
|
||||
isOpen = HandleSku(paydata.sku, UIConst.AddViewUI, BuriedPointEvent.BuyOneOffOpen, BuriedPointEvent.BuyOneOffSuccess);
|
||||
}
|
||||
else if (paydata.sku != null && paydata.sku == PurchasingManager.remove_ad)
|
||||
// else if (paydata.sku == PurchasingManager.GetPaySku(PayType.buy_one_off))
|
||||
// {
|
||||
// isOpen = HandleSku(paydata.sku, UIConst.AddViewUI, ADEventTrack.Property.BuyOneOffSuccess);
|
||||
// }
|
||||
else if (paydata.sku != null && paydata.sku == PurchasingManager.GetPaySku(PayType.remove_ad))
|
||||
{
|
||||
isOpen = HandleSku(paydata.sku, UIConst.PackrewardUI, BuriedPointEvent.remove_ad_open, BuriedPointEvent.remove_ad_success);
|
||||
isOpen = HandleSku(paydata.sku, UIConst.PackrewardUI, ADEventTrack.Property.remove_ad_receive);
|
||||
}
|
||||
else if (paydata.sku == PurchasingManager.pack_reward)
|
||||
else if (paydata.sku == PurchasingManager.GetPaySku(PayType.pack_reward))
|
||||
{
|
||||
isOpen = HandleSku(paydata.sku, UIConst.PackrewardUI, BuriedPointEvent.pack_open, BuriedPointEvent.pack_success);
|
||||
isOpen = HandleSku(paydata.sku, UIConst.PackrewardUI, ADEventTrack.Property.lucky_gift_receive);
|
||||
}
|
||||
else if (paydata.shopName != null && paydata.shopName.StartsWith("buy_gold"))
|
||||
{
|
||||
int startIndex = "buy_gold".Length;
|
||||
string suffix = paydata.shopName[startIndex..]; // 截取 "gold" 后的所有字符
|
||||
string eventOpenName = $"gold_open_{suffix}";
|
||||
string eventSuccessName = $"gold_success_{suffix}";
|
||||
string eventSuccessName = ADEventTrack.Property.shop_receive_ + suffix;
|
||||
|
||||
isOpen = HandleSku(paydata.sku, UIConst.BuygoldUI, eventOpenName, eventSuccessName);
|
||||
isOpen = HandleSku(paydata.sku, UIConst.BuygoldUI, eventSuccessName);
|
||||
|
||||
}
|
||||
else if (paydata.sku == PurchasingManager.battle_pass)
|
||||
else if (paydata.sku == PurchasingManager.GetPaySku(PayType.battle_pass))
|
||||
{
|
||||
isOpen = HandleSku(paydata.sku, UIConst.PassViewUI, BuriedPointEvent.pass_open, BuriedPointEvent.pass_success);
|
||||
isOpen = HandleSku(paydata.sku, UIConst.PassViewUI, ADEventTrack.Property.master_pass_receive);
|
||||
}
|
||||
else if (paydata.sku == PurchasingManager.fail_pack)
|
||||
else if (paydata.sku == PurchasingManager.GetPaySku(PayType.fail_pack))
|
||||
{
|
||||
isOpen = HandleSku(paydata.sku, UIConst.PackrewardUI, BuriedPointEvent.fail_show, BuriedPointEvent.fail_buy_success);
|
||||
isOpen = HandleSku(paydata.sku, UIConst.PackrewardUI, ADEventTrack.Property.fail_buy_success);
|
||||
}
|
||||
else if (paydata.sku == PurchasingManager.three_days_gift)
|
||||
else if (paydata.sku == PurchasingManager.GetPaySku(PayType.three_days_gift))
|
||||
{
|
||||
isOpen = HandleSku(paydata.sku, UIConst.ThreeDaysGiftUI, BuriedPointEvent.three_days_gift_show, BuriedPointEvent.three_days_gift_buy_success);
|
||||
isOpen = HandleSku(paydata.sku, UIConst.ThreeDaysGiftUI, ADEventTrack.Property.three_days_gift_buy_success);
|
||||
}
|
||||
else if (paydata.sku.StartsWith("secret_albnums"))
|
||||
{
|
||||
int startIndex = "secret_albnums".Length;
|
||||
string suffix = paydata.sku[startIndex..]; // 截取 "secret_albnums" 后的所有字符
|
||||
string eventSuccessName = ADEventTrack.Property.secret_albums_success_ + suffix;
|
||||
|
||||
isOpen = HandleSku(paydata.sku, UIConst.SecretAlbumsNextUI, eventSuccessName);
|
||||
}
|
||||
else if (paydata.shopName != null && paydata.shopName.StartsWith("vip_club"))
|
||||
{
|
||||
int startIndex = "vip_club".Length;
|
||||
string suffix = paydata.shopName[startIndex..]; // 截取 "vip_club" 后的所有字符
|
||||
string eventSuccessName = ADEventTrack.Property.vip_success_ + suffix;
|
||||
isOpen = HandleSku(paydata.sku, UIConst.VipClubViewUI, eventSuccessName);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -323,7 +408,7 @@ public class MaxPayManager
|
||||
}
|
||||
|
||||
string sku = "";
|
||||
if (paydata.sku.Contains("shop"))
|
||||
if (paydata.sku.Contains("shop") || paydata.sku.Contains("sub"))
|
||||
{
|
||||
sku = paydata.shopName;
|
||||
}
|
||||
@@ -334,42 +419,27 @@ public class MaxPayManager
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.apple_pay_success, sku);
|
||||
|
||||
SaveingPotClass taskData = SaveData.GetSaveobject().saveingpot_history.Last();
|
||||
Makeup_2 makeupVo = ConfigSystem.GetConfig<MakeupModel_2>().GetData(taskData.tableId);
|
||||
SaveData.GetSaveobject().saveingpot_ch += ((float)paydata.amount) / 100 * makeupVo.PayIncrease; ;
|
||||
if (ConfigSystem.GetConfig<CommonModel>().PiggyBankSwitch == 1 && GameHelper.IsGiftSwitch())
|
||||
{
|
||||
if ((SaveData.GetSaveobject().saveingpot_ch > taskData.amount) && (!taskData.auto_show) && !UIManager.Instance.IsExistUI(UIConst.H5UI))
|
||||
{
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SaveingPotUI_Open);
|
||||
taskData.auto_show = true;
|
||||
PlayerPrefs.SetInt("pot_day", DateTime.Now.Day);
|
||||
}
|
||||
}
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.RefreshSaveingPot);
|
||||
|
||||
DOVirtual.DelayedCall(1, () =>
|
||||
{
|
||||
SaveData.GetSaveobject().max_pay_object = null;
|
||||
SaveData.GetSaveObject().max_pay_object = null;
|
||||
var paydata = GetPayData(orderId);
|
||||
if (paydata != null)
|
||||
{
|
||||
paydata.status = 4;
|
||||
SavePayData(obj.order_id, paydata);
|
||||
SavePayData(response.Data.order_id, paydata);
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
//3:支付失败,已领奖或者支付失败,或者查询次数达到上限
|
||||
else if (obj.status == 3)
|
||||
else if (response.Data.status == 3)
|
||||
{
|
||||
var paydata = GetPayData(orderId);
|
||||
if (paydata != null)
|
||||
{
|
||||
paydata.status = 3;
|
||||
SavePayData(obj.order_id, paydata);
|
||||
SavePayData(response.Data.order_id, paydata);
|
||||
}
|
||||
|
||||
OnPayFailed(orderId);
|
||||
}
|
||||
//4:已发货,服务端记录已经发过奖,若客户端未发奖可发奖
|
||||
@@ -381,11 +451,11 @@ public class MaxPayManager
|
||||
if (paydata != null)
|
||||
{
|
||||
paydata.status = 4;
|
||||
SavePayData(obj.order_id, paydata);
|
||||
SavePayData(response.Data.order_id, paydata);
|
||||
}
|
||||
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
||||
SaveData.GetSaveobject().max_pay_object = null;
|
||||
SaveData.GetSaveObject().max_pay_object = null;
|
||||
|
||||
string sku = "";
|
||||
if (paydata.sku.Contains("shop"))
|
||||
@@ -396,9 +466,7 @@ public class MaxPayManager
|
||||
{
|
||||
sku = paydata.sku;
|
||||
}
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.apple_pay_success, sku);
|
||||
|
||||
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.apple_pay_success, paydata.sku);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -412,17 +480,15 @@ public class MaxPayManager
|
||||
PayStatus = -1;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
bool HandleSku(string sku, string uiConst, string openEvent, string successEvent)
|
||||
bool HandleSku(string sku, string uiConst, string successEvent)
|
||||
{
|
||||
bool isOpen;
|
||||
try
|
||||
{
|
||||
isOpen = CheckIsOpen(uiConst);
|
||||
// NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, openEvent, 1);
|
||||
NetworkKit.BuriedPoint(BuriedPointEvent.Apple_pay_event, successEvent, 1);
|
||||
TrackKit.SendEvent(ADEventTrack.MaxPayEvent, successEvent);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -435,11 +501,11 @@ public class MaxPayManager
|
||||
return isOpen;
|
||||
}
|
||||
|
||||
public void reCreatPur()//重新验证订单
|
||||
public void reCreatPur() //重新验证订单
|
||||
{
|
||||
// Debug.Log($"max 支付 reCreatPur 重新验证订单: pay_object_data===: {JsonConvert.SerializeObject(SaveData.GetSaveobject().max_pay_object)}");
|
||||
// Debug.Log($"max 支付 reCreatPur 重新验证订单: pay_object_data===: {JsonConvert.SerializeObject(SaveData.GetSaveObject().max_pay_object)}");
|
||||
|
||||
// if (SaveData.GetSaveobject().max_pay_object != null)
|
||||
// if (SaveData.GetSaveObject().max_pay_object != null)
|
||||
// {
|
||||
// CrazyAsyKit.StartCoroutine(ProcessPayData());
|
||||
// }
|
||||
@@ -457,11 +523,9 @@ public class MaxPayManager
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
||||
// Debug.LogWarning("OnPurchaseFailedproduct:" + product.transactionID + " failureReason:" + failureReason);
|
||||
|
||||
BIManager.Instance.TrackPurchase(paydata.amount, paydata.currency, "1", paydata.sku, "paid_err");
|
||||
|
||||
DOVirtual.DelayedCall(1, () =>
|
||||
{
|
||||
SaveData.GetSaveobject().max_pay_object = null;
|
||||
});
|
||||
DOVirtual.DelayedCall(1, () => { SaveData.GetSaveObject().max_pay_object = null; });
|
||||
}
|
||||
|
||||
|
||||
@@ -472,68 +536,10 @@ public class MaxPayManager
|
||||
return isOpen;
|
||||
}
|
||||
|
||||
//适用这个方法领奖,说明购买界面已经关闭
|
||||
private void GetPayPrice(ApplePayClass paydata)
|
||||
{
|
||||
decimal rewardNum = 0;
|
||||
if (paydata.sku == PurchasingManager.buy_one)
|
||||
{
|
||||
SaveData.GetSaveobject().have_slot = true;
|
||||
SaveData.saveDataFunc();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Slot_refresh);
|
||||
}
|
||||
else if (paydata.sku == PurchasingManager.remove_ad)
|
||||
{
|
||||
var list = ConfigSystem.GetConfig<PaidgiftModel>().dataList;
|
||||
if (list.Count > 0)
|
||||
{
|
||||
rewardNum = list[1].coins_quantity;
|
||||
}
|
||||
PreferencesMgr.Instance.Currency101 += ConfigSystem.GetConfig<PaidgiftModel>().dataList[1].coins_quantity;
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
SaveData.GetSaveobject().is_get_removead = true;
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.noads_refresh);
|
||||
}
|
||||
else if (paydata.sku == PurchasingManager.pack_reward)
|
||||
{
|
||||
var list = ConfigSystem.GetConfig<PaidgiftModel>().dataList;
|
||||
if (list.Count > 0)
|
||||
{
|
||||
rewardNum = list[0].coins_quantity;
|
||||
int back_num = list[0].props_quantity[1];
|
||||
int out_num = list[0].props_quantity[0];
|
||||
int refresh_num = list[0].props_quantity[2];
|
||||
GameHelper.AddItemNumber(0, out_num);
|
||||
GameHelper.AddItemNumber(1, back_num);
|
||||
GameHelper.AddItemNumber(2, refresh_num);
|
||||
SaveData.saveDataFunc();
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||
GameDispatcher.Instance.Dispatch(GameMsg.Sheep_item_refresh);
|
||||
}
|
||||
SaveData.GetSaveobject().is_get_packreward = true;
|
||||
// GameDispatcher.Instance.Dispatch(GameMsg.noads_refresh);
|
||||
}
|
||||
else if (paydata.shopName != null && paydata.shopName.StartsWith("buy_gold"))
|
||||
{
|
||||
int startIndex = "buy_gold".Length;
|
||||
string suffix = paydata.shopName[startIndex..]; // 截取 "gold" 后的所有字符
|
||||
rewardNum = GetGoldRewradNum(int.Parse(suffix));
|
||||
}
|
||||
else if (paydata.sku == PurchasingManager.battle_pass)
|
||||
{
|
||||
//标记已经购买过
|
||||
SaveData.GetSaveobject().is_get_battlepass = true;
|
||||
}
|
||||
if (rewardNum > 0)
|
||||
{
|
||||
GetPayReward(rewardNum);
|
||||
}
|
||||
}
|
||||
|
||||
private static decimal GetGoldRewradNum(int index)
|
||||
{
|
||||
decimal rewardNum = 0;
|
||||
var list = ConfigSystem.GetConfig<PaidcoinsModel>().dataList;
|
||||
var list = ConfigSystem.GetConfig<Paidcoins>();
|
||||
if (list.Count > 0 && list.Count > index)
|
||||
{
|
||||
rewardNum = list[index].Actual_coins;
|
||||
@@ -562,9 +568,29 @@ public class MaxPayManager
|
||||
public class maxOrder
|
||||
{
|
||||
public string order_id;
|
||||
|
||||
}
|
||||
|
||||
public class ApplePayClass
|
||||
{
|
||||
public string innerOrderId;
|
||||
public string transactionId;
|
||||
public int amount;
|
||||
public string sku;
|
||||
public string currency = "USD";
|
||||
public int status;
|
||||
public string shopName;
|
||||
public string type;
|
||||
}
|
||||
|
||||
|
||||
// public class ApplePayClass
|
||||
// {
|
||||
// public string innerOrderId;
|
||||
// public int amount;
|
||||
// public string sku;
|
||||
// public string currency = "USD";
|
||||
// public int status;
|
||||
// }
|
||||
|
||||
public class PayerData
|
||||
{
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using LoveLegend;
|
||||
using UnityEngine;
|
||||
|
||||
public static class MemoryManager
|
||||
{
|
||||
private static long nextCleanTime = 600; // 每 600 秒检查一次
|
||||
private static long timeConfig;
|
||||
|
||||
|
||||
public static void StartMemoryMonitor(int checkInterval = 600)
|
||||
{
|
||||
#if !UNITY_EDITOR
|
||||
timeConfig = checkInterval;
|
||||
SetTime();
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void SetTime()
|
||||
{
|
||||
nextCleanTime = DateTimeOffset.UtcNow.ToUnixTimeSeconds() + timeConfig * 60;
|
||||
}
|
||||
|
||||
public static void CleanMemoryMonitor()
|
||||
{
|
||||
if (DateTimeOffset.UtcNow.ToUnixTimeSeconds() > nextCleanTime)
|
||||
{
|
||||
SetTime();
|
||||
|
||||
Resources.UnloadUnusedAssets();
|
||||
|
||||
GC.Collect(); // 强制 GC,注意可能造成短暂卡顿
|
||||
Debug.Log("[MemoryManager] 内存清理完成");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a0504422bc1d34bf6af75faa8efec9ae
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class CtrlConst
|
||||
{
|
||||
@@ -7,6 +7,7 @@ namespace FlowerPower
|
||||
public const string FXWndCtrl = "FXWndCtrl";
|
||||
public const string JoastCtrl = "JoastCtrl";
|
||||
public const string MenuCtrl = "MenuCtrl";
|
||||
public const string LanguageViewCtrl = "LanguageViewCtrl";
|
||||
public const string NetLoadingCtrl = "NetLoadingCtrl";
|
||||
public const string LoadingCtrl = "LoadingCtrl";
|
||||
public const string OpenBgCtrl = "OpenBgCtrl";
|
||||
@@ -19,7 +20,6 @@ namespace FlowerPower
|
||||
public const string BuyPropCtrl = "BuyPropCtrl";
|
||||
public const string ChoosePropCtrl = "ChoosePropCtrl";
|
||||
public const string AddViewCtrl = "AddViewCtrl";
|
||||
public const string AddViewoffCtrl = "AddViewoffCtrl";
|
||||
public const string OpenGameCtrl = "OpenGameCtrl";
|
||||
public const string NewTaskCtrl = "NewTaskCtrl";
|
||||
public const string GetTaskRewardCtrl = "GetTaskRewardCtrl";
|
||||
@@ -46,22 +46,34 @@ namespace FlowerPower
|
||||
public const string GuideViewCtrl = "GuideViewCtrl";
|
||||
public const string TipsViewCtrl = "TipsViewCtrl";
|
||||
public const string ResurgenceCtrl = "ResurgenceCtrl";
|
||||
public const string SaveingPotCtrl = "SaveingPotCtrl";
|
||||
public const string BroadcastCtrl = "BroadcastCtrl";
|
||||
public const string LuckyPackCtrl = "LuckyPackCtrl";
|
||||
public const string RecordViewCtrl = "RecordViewCtrl";
|
||||
public const string ThreeDaysGiftCtrl = "ThreeDaysGiftCtrl";
|
||||
public const string RewardMulNewCtrl = "RewardMulNewCtrl";
|
||||
public const string BuyConfirmCtrl = "BuyConfirmCtrl";
|
||||
public const string TuJianViewCtrl = "TuJianViewCtrl";
|
||||
public const string FAQCtrl = "FAQCtrl";
|
||||
public const string RankCtrl = "RankCtrl";
|
||||
public const string RankRewardCtrl = "RankRewardCtrl";
|
||||
public const string RankRuleCtrl = "RankRuleCtrl";
|
||||
public const string AddviewnewCtrl = "AddviewnewCtrl";
|
||||
public const string NewEndCtrl = "NewEndCtrl";
|
||||
|
||||
public const string UnlockLevelCtrl = "UnlockLevelCtrl";
|
||||
public const string AlubumCtrl = "AlubumCtrl";
|
||||
public const string AlbumDetailCtrl = "AlbumDetailCtrl";
|
||||
public const string LiveCtrl = "LiveCtrl";
|
||||
public const string LiveDetailCtrl = "LiveDetailCtrl";
|
||||
public const string SecretAlbumsCtrl = "SecretAlbumsCtrl";
|
||||
public const string SecretGiftViewCtrl = "SecretGiftViewCtrl";
|
||||
public const string SecretUnlockCtrl = "SecretUnlockCtrl";
|
||||
public const string SecretAlbumsNextCtrl = "SecretAlbumsNextCtrl";
|
||||
public const string SecretDetailCtrl = "SecretDetailCtrl";
|
||||
public const string VipClubViewCtrl = "VipClubViewCtrl";
|
||||
public const string LiveUnlockCtrl = "LiveUnlockCtrl";
|
||||
public const string SubUnlockCtrl = "SubUnlockCtrl";
|
||||
public const string ScAlbumLockCtrl = "ScAlbumLockCtrl";
|
||||
public const string UnlockTipsCtrl = "UnlockTipsCtrl";
|
||||
public const string NetworkErrorTipsCtrl = "NetworkErrorTipsCtrl";
|
||||
public const string GoldRewardCtrl = "GoldRewardCtrl";
|
||||
public const string LoginloadingCtrl = "LoginloadingCtrl";
|
||||
public const string PettyAwardCtrl = "PettyAwardCtrl";
|
||||
public const string SuperSpeedViewCtrl = "SuperSpeedViewCtrl";
|
||||
|
||||
public const string ChatChooseCtrl = "ChatChooseCtrl";
|
||||
public const string ChatCtrl = "ChatCtrl";
|
||||
public const string ChatNumberCtrl = "ChatNumberCtrl";
|
||||
public const string ChatUnlockCtrl = "ChatUnlockCtrl";
|
||||
public const string UnlockLevelNewCtrl = "UnlockLevelNewCtrl";
|
||||
public const string BroadcastCtrl = "BroadcastCtrl";
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class ModelConst
|
||||
{
|
||||
@@ -12,6 +12,7 @@ namespace FlowerPower
|
||||
public const string OpenBgModel = "OpenBgModel";
|
||||
public const string NetLoadingModel = "NetLoadingModel";
|
||||
public const string MenuModel = "MenuModel";
|
||||
public const string LanguageViewModel = "LanguageModel";
|
||||
public const string RainPlayModel = "RainPlayModel";
|
||||
public const string CoinWnd_newModel = "CoinWnd_newModel";
|
||||
public const string RewardModel = "RewardModel";
|
||||
@@ -19,7 +20,6 @@ namespace FlowerPower
|
||||
public const string BuyPropModel = "BuyPropModel";
|
||||
public const string GameResultModel = "GameResultModel";
|
||||
public const string AddViewModel = "AddViewModel";
|
||||
public const string AddViewoffModel = "AddViewoffModel";
|
||||
public const string OpenGameModel = "OpenGameModel";
|
||||
public const string NewTaskModel = "NewTaskModel";
|
||||
public const string GetTaskRewardModel = "GetTaskRewardModel";
|
||||
@@ -45,21 +45,33 @@ namespace FlowerPower
|
||||
public const string GuideViewModel = "GuideViewModel";
|
||||
public const string TipsViewModel = "TipsViewModel";
|
||||
public const string ResurgenceModel = "ResurgenceModel";
|
||||
public const string SaveingPotModel = "SaveingPotModel";
|
||||
public const string BroadcastModel = "BroadcastModel";
|
||||
public const string LuckyPackModel = "LuckyPackModel";
|
||||
public const string RecordViewModel = "RecordViewModel";
|
||||
public const string ThreeDaysGiftModel = "ThreeDaysGiftModel";
|
||||
public const string RewardMulNewModel = "RewardMulNewModel";
|
||||
public const string BuyConfirmModel = "BuyConfirmModel";
|
||||
public const string TuJianViewModel = "TuJianViewModel";
|
||||
public const string FAQModel = "FAQModel";
|
||||
public const string RankModel = "RankModel";
|
||||
public const string RankRewardModel = "RankRewardModel";
|
||||
public const string RankRuleModel = "RankRuleModel";
|
||||
public const string AddviewnewModel = "AddviewnewModel";
|
||||
public const string NewEndModel = "NewEndModel";
|
||||
public const string UnlockLevelModel = "UnlockLevelModel";
|
||||
public const string AlubumModel = "AlubumModel";
|
||||
public const string AlbumDetailModel = "AlbumDetailModel";
|
||||
public const string SecretAlbumsModel = "SecretAlbumsModel";
|
||||
public const string SecretGiftViewModel = "SecretGiftViewModel";
|
||||
public const string SecretUnlockModel = "SecretUnlockModel";
|
||||
public const string SecretAlbumsNextModel = "SecretAlbumsNextModel";
|
||||
public const string SecretDetailModel = "SecretDetailModel";
|
||||
public const string LiveModel = "LiveModel";
|
||||
public const string LiveDetailModel = "LiveDetailModel";
|
||||
public const string VipClubViewModel = "VipClubViewModel";
|
||||
public const string LiveUnlockModel = "LiveUnlockModel";
|
||||
public const string SubUnlockModel = "SubUnlockModel";
|
||||
public const string ScAlbumLockModel = "ScAlbumLockModel";
|
||||
public const string UnlockTipsModel = "UnlockTipsModel";
|
||||
public const string NetworkErrorTipsModel = "NetworkErrorTipsModel";
|
||||
public const string GoldRewardModel = "GoldRewardModel";
|
||||
public const string LoginloadingModel = "LoginloadingModel";
|
||||
public const string PettyAwardModel = "PettyAwardModel";
|
||||
public const string SuperSpeedViewModel = "SuperSpeedViewModel";
|
||||
public const string ChatChooseModel = "ChatChooseModel";
|
||||
public const string ChatModel = "ChatModel";
|
||||
public const string ChatNumberModel = "ChatNumberModel";
|
||||
public const string ChatUnlockModel = "ChatUnlockModel";
|
||||
public const string UnlockLevelNewModel = "UnlockLevelNewModel";
|
||||
public const string BroadcastModel = "BroadcastModel";
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,16 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class ModuleManagerRegister
|
||||
{
|
||||
public static void AutoRegisterModel()
|
||||
{
|
||||
ModuleManager moduleManager = ModuleManager.Instance;
|
||||
moduleManager.AddModel(ModelConst.LoginModel, new LoginModel());
|
||||
moduleManager.AddModel(ModelConst.RewardAniModel, new RewardAniModel());
|
||||
moduleManager.AddModel(ModelConst.GameLoginModel, new GameLoginModel());
|
||||
moduleManager.AddModel(ModelConst.JoastModel, new JoastModel());
|
||||
moduleManager.AddModel(ModelConst.LoadingModel, new LoadingModel());
|
||||
moduleManager.AddModel(ModelConst.MenuModel, new MenuModel());
|
||||
moduleManager.AddModel(ModelConst.LanguageViewModel, new LanguageViewModel());
|
||||
moduleManager.AddModel(ModelConst.NetLoadingModel, new NetLoadingModel());
|
||||
moduleManager.AddModel(ModelConst.OpenBgModel, new OpenBgModel());
|
||||
moduleManager.AddModel(ModelConst.PrivacyModel, new PrivacyModel());
|
||||
@@ -20,8 +20,9 @@ namespace FlowerPower
|
||||
moduleManager.AddModel(ModelConst.BuyPropModel, new BuyPropModel());
|
||||
moduleManager.AddModel(ModelConst.GameResultModel, new GameResultModel());
|
||||
moduleManager.AddModel(ModelConst.AddViewModel, new AddViewModel());
|
||||
moduleManager.AddModel(ModelConst.AddViewoffModel, new AddViewoffModel());
|
||||
moduleManager.AddModel(ModelConst.OpenGameModel, new OpenGameModel());
|
||||
moduleManager.AddModel(ModelConst.NewTaskModel, new NewTaskModel());
|
||||
moduleManager.AddModel(ModelConst.GetTaskRewardModel, new GetTaskRewardModel());
|
||||
moduleManager.AddModel(ModelConst.RewardboxModel, new RewardboxModel());
|
||||
moduleManager.AddModel(ModelConst.PayloadingModel, new PayloadingModel());
|
||||
moduleManager.AddModel(ModelConst.FirstRewardModel, new FirstRewardModel());
|
||||
@@ -31,33 +32,40 @@ namespace FlowerPower
|
||||
moduleManager.AddModel(ModelConst.WheelViewModel, new WheelViewModel());
|
||||
moduleManager.AddModel(ModelConst.PassViewModel, new PassViewModel());
|
||||
moduleManager.AddModel(ModelConst.PassunlockModel, new PassunlockModel());
|
||||
moduleManager.AddModel(ModelConst.PackrewardModel, new PackrewardModel());
|
||||
moduleManager.AddModel(ModelConst.BuygoldModel, new BuygoldModel());
|
||||
moduleManager.AddModel(ModelConst.GameMenuModel, new GameMenuModel());
|
||||
moduleManager.AddModel(ModelConst.MakeupConfirmModel, new MakeupConfirmModel());
|
||||
moduleManager.AddModel(ModelConst.AdcomingModel, new AdcomingModel());
|
||||
moduleManager.AddModel(ModelConst.MainTabModel, new MainTabModel());
|
||||
moduleManager.AddModel(ModelConst.MailViewModel, new MailViewModel());
|
||||
moduleManager.AddModel(ModelConst.PersonViewModel, new PersonViewModel());
|
||||
moduleManager.AddModel(ModelConst.GuideViewModel, new GuideViewModel());
|
||||
moduleManager.AddModel(ModelConst.TipsViewModel, new TipsViewModel());
|
||||
moduleManager.AddModel(ModelConst.ResurgenceModel, new ResurgenceModel());
|
||||
moduleManager.AddModel(ModelConst.SaveingPotModel, new SaveingPotModel());
|
||||
moduleManager.AddModel(ModelConst.BroadcastModel, new BroadcastModel());
|
||||
moduleManager.AddModel(ModelConst.RecordViewModel, new RecordViewModel());
|
||||
moduleManager.AddModel(ModelConst.ThreeDaysGiftModel, new ThreeDaysGiftModel());
|
||||
moduleManager.AddModel(ModelConst.RewardMulNewModel, new RewardMulNewModel());
|
||||
moduleManager.AddModel(ModelConst.TuJianViewModel, new TuJianViewModel());
|
||||
moduleManager.AddModel(ModelConst.FAQModel, new FAQModel());
|
||||
moduleManager.AddModel(ModelConst.RankModel, new RankModel());
|
||||
moduleManager.AddModel(ModelConst.RankRewardModel, new RankRewardModel());
|
||||
moduleManager.AddModel(ModelConst.RankRuleModel, new RankRuleModel());
|
||||
moduleManager.AddModel(ModelConst.AddviewnewModel, new AddviewnewModel());
|
||||
moduleManager.AddModel(ModelConst.LuckyPackModel, new LuckyPackModel());
|
||||
moduleManager.AddModel(ModelConst.NewEndModel, new NewEndModel());
|
||||
moduleManager.AddModel(ModelConst.UnlockLevelModel, new UnlockLevelModel());
|
||||
moduleManager.AddModel(ModelConst.AlubumModel, new AlubumModel());
|
||||
moduleManager.AddModel(ModelConst.AlbumDetailModel, new AlbumDetailModel());
|
||||
moduleManager.AddModel(ModelConst.LiveModel, new LiveModel());
|
||||
moduleManager.AddModel(ModelConst.LiveDetailModel, new LiveDetailModel());
|
||||
moduleManager.AddModel(ModelConst.SecretAlbumsModel, new SecretAlbumsModel());
|
||||
moduleManager.AddModel(ModelConst.SecretUnlockModel, new SecretUnlockModel());
|
||||
moduleManager.AddModel(ModelConst.SecretAlbumsNextModel, new SecretAlbumsNextModel());
|
||||
moduleManager.AddModel(ModelConst.SecretDetailModel, new SecretDetailModel());
|
||||
moduleManager.AddModel(ModelConst.VipClubViewModel, new VipClubViewModel());
|
||||
moduleManager.AddModel(ModelConst.LiveUnlockModel, new LiveUnlockModel());
|
||||
moduleManager.AddModel(ModelConst.SubUnlockModel, new SubUnlockModel());
|
||||
moduleManager.AddModel(ModelConst.ScAlbumLockModel, new ScAlbumLockModel());
|
||||
moduleManager.AddModel(ModelConst.UnlockTipsModel, new UnlockTipsModel());
|
||||
moduleManager.AddModel(ModelConst.NetworkErrorTipsModel, new NetworkErrorTipsModel());
|
||||
moduleManager.AddModel(ModelConst.GoldRewardModel, new GoldRewardModel());
|
||||
moduleManager.AddModel(ModelConst.BuyConfirmModel, new BuyConfirmModel());
|
||||
moduleManager.AddModel(ModelConst.LoginloadingModel, new LoginloadingModel());
|
||||
moduleManager.AddModel(ModelConst.PettyAwardModel, new PettyAwardModel());
|
||||
moduleManager.AddModel(ModelConst.SuperSpeedViewModel, new SuperSpeedViewModel());
|
||||
moduleManager.AddModel(ModelConst.ChatChooseModel, new ChatChooseModel());
|
||||
moduleManager.AddModel(ModelConst.ChatModel, new ChatModel());
|
||||
moduleManager.AddModel(ModelConst.ChatNumberModel, new ChatNumberModel());
|
||||
moduleManager.AddModel(ModelConst.ChatUnlockModel, new ChatUnlockModel());
|
||||
moduleManager.AddModel(ModelConst.UnlockLevelNewModel, new UnlockLevelNewModel());
|
||||
moduleManager.AddModel(ModelConst.BroadcastModel, new BroadcastModel());
|
||||
}
|
||||
public static void AutoRegisterUICtrl()
|
||||
{
|
||||
@@ -68,6 +76,7 @@ namespace FlowerPower
|
||||
moduleManager.AddUICtrl(UICtrlConst.LoadingUICtrl, new LoadingUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.AdcomingUICtrl, new AdcomingUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.MenuUICtrl, new MenuUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.LanguageViewUICtrl, new LanguageViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.NetLoadingUICtrl, new NetLoadingUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.OpenBgUICtrl, new OpenBgUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.PrivacyUICtrl, new PrivacyUICtrl());
|
||||
@@ -77,8 +86,9 @@ namespace FlowerPower
|
||||
moduleManager.AddUICtrl(UICtrlConst.BuyPropUICtrl, new BuyPropUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.GameResultUICtrl, new GameResultUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.AddViewUICtrl, new AddViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.AddViewoffUICtrl, new AddViewoffUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.OpenGameUICtrl, new OpenGameUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.NewTaskUICtrl, new NewTaskUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.GetTaskRewardUICtrl, new GetTaskRewardUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.RewardboxUICtrl, new RewardboxUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.PayloadingUICtrl, new PayloadingUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.FirstRewardUICtrl, new FirstRewardUICtrl());
|
||||
@@ -88,33 +98,40 @@ namespace FlowerPower
|
||||
moduleManager.AddUICtrl(UICtrlConst.WheelViewUICtrl, new WheelViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.PassViewUICtrl, new PassViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.PassunlockUICtrl, new PassunlockUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.PackrewardUICtrl, new PackrewardUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.BuygoldUICtrl, new BuygoldUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.GameMenuUICtrl, new GameMenuUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.MakeupConfirmUICtrl, new MakeupConfirmUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.MainTabUICtrl, new MainTabUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.MailViewUICtrl, new MailViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.PersonViewUICtrl, new PersonViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.GuideViewUICtrl, new GuideViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.TipsViewUICtrl, new TipsViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.ResurgenceUICtrl, new ResurgenceUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.SaveingPotUICtrl, new SaveingPotUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.BroadcastUICtrl, new BroadcastUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.SecretAlbumsUICtrl, new SecretAlbumsUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.SecretUnlockUICtrl, new SecretUnlockUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.SecretAlbumsNextUICtrl, new SecretAlbumsNextUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.SecretDetailUICtrl, new SecretDetailUICtrl());
|
||||
|
||||
moduleManager.AddUICtrl(UICtrlConst.RecordViewUICtrl, new RecordViewUICtrl());
|
||||
moduleManager.AddUIType(UIConst.ThreeDaysGiftUI, typeof(ThreeDaysGiftUI));
|
||||
moduleManager.AddUIType(UIConst.RewardMulNewUI, typeof(RewardMulNewUI));
|
||||
moduleManager.AddUICtrl(UICtrlConst.TuJianViewUICtrl, new TuJianViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.FAQUICtrl, new FAQUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.RankUICtrl, new RankUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.RankRewardUICtrl, new RankRewardUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.RankRuleUICtrl, new RankRuleUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.AddviewnewUICtrl, new AddviewnewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.ThreeDaysGiftUICtrl, new ThreeDaysGiftUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.RewardMulNewUICtrl, new RewardMulNewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.LuckyPackUICtrl, new LuckyPackUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.NewEndUICtrl, new NewEndUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.UnlockLevelUICtrl, new UnlockLevelUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.AlubumUICtrl, new AlubumUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.AlbumDetailUICtrl, new AlbumDetailUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.LiveUICtrl, new LiveUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.LiveDetailUICtrl, new LiveDetailUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.VipClubViewUICtrl, new VipClubViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.LiveUnlockUICtrl, new LiveUnlockUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.SubUnlockUICtrl, new SubUnlockUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.ScAlbumLockUICtrl, new ScAlbumLockUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.UnlockTipsUICtrl, new UnlockTipsUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.NetworkErrorTipsUICtrl, new NetworkErrorTipsUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.GoldRewardUICtrl, new GoldRewardUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.BuyConfirmUICtrl, new BuyConfirmUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.LoginloadingUICtrl, new LoginloadingUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.PettyAwardUICtrl, new PettyAwardUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.SuperSpeedViewUICtrl, new SuperSpeedViewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.ChatChooseUICtrl, new ChatChooseUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.ChatUICtrl, new ChatUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.ChatNumberUICtrl, new ChatNumberUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.ChatUnlockUICtrl, new ChatUnlockUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.UnlockLevelNewUICtrl, new UnlockLevelNewUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.BroadcastUICtrl, new BroadcastUICtrl());
|
||||
}
|
||||
|
||||
public static void AutoRegisterCtrl()
|
||||
@@ -125,6 +142,7 @@ namespace FlowerPower
|
||||
moduleManager.AddCtrl(CtrlConst.JoastCtrl, new JoastCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.LoadingCtrl, new LoadingCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.MenuCtrl, new MenuCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.LanguageViewCtrl, new LanguageViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.AdcomingCtrl, new AdcomingCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.NetLoadingCtrl, new NetLoadingCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.OpenBgCtrl, new OpenBgCtrl());
|
||||
@@ -136,8 +154,9 @@ namespace FlowerPower
|
||||
moduleManager.AddCtrl(CtrlConst.BuyPropCtrl, new BuyPropCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.GameResultCtrl, new GameResultCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.AddViewCtrl, new AddViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.AddViewoffCtrl, new AddViewoffCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.OpenGameCtrl, new OpenGameCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.NewTaskCtrl, new NewTaskCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.GetTaskRewardCtrl, new GetTaskRewardCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.RewardboxCtrl, new RewardboxCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.SignInViewCtrl, new SignInViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.PayloadingCtrl, new PayloadingCtrl());
|
||||
@@ -147,33 +166,45 @@ namespace FlowerPower
|
||||
moduleManager.AddCtrl(CtrlConst.WheelViewCtrl, new WheelViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.PassViewCtrl, new PassViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.PassunlockCtrl, new PassunlockCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.PackrewardCtrl, new PackrewardCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.BuygoldCtrl, new BuygoldCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.GameMenuCtrl, new GameMenuCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.MakeupConfirmCtrl, new MakeupConfirmCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.MainTabCtrl, new MainTabCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.MailViewCtrl, new MailViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.PersonViewCtrl, new PersonViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.GuideViewCtrl, new GuideViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.TipsViewCtrl, new TipsViewCtrl());
|
||||
|
||||
moduleManager.AddCtrl(CtrlConst.ResurgenceCtrl, new ResurgenceCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.SaveingPotCtrl, new SaveingPotCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.BroadcastCtrl, new BroadcastCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.RecordViewCtrl, new RecordViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.ThreeDaysGiftCtrl, new ThreeDaysGiftCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.RewardMulNewCtrl, new RewardMulNewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.TuJianViewCtrl, new TuJianViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.FAQCtrl, new FAQCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.RankCtrl, new RankCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.RankRewardCtrl, new RankRewardCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.RankRuleCtrl, new RankRuleCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.AddviewnewCtrl, new AddviewnewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.LuckyPackCtrl, new LuckyPackCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.NewEndCtrl, new NewEndCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.UnlockLevelCtrl, new UnlockLevelCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.AlubumCtrl, new AlubumCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.AlbumDetailCtrl, new AlbumDetailCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.NewEndCtrl, new NewEndCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.UnlockLevelCtrl, new UnlockLevelCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.SecretAlbumsCtrl, new SecretAlbumsCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.SecretUnlockCtrl, new SecretUnlockCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.SecretAlbumsNextCtrl, new SecretAlbumsNextCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.SecretDetailCtrl, new SecretDetailCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.NewEndCtrl, new NewEndCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.UnlockLevelCtrl, new UnlockLevelCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.AlubumCtrl, new AlubumCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.AlbumDetailCtrl, new AlbumDetailCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.LiveCtrl, new LiveCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.LiveDetailCtrl, new LiveDetailCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.VipClubViewCtrl, new VipClubViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.LiveUnlockCtrl, new LiveUnlockCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.SubUnlockCtrl, new SubUnlockCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.ScAlbumLockCtrl, new ScAlbumLockCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.UnlockTipsCtrl, new UnlockTipsCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.NetworkErrorTipsCtrl, new NetworkErrorTipsCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.GoldRewardCtrl, new GoldRewardCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.BuyConfirmCtrl, new BuyConfirmCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.LoginloadingCtrl, new LoginloadingCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.PettyAwardCtrl, new PettyAwardCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.SuperSpeedViewCtrl, new SuperSpeedViewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.ChatChooseCtrl, new ChatChooseCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.ChatCtrl, new ChatCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.ChatNumberCtrl, new ChatNumberCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.ChatUnlockCtrl, new ChatUnlockCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.UnlockLevelNewCtrl, new UnlockLevelNewCtrl());
|
||||
moduleManager.AddCtrl(CtrlConst.BroadcastCtrl, new BroadcastCtrl());
|
||||
}
|
||||
|
||||
public static void AutoRegisterUIType()
|
||||
@@ -186,6 +217,7 @@ namespace FlowerPower
|
||||
moduleManager.AddUIType(UIConst.LoadingUI, typeof(LoadingUI));
|
||||
// moduleManager.AddUIType(UIConst.MaskUI, typeof(MaskUI));
|
||||
moduleManager.AddUIType(UIConst.MenuUI, typeof(MenuUI));
|
||||
moduleManager.AddUIType(UIConst.LanguageViewUI, typeof(LanguageViewUI));
|
||||
moduleManager.AddUIType(UIConst.NetLoadingUI, typeof(NetLoadingUI));
|
||||
moduleManager.AddUIType(UIConst.OpenBgUI, typeof(OpenBgUI));
|
||||
moduleManager.AddUIType(UIConst.PrivacyUI, typeof(PrivacyUI));
|
||||
@@ -196,8 +228,9 @@ namespace FlowerPower
|
||||
moduleManager.AddUIType(UIConst.AdcomingUI, typeof(AdcomingUI));
|
||||
moduleManager.AddUIType(UIConst.GameResultUI, typeof(GameResultUI));
|
||||
moduleManager.AddUIType(UIConst.AddViewUI, typeof(AddViewUI));
|
||||
moduleManager.AddUIType(UIConst.AddViewoffUI, typeof(AddViewoffUI));
|
||||
moduleManager.AddUIType(UIConst.OpenGameUI, typeof(OpenGameUI));
|
||||
moduleManager.AddUIType(UIConst.NewTaskUI, typeof(NewTaskUI));
|
||||
moduleManager.AddUIType(UIConst.GetTaskRewardUI, typeof(GetTaskRewardUI));
|
||||
moduleManager.AddUIType(UIConst.RewardboxUI, typeof(RewardboxUI));
|
||||
moduleManager.AddUIType(UIConst.PayloadingUI, typeof(PayloadingUI));
|
||||
moduleManager.AddUIType(UIConst.FirstRewardUI, typeof(FirstRewardUI));
|
||||
@@ -206,32 +239,42 @@ namespace FlowerPower
|
||||
moduleManager.AddUIType(UIConst.WheelViewUI, typeof(WheelViewUI));
|
||||
moduleManager.AddUIType(UIConst.PassViewUI, typeof(PassViewUI));
|
||||
moduleManager.AddUIType(UIConst.PassunlockUI, typeof(PassunlockUI));
|
||||
moduleManager.AddUIType(UIConst.PackrewardUI, typeof(PackrewardUI));
|
||||
moduleManager.AddUIType(UIConst.BuygoldUI, typeof(BuygoldUI));
|
||||
moduleManager.AddUIType(UIConst.GameMenuUI, typeof(GameMenuUI));
|
||||
moduleManager.AddUIType(UIConst.MakeupConfirmUI, typeof(MakeupConfirmUI));
|
||||
moduleManager.AddUIType(UIConst.MainTabUI, typeof(MainTabUI));
|
||||
moduleManager.AddUIType(UIConst.MailViewUI, typeof(MailViewUI));
|
||||
moduleManager.AddUIType(UIConst.PersonViewUI, typeof(PersonViewUI));
|
||||
moduleManager.AddUIType(UIConst.GuideViewUI, typeof(GuideViewUI));
|
||||
moduleManager.AddUIType(UIConst.TipsViewUI, typeof(TipsViewUI));
|
||||
moduleManager.AddUIType(UIConst.ResurgenceUI, typeof(ResurgenceUI));
|
||||
moduleManager.AddUIType(UIConst.SaveingPotUI, typeof(SaveingPotUI));
|
||||
moduleManager.AddUIType(UIConst.BroadcastUI, typeof(BroadcastUI));
|
||||
moduleManager.AddUIType(UIConst.RecordViewUI, typeof(RecordViewUI));
|
||||
moduleManager.AddUICtrl(UICtrlConst.ThreeDaysGiftUICtrl, new ThreeDaysGiftUICtrl());
|
||||
moduleManager.AddUICtrl(UICtrlConst.RewardMulNewUICtrl, new RewardMulNewUICtrl());
|
||||
moduleManager.AddUIType(UIConst.TuJianViewUI, typeof(TuJianViewUI));
|
||||
moduleManager.AddUIType(UIConst.FAQUI, typeof(FAQUI));
|
||||
moduleManager.AddUIType(UIConst.RankUI, typeof(RankUI));
|
||||
moduleManager.AddUIType(UIConst.RankRewardUI, typeof(RankRewardUI));
|
||||
moduleManager.AddUIType(UIConst.RankRuleUI, typeof(RankRuleUI));
|
||||
moduleManager.AddUIType(UIConst.AddviewnewUI, typeof(AddviewnewUI));
|
||||
moduleManager.AddUIType(UIConst.ThreeDaysGiftUI, typeof(ThreeDaysGiftUI));
|
||||
moduleManager.AddUIType(UIConst.RewardMulNewUI, typeof(RewardMulNewUI));
|
||||
moduleManager.AddUIType(UIConst.LuckyPackUI, typeof(LuckyPackUI));
|
||||
moduleManager.AddUIType(UIConst.SecretAlbumsUI, typeof(SecretAlbumsUI));
|
||||
moduleManager.AddUIType(UIConst.SecretUnlockUI, typeof(SecretUnlockUI));
|
||||
moduleManager.AddUIType(UIConst.SecretAlbumsNextUI, typeof(SecretAlbumsNextUI));
|
||||
moduleManager.AddUIType(UIConst.SecretDetailUI, typeof(SecretDetailUI));
|
||||
|
||||
moduleManager.AddUIType(UIConst.NewEndUI, typeof(NewEndUI));
|
||||
moduleManager.AddUIType(UIConst.UnlockLevelUI, typeof(UnlockLevelUI));
|
||||
moduleManager.AddUIType(UIConst.AlubumUI, typeof(AlubumUI));
|
||||
moduleManager.AddUIType(UIConst.AlbumDetailUI, typeof(AlbumDetailUI));
|
||||
moduleManager.AddUIType(UIConst.LiveUI, typeof(LiveUI));
|
||||
moduleManager.AddUIType(UIConst.LiveDetailUI, typeof(LiveDetailUI));
|
||||
|
||||
moduleManager.AddUIType(UIConst.VipClubViewUI, typeof(VipClubViewUI));
|
||||
|
||||
moduleManager.AddUIType(UIConst.LiveUnlockUI, typeof(LiveUnlockUI));
|
||||
moduleManager.AddUIType(UIConst.SubUnlockUI, typeof(SubUnlockUI));
|
||||
moduleManager.AddUIType(UIConst.ScAlbumLockUI, typeof(ScAlbumLockUI));
|
||||
moduleManager.AddUIType(UIConst.UnlockTipsUI, typeof(UnlockTipsUI));
|
||||
moduleManager.AddUIType(UIConst.NetworkErrorTipsUI, typeof(NetworkErrorTipsUI));
|
||||
moduleManager.AddUIType(UIConst.GoldRewardUI, typeof(GoldRewardUI));
|
||||
moduleManager.AddUIType(UIConst.BuyConfirmUI, typeof(BuyConfirmUI));
|
||||
moduleManager.AddUIType(UIConst.LoginloadingUI, typeof(LoginloadingUI));
|
||||
moduleManager.AddUIType(UIConst.PettyAwardUI, typeof(PettyAwardUI));
|
||||
moduleManager.AddUIType(UIConst.SuperSpeedViewUI, typeof(SuperSpeedViewUI));
|
||||
moduleManager.AddUIType(UIConst.ChatChooseUI, typeof(ChatChooseUI));
|
||||
moduleManager.AddUIType(UIConst.ChatUI, typeof(ChatUI));
|
||||
moduleManager.AddUIType(UIConst.ChatNumberUI, typeof(ChatNumberUI));
|
||||
moduleManager.AddUIType(UIConst.ChatUnlockUI, typeof(ChatUnlockUI));
|
||||
moduleManager.AddUIType(UIConst.UnlockLevelNewUI, typeof(UnlockLevelNewUI));
|
||||
moduleManager.AddUIType(UIConst.BroadcastUI, typeof(BroadcastUI));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace FlowerPower
|
||||
namespace LoveLegend
|
||||
{
|
||||
public static class UIConst
|
||||
{
|
||||
@@ -6,6 +6,7 @@ namespace FlowerPower
|
||||
public const string RewardAniUI = "RewardAniUI";
|
||||
public const string JoastUI = "JoastUI";
|
||||
public const string MenuUI = "MenuUI";
|
||||
public const string LanguageViewUI = "LanguageViewUI";
|
||||
public const string LoadingUI = "LoadingUI";
|
||||
public const string NetLoadingUI = "NetLoadingUI";
|
||||
public const string CoinWnd_newUI = "CoinWnd_newUI";
|
||||
@@ -18,7 +19,6 @@ namespace FlowerPower
|
||||
public const string RainPlayUI = "RainPlayUI";
|
||||
public const string GameResultUI = "GameResultUI";
|
||||
public const string AddViewUI = "AddViewUI";
|
||||
public const string AddViewoffUI = "AddViewoffUI";
|
||||
public const string BuyPropUI = "BuyPropUI";
|
||||
public const string OpenGameUI = "OpenGameUI";
|
||||
public const string NewTaskUI = "NewTaskUI";
|
||||
@@ -44,21 +44,33 @@ namespace FlowerPower
|
||||
public const string GuideViewUI = "GuideViewUI";
|
||||
public const string TipsViewUI = "TipsViewUI";
|
||||
public const string ResurgenceUI = "ResurgenceUI";
|
||||
public const string SaveingPotUI = "SaveingPotUI";
|
||||
public const string BroadcastUI = "BroadcastUI";
|
||||
public const string LuckyPackUI = "LuckyPackUI";
|
||||
public const string RecordViewUI = "RecordViewUI";
|
||||
public const string ThreeDaysGiftUI = "ThreeDaysGiftUI";
|
||||
public const string RewardMulNewUI = "RewardMulNewUI";
|
||||
public const string BuyConfirmUI = "BuyConfirmUI";
|
||||
public const string TuJianViewUI = "TuJianViewUI";
|
||||
public const string FAQUI = "FAQUI";
|
||||
public const string RankUI = "RankUI";
|
||||
public const string RankRewardUI = "RankRewardUI";
|
||||
public const string RankRuleUI = "RankRuleUI";
|
||||
public const string AddviewnewUI = "AddviewnewUI";
|
||||
public const string NewEndUI = "NewEndUI";
|
||||
public const string UnlockLevelUI = "UnlockLevelUI";
|
||||
public const string AlubumUI = "AlubumUI";
|
||||
public const string AlbumDetailUI = "AlbumDetailUI";
|
||||
public const string LiveUI = "LiveUI";
|
||||
public const string LiveDetailUI = "LiveDetailUI";
|
||||
public const string SecretAlbumsUI = "SecretAlbumsUI";
|
||||
public const string SecretGiftViewUI = "SecretGiftViewUI";
|
||||
public const string SecretUnlockUI = "SecretUnlockUI";
|
||||
public const string SecretAlbumsNextUI = "SecretAlbumsNextUI";
|
||||
public const string SecretDetailUI = "SecretDetailUI";
|
||||
public const string VipClubViewUI = "VipClubViewUI";
|
||||
public const string LiveUnlockUI = "LiveUnlockUI";
|
||||
public const string SubUnlockUI = "SubUnlockUI";
|
||||
public const string ScAlbumLockUI = "ScAlbumLockUI";
|
||||
public const string UnlockTipsUI = "UnlockTipsUI";
|
||||
public const string NetworkErrorTipsUI = "NetworkErrorTipsUI";
|
||||
public const string GoldRewardUI = "GoldRewardUI";
|
||||
public const string LoginloadingUI = "LoginloadingUI";
|
||||
public const string PettyAwardUI = "PettyAwardUI";
|
||||
public const string SuperSpeedViewUI = "SuperSpeedViewUI";
|
||||
public const string ChatChooseUI = "ChatChooseUI";
|
||||
public const string ChatUI = "ChatUI";
|
||||
public const string ChatNumberUI = "ChatNumberUI";
|
||||
public const string ChatUnlockUI = "ChatUnlockUI";
|
||||
public const string UnlockLevelNewUI = "UnlockLevelNewUI";
|
||||
public const string BroadcastUI = "BroadcastUI";
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user