fix:1、修复bug。 2、1.0.8版本提审
@@ -1,15 +0,0 @@
|
|||||||
<linker>
|
|
||||||
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
|
|
||||||
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
|
|
||||||
</assembly>
|
|
||||||
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
|
|
||||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
|
|
||||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
|
|
||||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
|
|
||||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.LegacyResourcesProvider" preserve="all" />
|
|
||||||
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
|
|
||||||
</assembly>
|
|
||||||
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
|
|
||||||
<type fullname="UnityEngine.TextAsset" preserve="all" />
|
|
||||||
</assembly>
|
|
||||||
</linker>
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: b10c0e7d9a6ff7744bddfca54513995e
|
guid: 6323111b679d2804096d3c79f5f68fc2
|
||||||
TextScriptImporter:
|
TextScriptImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
@@ -1,71 +1,72 @@
|
|||||||
using SGModule.ConfigLoader;
|
using SGModule.ConfigLoader;
|
||||||
|
|
||||||
namespace IgnoreOPS
|
namespace IgnoreOPS
|
||||||
{
|
{
|
||||||
[ConfigKey("Common", false)]
|
[ConfigKey("Common", false)]
|
||||||
public class CommonModel
|
public class CommonModel
|
||||||
{
|
{
|
||||||
public int InitialNum;
|
public int InitialNum;
|
||||||
public int[] inlineLoginDown;
|
public int[] inlineLoginDown;
|
||||||
public int inlineMin;
|
public int inlineMin;
|
||||||
public int Purchaseprops;
|
public int Purchaseprops;
|
||||||
public int rewardrate;
|
public int rewardrate;
|
||||||
public int RevivalCoins;
|
public int RevivalCoins;
|
||||||
public int[] wheelTimes;
|
public int[] wheelTimes;
|
||||||
public float Passportgift;
|
public float Passportgift;
|
||||||
public float Passportgift2;
|
public float Passportgift2;
|
||||||
public int addspace;
|
public int addspace;
|
||||||
public float addspace2;
|
public float addspace2;
|
||||||
public int AddDiscount;
|
public int AddDiscount;
|
||||||
public float AddDiscount2;
|
public float AddDiscount2;
|
||||||
public int playtimes;
|
public int playtimes;
|
||||||
public int interstitialtype;
|
public int interstitialtype;
|
||||||
public int lobbyrewrdtime;
|
public int lobbyrewrdtime;
|
||||||
public int roomrewardrate;
|
public int roomrewardrate;
|
||||||
public int Activetimes;
|
public int Activetimes;
|
||||||
public int adrate;
|
public int adrate;
|
||||||
public int roomrate;
|
public int roomrate;
|
||||||
public float afSendLimit;
|
public float afSendLimit;
|
||||||
public float afSendNum;
|
public float afSendNum;
|
||||||
public int rewardinsertion;
|
public int rewardinsertion;
|
||||||
public int exchangeCD = 120;
|
public int exchangeCD = 120;
|
||||||
public int PayRate;
|
public int PayRate;
|
||||||
|
|
||||||
public int AddDiscountLevel;
|
public int AddDiscountLevel;
|
||||||
public int AddDiscountCD;
|
public int AddDiscountCD;
|
||||||
public int AddSpaceLevel;
|
public int AddSpaceLevel;
|
||||||
|
|
||||||
public int RemoveADsPackDuration;
|
public int RemoveADsPackDuration;
|
||||||
public int RemoveADsPackPopup;
|
public int RemoveADsPackPopup;
|
||||||
|
|
||||||
public string contactUs;
|
public string contactUs;
|
||||||
public int[] UnlockSecret;
|
public int[] UnlockSecret;
|
||||||
|
|
||||||
public int[] UnlockLive;
|
public int[] UnlockLive;
|
||||||
public int Live;
|
public int Live;
|
||||||
public int Secret;
|
public int Secret;
|
||||||
public int Assitant;
|
public int Assitant;
|
||||||
public int LivePreview;
|
public int LivePreview;
|
||||||
public int SecretPreview;
|
public int SecretPreview;
|
||||||
public int HomeGuideRate;
|
public int HomeGuideRate;
|
||||||
public int roomGuideRate;
|
public int roomGuideRate;
|
||||||
public int VIPGuide;
|
public int VIPGuide;
|
||||||
public int VIPGuideRate;
|
public int VIPGuideRate;
|
||||||
public int HomeInterstitialAd;
|
public int HomeInterstitialAd;
|
||||||
public int FreeClaims;
|
public int FreeClaims;
|
||||||
public int TurnOffPackRate;
|
public int TurnOffPackRate;
|
||||||
public int TurnOffRewardsRate;
|
public int TurnOffRewardsRate;
|
||||||
public int TurnOffRewardsCD;
|
public int TurnOffRewardsCD;
|
||||||
public int TurnOffRewardslimit;
|
public int TurnOffRewardslimit;
|
||||||
public int FailedGiftProgress;
|
public int FailedGiftProgress;
|
||||||
public int BonusInside;
|
public int BonusInside;
|
||||||
public int UnlockAIAssistant;
|
public int UnlockAIAssistant;
|
||||||
public int FreeMessages;
|
public int FreeMessages;
|
||||||
public int[] CoinsAccess;
|
public int[] CoinsAccess;
|
||||||
public int AdAccess;
|
public int AdAccess;
|
||||||
public int ClearRAM;
|
public int ClearRAM;
|
||||||
public int CoinsDownload;
|
public int CoinsDownload;
|
||||||
public string ResVersion;
|
public string ResVersion;
|
||||||
public int MultiModal;
|
public int MultiModal;
|
||||||
}
|
public int WVswitch;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -7,7 +7,6 @@ namespace FGUI.LG_Common
|
|||||||
{
|
{
|
||||||
public partial class btn_albums : GButton
|
public partial class btn_albums : GButton
|
||||||
{
|
{
|
||||||
public GGraph anim;
|
|
||||||
public GGroup panel;
|
public GGroup panel;
|
||||||
public Transition t0;
|
public Transition t0;
|
||||||
public const string URL = "ui://c9mmg3dxccp2cc";
|
public const string URL = "ui://c9mmg3dxccp2cc";
|
||||||
@@ -21,7 +20,6 @@ namespace FGUI.LG_Common
|
|||||||
{
|
{
|
||||||
base.ConstructFromXML(xml);
|
base.ConstructFromXML(xml);
|
||||||
|
|
||||||
anim = (GGraph)GetChildAt(0);
|
|
||||||
panel = (GGroup)GetChildAt(4);
|
panel = (GGroup)GetChildAt(4);
|
||||||
t0 = GetTransitionAt(0);
|
t0 = GetTransitionAt(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace FGUI.LG_Common
|
|||||||
{
|
{
|
||||||
public partial class btn_vip : GButton
|
public partial class btn_vip : GButton
|
||||||
{
|
{
|
||||||
public GGraph anim;
|
public Transition t0;
|
||||||
public const string URL = "ui://c9mmg3dxpjnncg";
|
public const string URL = "ui://c9mmg3dxpjnncg";
|
||||||
|
|
||||||
public static btn_vip CreateInstance()
|
public static btn_vip CreateInstance()
|
||||||
@@ -19,7 +19,7 @@ namespace FGUI.LG_Common
|
|||||||
{
|
{
|
||||||
base.ConstructFromXML(xml);
|
base.ConstructFromXML(xml);
|
||||||
|
|
||||||
anim = (GGraph)GetChildAt(0);
|
t0 = GetTransitionAt(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,6 @@ namespace FGUI.LG_End
|
|||||||
public GTextField tetx_level;
|
public GTextField tetx_level;
|
||||||
public GButton btn_setting;
|
public GButton btn_setting;
|
||||||
public GGraph congra_parent;
|
public GGraph congra_parent;
|
||||||
public GButton btn_continue;
|
|
||||||
public GTextField text_levelType;
|
public GTextField text_levelType;
|
||||||
public GGraph bg_parent;
|
public GGraph bg_parent;
|
||||||
public GGraph bg_parent_title;
|
public GGraph bg_parent_title;
|
||||||
@@ -24,6 +23,7 @@ namespace FGUI.LG_End
|
|||||||
public GTextField text_award;
|
public GTextField text_award;
|
||||||
public GButton btn_gold;
|
public GButton btn_gold;
|
||||||
public GComponent com_loader;
|
public GComponent com_loader;
|
||||||
|
public GButton btn_continue;
|
||||||
public GButton btn_download;
|
public GButton btn_download;
|
||||||
public GButton btn_restart;
|
public GButton btn_restart;
|
||||||
public GComponent wheel;
|
public GComponent wheel;
|
||||||
@@ -52,15 +52,15 @@ namespace FGUI.LG_End
|
|||||||
tetx_level = (GTextField)GetChildAt(4);
|
tetx_level = (GTextField)GetChildAt(4);
|
||||||
btn_setting = (GButton)GetChildAt(5);
|
btn_setting = (GButton)GetChildAt(5);
|
||||||
congra_parent = (GGraph)GetChildAt(11);
|
congra_parent = (GGraph)GetChildAt(11);
|
||||||
btn_continue = (GButton)GetChildAt(12);
|
text_levelType = (GTextField)GetChildAt(12);
|
||||||
text_levelType = (GTextField)GetChildAt(13);
|
bg_parent = (GGraph)GetChildAt(13);
|
||||||
bg_parent = (GGraph)GetChildAt(14);
|
bg_parent_title = (GGraph)GetChildAt(18);
|
||||||
bg_parent_title = (GGraph)GetChildAt(19);
|
coin_parent = (GGraph)GetChildAt(19);
|
||||||
coin_parent = (GGraph)GetChildAt(20);
|
btn_mult = (GButton)GetChildAt(20);
|
||||||
btn_mult = (GButton)GetChildAt(21);
|
text_award = (GTextField)GetChildAt(22);
|
||||||
text_award = (GTextField)GetChildAt(23);
|
btn_gold = (GButton)GetChildAt(23);
|
||||||
btn_gold = (GButton)GetChildAt(24);
|
com_loader = (GComponent)GetChildAt(26);
|
||||||
com_loader = (GComponent)GetChildAt(27);
|
btn_continue = (GButton)GetChildAt(27);
|
||||||
btn_download = (GButton)GetChildAt(29);
|
btn_download = (GButton)GetChildAt(29);
|
||||||
btn_restart = (GButton)GetChildAt(30);
|
btn_restart = (GButton)GetChildAt(30);
|
||||||
wheel = (GComponent)GetChildAt(31);
|
wheel = (GComponent)GetChildAt(31);
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ namespace FGUI.LG_Unlock
|
|||||||
base.ConstructFromXML(xml);
|
base.ConstructFromXML(xml);
|
||||||
|
|
||||||
type = GetControllerAt(0);
|
type = GetControllerAt(0);
|
||||||
title1 = (GTextField)GetChildAt(1);
|
title1 = (GTextField)GetChildAt(2);
|
||||||
btn_subscribe = (GButton)GetChildAt(3);
|
btn_subscribe = (GButton)GetChildAt(4);
|
||||||
text_coin = (GTextField)GetChildAt(4);
|
text_coin = (GTextField)GetChildAt(5);
|
||||||
btn_gold = (GButton)GetChildAt(5);
|
btn_gold = (GButton)GetChildAt(6);
|
||||||
text_level = (GTextField)GetChildAt(6);
|
text_level = (GTextField)GetChildAt(7);
|
||||||
btn_play = (GButton)GetChildAt(8);
|
btn_play = (GButton)GetChildAt(9);
|
||||||
btn_close = (GButton)GetChildAt(12);
|
btn_close = (GButton)GetChildAt(13);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ namespace FGUI.LG_Vip
|
|||||||
{
|
{
|
||||||
public partial class com_vip : GComponent
|
public partial class com_vip : GComponent
|
||||||
{
|
{
|
||||||
|
public Controller viplevel;
|
||||||
public GLoader bg_loader;
|
public GLoader bg_loader;
|
||||||
public GList list;
|
public GList list;
|
||||||
public btn_vipType btn_week;
|
public btn_vipType btn_week;
|
||||||
@@ -29,6 +30,7 @@ namespace FGUI.LG_Vip
|
|||||||
{
|
{
|
||||||
base.ConstructFromXML(xml);
|
base.ConstructFromXML(xml);
|
||||||
|
|
||||||
|
viplevel = GetControllerAt(0);
|
||||||
bg_loader = (GLoader)GetChildAt(2);
|
bg_loader = (GLoader)GetChildAt(2);
|
||||||
list = (GList)GetChildAt(7);
|
list = (GList)GetChildAt(7);
|
||||||
btn_week = (btn_vipType)GetChildAt(8);
|
btn_week = (btn_vipType)GetChildAt(8);
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ namespace FGUI.LG_Vip
|
|||||||
base.ConstructFromXML(xml);
|
base.ConstructFromXML(xml);
|
||||||
|
|
||||||
have = GetControllerAt(0);
|
have = GetControllerAt(0);
|
||||||
title = (GTextField)GetChildAt(0);
|
title = (GTextField)GetChildAt(1);
|
||||||
img_check = (GImage)GetChildAt(2);
|
img_check = (GImage)GetChildAt(3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -28,14 +28,14 @@ namespace FGUI.ZM_AddCell_12
|
|||||||
base.ConstructFromXML(xml);
|
base.ConstructFromXML(xml);
|
||||||
|
|
||||||
pay_type = GetControllerAt(0);
|
pay_type = GetControllerAt(0);
|
||||||
title = (GTextField)GetChildAt(1);
|
title = (GTextField)GetChildAt(3);
|
||||||
com_tips = (com_title)GetChildAt(3);
|
com_tips = (com_title)GetChildAt(5);
|
||||||
btn_watch = (GButton)GetChildAt(4);
|
btn_watch = (GButton)GetChildAt(6);
|
||||||
ads = (GTextField)GetChildAt(5);
|
ads = (GTextField)GetChildAt(7);
|
||||||
tips = (GTextField)GetChildAt(6);
|
tips = (GTextField)GetChildAt(8);
|
||||||
broad = (GComponent)GetChildAt(7);
|
broad = (GComponent)GetChildAt(9);
|
||||||
btn_max_pay = (GButton)GetChildAt(8);
|
btn_max_pay = (GButton)GetChildAt(10);
|
||||||
btn_close = (GButton)GetChildAt(9);
|
btn_close = (GButton)GetChildAt(11);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -22,10 +22,10 @@ namespace FGUI.ZM_AddCell_12
|
|||||||
{
|
{
|
||||||
base.ConstructFromXML(xml);
|
base.ConstructFromXML(xml);
|
||||||
|
|
||||||
btn_close = (GButton)GetChildAt(1);
|
btn_close = (GButton)GetChildAt(2);
|
||||||
text_goldnum = (GTextField)GetChildAt(2);
|
text_goldnum = (GTextField)GetChildAt(3);
|
||||||
btn_receive = (GButton)GetChildAt(3);
|
btn_receive = (GButton)GetChildAt(4);
|
||||||
end_point = (GTextField)GetChildAt(4);
|
end_point = (GTextField)GetChildAt(5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7,6 +7,7 @@ namespace FGUI.ZM_Common_01
|
|||||||
{
|
{
|
||||||
public partial class btn_head : GButton
|
public partial class btn_head : GButton
|
||||||
{
|
{
|
||||||
|
public Controller vip;
|
||||||
public head head;
|
public head head;
|
||||||
public const string URL = "ui://o9974uc5emjh5e";
|
public const string URL = "ui://o9974uc5emjh5e";
|
||||||
|
|
||||||
@@ -19,6 +20,7 @@ namespace FGUI.ZM_Common_01
|
|||||||
{
|
{
|
||||||
base.ConstructFromXML(xml);
|
base.ConstructFromXML(xml);
|
||||||
|
|
||||||
|
vip = GetControllerAt(0);
|
||||||
head = (head)GetChildAt(0);
|
head = (head)GetChildAt(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace FGUI.ZM_Lobby_03
|
|||||||
UIObjectFactory.SetPackageItemExtension(com_hall.URL, typeof(com_hall));
|
UIObjectFactory.SetPackageItemExtension(com_hall.URL, typeof(com_hall));
|
||||||
UIObjectFactory.SetPackageItemExtension(com_payloading.URL, typeof(com_payloading));
|
UIObjectFactory.SetPackageItemExtension(com_payloading.URL, typeof(com_payloading));
|
||||||
UIObjectFactory.SetPackageItemExtension(btn_play.URL, typeof(btn_play));
|
UIObjectFactory.SetPackageItemExtension(btn_play.URL, typeof(btn_play));
|
||||||
|
UIObjectFactory.SetPackageItemExtension(btn_sign.URL, typeof(btn_sign));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
/** This is an automatically generated class by FairyGUI. Please do not modify it. **/
|
||||||
|
|
||||||
|
using FairyGUI;
|
||||||
|
using FairyGUI.Utils;
|
||||||
|
|
||||||
|
namespace FGUI.ZM_Lobby_03
|
||||||
|
{
|
||||||
|
public partial class btn_sign : GButton
|
||||||
|
{
|
||||||
|
public GImage red;
|
||||||
|
public const string URL = "ui://gytj501cwgo41d";
|
||||||
|
|
||||||
|
public static btn_sign CreateInstance()
|
||||||
|
{
|
||||||
|
return (btn_sign)UIPackage.CreateObject("ZM_Lobby_03", "btn_sign");
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ConstructFromXML(XML xml)
|
||||||
|
{
|
||||||
|
base.ConstructFromXML(xml);
|
||||||
|
|
||||||
|
red = (GImage)GetChildAt(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 39c8d648f664d534b85655b5c4317090
|
guid: 1dbbeec11949a5047b958e65a13068b1
|
||||||
MonoImporter:
|
MonoImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
@@ -33,6 +33,7 @@ namespace FGUI.ZM_Lobby_03
|
|||||||
public btn_level_play btn_play10;
|
public btn_level_play btn_play10;
|
||||||
public GGroup play_node;
|
public GGroup play_node;
|
||||||
public GButton btn_task_times;
|
public GButton btn_task_times;
|
||||||
|
public btn_sign btn_sign;
|
||||||
public GButton btn_wv;
|
public GButton btn_wv;
|
||||||
public GButton btn_noads;
|
public GButton btn_noads;
|
||||||
public GButton btn_restore;
|
public GButton btn_restore;
|
||||||
@@ -50,7 +51,7 @@ namespace FGUI.ZM_Lobby_03
|
|||||||
base.ConstructFromXML(xml);
|
base.ConstructFromXML(xml);
|
||||||
|
|
||||||
state = GetControllerAt(0);
|
state = GetControllerAt(0);
|
||||||
bg_loader = (GLoader)GetChildAt(1);
|
bg_loader = (GLoader)GetChildAt(2);
|
||||||
btn_play = (btn_play)GetChildAt(4);
|
btn_play = (btn_play)GetChildAt(4);
|
||||||
btn_album = (GButton)GetChildAt(5);
|
btn_album = (GButton)GetChildAt(5);
|
||||||
btn_vip = (GButton)GetChildAt(6);
|
btn_vip = (GButton)GetChildAt(6);
|
||||||
@@ -75,11 +76,12 @@ namespace FGUI.ZM_Lobby_03
|
|||||||
btn_play10 = (btn_level_play)GetChildAt(25);
|
btn_play10 = (btn_level_play)GetChildAt(25);
|
||||||
play_node = (GGroup)GetChildAt(26);
|
play_node = (GGroup)GetChildAt(26);
|
||||||
btn_task_times = (GButton)GetChildAt(27);
|
btn_task_times = (GButton)GetChildAt(27);
|
||||||
btn_wv = (GButton)GetChildAt(28);
|
btn_sign = (btn_sign)GetChildAt(28);
|
||||||
btn_noads = (GButton)GetChildAt(29);
|
btn_wv = (GButton)GetChildAt(29);
|
||||||
btn_restore = (GButton)GetChildAt(30);
|
btn_noads = (GButton)GetChildAt(30);
|
||||||
btn_secret = (GButton)GetChildAt(31);
|
btn_restore = (GButton)GetChildAt(31);
|
||||||
btn_chat = (GButton)GetChildAt(32);
|
btn_secret = (GButton)GetChildAt(32);
|
||||||
|
btn_chat = (GButton)GetChildAt(33);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -12,6 +12,7 @@ namespace FGUI.ZM_Setting_07
|
|||||||
public btn_menu btn_terms;
|
public btn_menu btn_terms;
|
||||||
public btn_menu btn_language;
|
public btn_menu btn_language;
|
||||||
public btn_menu btn_official;
|
public btn_menu btn_official;
|
||||||
|
public btn_menu btn_email;
|
||||||
public GTextField text_uid;
|
public GTextField text_uid;
|
||||||
public GTextField text_version;
|
public GTextField text_version;
|
||||||
public btn_music btn_music;
|
public btn_music btn_music;
|
||||||
@@ -33,11 +34,12 @@ namespace FGUI.ZM_Setting_07
|
|||||||
btn_terms = (btn_menu)GetChildAt(6);
|
btn_terms = (btn_menu)GetChildAt(6);
|
||||||
btn_language = (btn_menu)GetChildAt(7);
|
btn_language = (btn_menu)GetChildAt(7);
|
||||||
btn_official = (btn_menu)GetChildAt(8);
|
btn_official = (btn_menu)GetChildAt(8);
|
||||||
text_uid = (GTextField)GetChildAt(9);
|
btn_email = (btn_menu)GetChildAt(9);
|
||||||
text_version = (GTextField)GetChildAt(10);
|
text_uid = (GTextField)GetChildAt(10);
|
||||||
btn_music = (btn_music)GetChildAt(11);
|
text_version = (GTextField)GetChildAt(11);
|
||||||
btn_sound = (btn_sound)GetChildAt(12);
|
btn_music = (btn_music)GetChildAt(12);
|
||||||
btn_restore = (btn_menu)GetChildAt(13);
|
btn_sound = (btn_sound)GetChildAt(13);
|
||||||
|
btn_restore = (btn_menu)GetChildAt(14);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,7 +25,7 @@ namespace FGUI.ZM_Sign_06
|
|||||||
status = GetControllerAt(0);
|
status = GetControllerAt(0);
|
||||||
fx_parent = (GGraph)GetChildAt(2);
|
fx_parent = (GGraph)GetChildAt(2);
|
||||||
reward_num = (GTextField)GetChildAt(3);
|
reward_num = (GTextField)GetChildAt(3);
|
||||||
line = (GImage)GetChildAt(6);
|
line = (GImage)GetChildAt(7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -27,12 +27,12 @@ namespace FGUI.ZM_Tasks_13
|
|||||||
base.ConstructFromXML(xml);
|
base.ConstructFromXML(xml);
|
||||||
|
|
||||||
bg_parent = (GGraph)GetChildAt(2);
|
bg_parent = (GGraph)GetChildAt(2);
|
||||||
btn_mult = (GButton)GetChildAt(5);
|
btn_mult = (GButton)GetChildAt(4);
|
||||||
fx_place = (GGraph)GetChildAt(6);
|
fx_place = (GGraph)GetChildAt(5);
|
||||||
text_award = (GTextField)GetChildAt(7);
|
text_award = (GTextField)GetChildAt(6);
|
||||||
btn_claim = (GButton)GetChildAt(8);
|
btn_claim = (GButton)GetChildAt(7);
|
||||||
title1 = (GTextField)GetChildAt(9);
|
title1 = (GTextField)GetChildAt(8);
|
||||||
wheel = (GComponent)GetChildAt(10);
|
wheel = (GComponent)GetChildAt(9);
|
||||||
t0 = GetTransitionAt(0);
|
t0 = GetTransitionAt(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -365,8 +365,8 @@ namespace BallKingdomCrush
|
|||||||
|
|
||||||
|
|
||||||
// return false;
|
// return false;
|
||||||
return true;
|
// return true;
|
||||||
bool b = GetLoginModel().IsMagic;
|
// bool b = GetLoginModel().IsMagic;
|
||||||
|
|
||||||
return GetLoginModel().IsMagic;
|
return GetLoginModel().IsMagic;
|
||||||
}
|
}
|
||||||
@@ -582,6 +582,7 @@ namespace BallKingdomCrush
|
|||||||
|
|
||||||
var currentIndex = GetValueIndex(currentRmLevel);
|
var currentIndex = GetValueIndex(currentRmLevel);
|
||||||
|
|
||||||
|
Debug.Log($"GetRewardValue type:{type} currentIndex:{currentIndex}");
|
||||||
if (currentIndex != -1)
|
if (currentIndex != -1)
|
||||||
{
|
{
|
||||||
if (type == 0)
|
if (type == 0)
|
||||||
|
|||||||
@@ -74,11 +74,9 @@ namespace BallKingdomCrush
|
|||||||
// lang = "en";
|
// lang = "en";
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// UIManager.Instance.SetSwitchLanguage(lang);
|
// UIManager.Instance.SetSwitchLanguage(lang);
|
||||||
|
//更新map中的value,与配置表的id对应
|
||||||
DataMgr.Coin.Value = 100000;
|
PurchasingManager.SetShopMapValue();
|
||||||
DataMgr.GameLevel.Value = 20;
|
|
||||||
|
|
||||||
//初始化商品(谷歌支付和ios支付)
|
//初始化商品(谷歌支付和ios支付)
|
||||||
// PurchasingManager.InitProduct();
|
// PurchasingManager.InitProduct();
|
||||||
|
|
||||||
|
|||||||
@@ -1,355 +1,355 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace BallKingdomCrush
|
namespace BallKingdomCrush
|
||||||
{
|
{
|
||||||
public static class PreDownloadManager
|
public static class PreDownloadManager
|
||||||
{
|
{
|
||||||
#region Live
|
#region Live
|
||||||
|
|
||||||
public static void InitializeLiveData()
|
public static void InitializeLiveData()
|
||||||
{
|
{
|
||||||
List<Live> liveConfigList = ConfigSystem.GetConfig<Live>();
|
List<Live> liveConfigList = ConfigSystem.GetLiveConfig();
|
||||||
|
|
||||||
Debug.Log($"[预下载视频 数据初始化]-0-----{DataMgr.LiveDataDic.Value.Count}");
|
Debug.Log($"[预下载视频 数据初始化]-0-----{DataMgr.LiveDataDic.Value.Count}");
|
||||||
|
|
||||||
var newData = new Dictionary<int, LiveData>();
|
var newData = new Dictionary<int, LiveData>();
|
||||||
|
|
||||||
for (var i = 0; i < liveConfigList.Count; i++)
|
for (var i = 0; i < liveConfigList.Count; i++)
|
||||||
{
|
{
|
||||||
var oldData = GetLiveDataByIndex(liveConfigList[i], i);
|
var oldData = GetLiveDataByIndex(liveConfigList[i], i);
|
||||||
|
|
||||||
if (oldData.progress > 0) newData[i] = oldData;
|
if (oldData.progress > 0) newData[i] = oldData;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Log($"[预下载视频 数据初始化]--1----- {newData.Count}");
|
Debug.Log($"[预下载视频 数据初始化]--1----- {newData.Count}");
|
||||||
DataMgr.LiveDataDic.Value = newData;
|
DataMgr.LiveDataDic.Value = newData;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LiveData GetLiveDataByIndex(Live liveConfig, int i)
|
public static LiveData GetLiveDataByIndex(Live liveConfig, int i)
|
||||||
{
|
{
|
||||||
DataMgr.LiveDataDic.Value.TryGetValue(i, out var oldData);
|
DataMgr.LiveDataDic.Value.TryGetValue(i, out var oldData);
|
||||||
|
|
||||||
oldData ??= new LiveData
|
oldData ??= new LiveData
|
||||||
{
|
{
|
||||||
progress = liveConfig.Progress,
|
progress = liveConfig.Progress,
|
||||||
AD_num = 0,
|
AD_num = 0,
|
||||||
Singleprogress = (100 - liveConfig.Progress) / liveConfig.AD
|
Singleprogress = (100 - liveConfig.Progress) / liveConfig.AD
|
||||||
};
|
};
|
||||||
|
|
||||||
if (oldData.progress < liveConfig.Progress) oldData.progress = liveConfig.Progress;
|
if (oldData.progress < liveConfig.Progress) oldData.progress = liveConfig.Progress;
|
||||||
|
|
||||||
return oldData;
|
return oldData;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 最大同时下载数量
|
// 最大同时下载数量
|
||||||
private const int MaxConcurrentDownloads = 1;
|
private const int MaxConcurrentDownloads = 1;
|
||||||
|
|
||||||
public static void StartDownload()
|
public static void StartDownload()
|
||||||
{
|
{
|
||||||
CrazyAsyKit.StartCoroutine(DownloadVideosCoroutine());
|
CrazyAsyKit.StartCoroutine(DownloadVideosCoroutine());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IEnumerator DownloadVideosCoroutine()
|
private static IEnumerator DownloadVideosCoroutine()
|
||||||
{
|
{
|
||||||
List<Live> liveConfigList = ConfigSystem.GetConfig<Live>();
|
List<Live> liveConfigList = ConfigSystem.GetLiveConfig();
|
||||||
var liveDic = DataMgr.LiveDataDic.Value;
|
var liveDic = DataMgr.LiveDataDic.Value;
|
||||||
|
|
||||||
var downloadNameList = new List<string>();
|
var downloadNameList = new List<string>();
|
||||||
|
|
||||||
// 先加入已有进度的视频
|
// 先加入已有进度的视频
|
||||||
foreach (var kvp in liveDic)
|
foreach (var kvp in liveDic)
|
||||||
{
|
{
|
||||||
var index = kvp.Key;
|
var index = kvp.Key;
|
||||||
var data = kvp.Value;
|
var data = kvp.Value;
|
||||||
|
|
||||||
if (data.progress > 0 && index < liveConfigList.Count) downloadNameList.Add(liveConfigList[index].Name);
|
if (data.progress > 0 && index < liveConfigList.Count) downloadNameList.Add(liveConfigList[index].Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Log($"[init down video]---1---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
Debug.Log($"[init down video]---1---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
||||||
|
|
||||||
// 添加不在downloadNameList中的项,最多添加6个
|
// 添加不在downloadNameList中的项,最多添加6个
|
||||||
var addedCount = 0;
|
var addedCount = 0;
|
||||||
for (var i = 0; i < liveConfigList.Count && addedCount < 6; i++)
|
for (var i = 0; i < liveConfigList.Count && addedCount < 6; i++)
|
||||||
if (!downloadNameList.Contains(liveConfigList[i].Name))
|
if (!downloadNameList.Contains(liveConfigList[i].Name))
|
||||||
{
|
{
|
||||||
downloadNameList.Add(liveConfigList[i].Name);
|
downloadNameList.Add(liveConfigList[i].Name);
|
||||||
addedCount++;
|
addedCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Log($"[init down video]---2---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
Debug.Log($"[init down video]---2---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
||||||
|
|
||||||
// 当前正在下载的协程数量
|
// 当前正在下载的协程数量
|
||||||
var runningCount = 0;
|
var runningCount = 0;
|
||||||
var currentIndex = 0;
|
var currentIndex = 0;
|
||||||
|
|
||||||
if (downloadNameList.Count > 0)
|
if (downloadNameList.Count > 0)
|
||||||
{
|
{
|
||||||
var name = downloadNameList[currentIndex];
|
var name = downloadNameList[currentIndex];
|
||||||
|
|
||||||
var localPath = Path.Combine(TextureHelper.getResPath(), FolderNames.VideoName, name + ".enc");
|
var localPath = Path.Combine(TextureHelper.getResPath(), FolderNames.VideoName, name + ".enc");
|
||||||
Debug.Log($"[预下载 视频 路径]-------localPath===={localPath}");
|
Debug.Log($"[预下载 视频 路径]-------localPath===={localPath}");
|
||||||
|
|
||||||
if (!File.Exists(localPath))
|
if (!File.Exists(localPath))
|
||||||
{
|
{
|
||||||
Debug.Log("[开始预下载 视频 ]---------------");
|
Debug.Log("[开始预下载 视频 ]---------------");
|
||||||
runningCount++;
|
runningCount++;
|
||||||
CrazyAsyKit.StartCoroutine(DownloadSingleVideoCoroutine(name, () => { runningCount--; }));
|
CrazyAsyKit.StartCoroutine(DownloadSingleVideoCoroutine(name, () => { runningCount--; }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 等待下一帧再检查
|
// 等待下一帧再检查
|
||||||
yield return null;
|
yield return null;
|
||||||
Debug.Log("[init down video]---All downloads finished---");
|
Debug.Log("[init down video]---All downloads finished---");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static IEnumerator DownloadSingleVideoCoroutine(string name, Action onComplete)
|
private static IEnumerator DownloadSingleVideoCoroutine(string name, Action onComplete)
|
||||||
{
|
{
|
||||||
var isDone = false;
|
var isDone = false;
|
||||||
|
|
||||||
LiveVideoManager.Instance.GetVideoLocalPath(name, tex =>
|
LiveVideoManager.Instance.GetVideoLocalPath(name, tex =>
|
||||||
{
|
{
|
||||||
Debug.Log($"[init down video]----------------{name}");
|
Debug.Log($"[init down video]----------------{name}");
|
||||||
isDone = true;
|
isDone = true;
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
// 等待下载完成
|
// 等待下载完成
|
||||||
while (!isDone) yield return null;
|
while (!isDone) yield return null;
|
||||||
|
|
||||||
onComplete?.Invoke();
|
onComplete?.Invoke();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region Picture
|
#region Picture
|
||||||
|
|
||||||
public static void StartDownloadSecretPicture()
|
public static void StartDownloadSecretPicture()
|
||||||
{
|
{
|
||||||
var liveConfigList = ConfigSystem.GetConfig<SecretAlbums>();
|
var liveConfigList = ConfigSystem.GetSecretAlbumsConfig();
|
||||||
var liveList = DataMgr.SecretUnlockList.Value;
|
var liveList = DataMgr.SecretUnlockList.Value;
|
||||||
|
|
||||||
var downloadNameList = new List<string>();
|
var downloadNameList = new List<string>();
|
||||||
|
|
||||||
// 先加入所有可用的图片
|
// 先加入所有可用的图片
|
||||||
for (var i = 0; i < liveList.Count; i++)
|
for (var i = 0; i < liveList.Count; i++)
|
||||||
if (liveConfigList[i] != null && !downloadNameList.Contains(liveConfigList[i].Name))
|
if (liveConfigList[i] != null && !downloadNameList.Contains(liveConfigList[i].Name))
|
||||||
downloadNameList.Add(liveConfigList[i].Name);
|
downloadNameList.Add(liveConfigList[i].Name);
|
||||||
|
|
||||||
Debug.Log(
|
Debug.Log(
|
||||||
$"[init down picture Secret]---1---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
$"[init down picture Secret]---1---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
||||||
|
|
||||||
// 添加不在downloadNameList中的项,最多添加6个
|
// 添加不在downloadNameList中的项,最多添加6个
|
||||||
var addedCount = 0;
|
var addedCount = 0;
|
||||||
for (var i = 0; i < liveConfigList.Count && addedCount < 6; i++)
|
for (var i = 0; i < liveConfigList.Count && addedCount < 6; i++)
|
||||||
if (!downloadNameList.Contains(liveConfigList[i].Name))
|
if (!downloadNameList.Contains(liveConfigList[i].Name))
|
||||||
{
|
{
|
||||||
downloadNameList.Add(liveConfigList[i].Name);
|
downloadNameList.Add(liveConfigList[i].Name);
|
||||||
addedCount++;
|
addedCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Log(
|
Debug.Log(
|
||||||
$"[init down picture Secret]---2---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
$"[init down picture Secret]---2---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
||||||
|
|
||||||
foreach (var name in downloadNameList)
|
foreach (var name in downloadNameList)
|
||||||
{
|
{
|
||||||
var localPath = Path.Combine(TextureHelper.getResPath(), FolderNames.SecretName, name + ".jpg");
|
var localPath = Path.Combine(TextureHelper.getResPath(), FolderNames.SecretName, name + ".jpg");
|
||||||
Debug.Log($"[预下载 Secret 路径]-------localPath===={localPath}");
|
Debug.Log($"[预下载 Secret 路径]-------localPath===={localPath}");
|
||||||
if (!File.Exists(localPath))
|
if (!File.Exists(localPath))
|
||||||
{
|
{
|
||||||
Debug.Log("[开始预下载 Secret ]---------------");
|
Debug.Log("[开始预下载 Secret ]---------------");
|
||||||
TextureHelper.SetImgLoader(null, name,
|
TextureHelper.SetImgLoader(null, name,
|
||||||
s =>
|
s =>
|
||||||
{
|
{
|
||||||
Debug.Log($"[init down Secret picture]----------------{name}");
|
Debug.Log($"[init down Secret picture]----------------{name}");
|
||||||
}, "SecretAlbums/", FolderNames.SecretName, false);
|
}, "SecretAlbums/", FolderNames.SecretName, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static void StartDownloadAlbumsPicture()
|
public static void StartDownloadAlbumsPicture()
|
||||||
{
|
{
|
||||||
int Free_Alubum_0 = PlayerPrefs.GetInt("Free_Alubum_0", -1);
|
int Free_Alubum_0 = PlayerPrefs.GetInt("Free_Alubum_0", -1);
|
||||||
int Free_Alubum_1 = PlayerPrefs.GetInt("Free_Alubum_1", -1);
|
int Free_Alubum_1 = PlayerPrefs.GetInt("Free_Alubum_1", -1);
|
||||||
int AD_Alubum = PlayerPrefs.GetInt("AD_Alubum", -1);
|
int AD_Alubum = PlayerPrefs.GetInt("AD_Alubum", -1);
|
||||||
int Spec_Alubum = PlayerPrefs.GetInt("Spec_Alubum", -1);
|
int Spec_Alubum = PlayerPrefs.GetInt("Spec_Alubum", -1);
|
||||||
int Vip_Alubum = PlayerPrefs.GetInt("Vip_Alubum", -1);
|
int Vip_Alubum = PlayerPrefs.GetInt("Vip_Alubum", -1);
|
||||||
|
|
||||||
if (Free_Alubum_0 >= 0) return;
|
if (Free_Alubum_0 >= 0) return;
|
||||||
|
|
||||||
var FreeImageLibrary_ = ConfigSystem.GetConfig<FreeImageLibrary>();
|
var FreeImageLibrary_ = ConfigSystem.GetFreeImageConfig();
|
||||||
var ADImageLibrary_ = ConfigSystem.GetConfig<ADImageLibrary>();
|
var ADImageLibrary_ = ConfigSystem.GetADImageConfig();
|
||||||
var SpecialImageLibrary_ = ConfigSystem.GetConfig<SpecialImageLibrary>();
|
var SpecialImageLibrary_ = ConfigSystem.GetSpecialImageConfig();
|
||||||
var VIPImageLibrary_ = ConfigSystem.GetConfig<VIPImageLibrary>();
|
var VIPImageLibrary_ = ConfigSystem.GetVIPImageConfig();
|
||||||
|
|
||||||
List<int> free_level_list = new List<int>();
|
List<int> free_level_list = new List<int>();
|
||||||
List<int> ad_level_list = new List<int>();
|
List<int> ad_level_list = new List<int>();
|
||||||
List<int> special_level_list = new List<int>();
|
List<int> special_level_list = new List<int>();
|
||||||
List<int> vip_level_list = new List<int>();
|
List<int> vip_level_list = new List<int>();
|
||||||
for (int i = 0; i < DataMgr.LevelUnlockListNew.Value.Count; i++)
|
for (int i = 0; i < DataMgr.LevelUnlockListNew.Value.Count; i++)
|
||||||
{
|
{
|
||||||
if (DataMgr.LevelUnlockListNew.Value[i].type == 0) free_level_list.Add(DataMgr.LevelUnlockListNew.Value[i].config_index);
|
if (DataMgr.LevelUnlockListNew.Value[i].type == 0) free_level_list.Add(DataMgr.LevelUnlockListNew.Value[i].config_index);
|
||||||
else if (DataMgr.LevelUnlockListNew.Value[i].type == 1) ad_level_list.Add(DataMgr.LevelUnlockListNew.Value[i].config_index);
|
else if (DataMgr.LevelUnlockListNew.Value[i].type == 1) ad_level_list.Add(DataMgr.LevelUnlockListNew.Value[i].config_index);
|
||||||
else if (DataMgr.LevelUnlockListNew.Value[i].type == 2) special_level_list.Add(DataMgr.LevelUnlockListNew.Value[i].config_index);
|
else if (DataMgr.LevelUnlockListNew.Value[i].type == 2) special_level_list.Add(DataMgr.LevelUnlockListNew.Value[i].config_index);
|
||||||
else if (DataMgr.LevelUnlockListNew.Value[i].type == 3) vip_level_list.Add(DataMgr.LevelUnlockListNew.Value[i].config_index);
|
else if (DataMgr.LevelUnlockListNew.Value[i].type == 3) vip_level_list.Add(DataMgr.LevelUnlockListNew.Value[i].config_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (Free_Alubum_0 < 0)
|
if (Free_Alubum_0 < 0)
|
||||||
{
|
{
|
||||||
HashSet<int> levelIds = new HashSet<int>(free_level_list);
|
HashSet<int> levelIds = new HashSet<int>(free_level_list);
|
||||||
List<FreeImageLibrary> filtered = ConfigSystem.GetConfig<FreeImageLibrary>().Where(x => !levelIds.Contains(x.id)).ToList();
|
List<FreeImageLibrary> filtered = ConfigSystem.GetFreeImageConfig().Where(x => !levelIds.Contains(x.id)).ToList();
|
||||||
if (filtered.Count > 0)
|
if (filtered.Count > 0)
|
||||||
{
|
{
|
||||||
Free_Alubum_0 = filtered[UnityEngine.Random.Range(0, filtered.Count)].id;
|
Free_Alubum_0 = filtered[UnityEngine.Random.Range(0, filtered.Count)].id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Free_Alubum_0 = ConfigSystem.GetConfig<FreeImageLibrary>()[UnityEngine.Random.Range(0, ConfigSystem.GetConfig<FreeImageLibrary>().Count)].id;
|
Free_Alubum_0 = ConfigSystem.GetFreeImageConfig()[UnityEngine.Random.Range(0, ConfigSystem.GetFreeImageConfig().Count)].id;
|
||||||
}
|
}
|
||||||
free_level_list.Add(Free_Alubum_0);
|
free_level_list.Add(Free_Alubum_0);
|
||||||
Debug.Log(JsonConvert.SerializeObject(filtered) + ",,,,,,,,,,,,,,,,,,,,");
|
Debug.Log(JsonConvert.SerializeObject(filtered) + ",,,,,,,,,,,,,,,,,,,,");
|
||||||
}
|
}
|
||||||
if (Free_Alubum_1 < 0)
|
if (Free_Alubum_1 < 0)
|
||||||
{
|
{
|
||||||
HashSet<int> levelIds = new HashSet<int>(free_level_list);
|
HashSet<int> levelIds = new HashSet<int>(free_level_list);
|
||||||
List<FreeImageLibrary> filtered = ConfigSystem.GetConfig<FreeImageLibrary>().Where(x => !levelIds.Contains(x.id)).ToList();
|
List<FreeImageLibrary> filtered = ConfigSystem.GetFreeImageConfig().Where(x => !levelIds.Contains(x.id)).ToList();
|
||||||
if (filtered.Count > 0)
|
if (filtered.Count > 0)
|
||||||
{
|
{
|
||||||
Free_Alubum_1 = filtered[UnityEngine.Random.Range(0, filtered.Count)].id;
|
Free_Alubum_1 = filtered[UnityEngine.Random.Range(0, filtered.Count)].id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Free_Alubum_1 = ConfigSystem.GetConfig<FreeImageLibrary>()[UnityEngine.Random.Range(0, ConfigSystem.GetConfig<FreeImageLibrary>().Count)].id;
|
Free_Alubum_1 = ConfigSystem.GetFreeImageConfig()[UnityEngine.Random.Range(0, ConfigSystem.GetFreeImageConfig().Count)].id;
|
||||||
}
|
}
|
||||||
Debug.Log(JsonConvert.SerializeObject(filtered) + ",,,,,,,,,,,,,,,,,,,,");
|
Debug.Log(JsonConvert.SerializeObject(filtered) + ",,,,,,,,,,,,,,,,,,,,");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (AD_Alubum < 0)
|
if (AD_Alubum < 0)
|
||||||
{
|
{
|
||||||
HashSet<int> levelIds = new HashSet<int>(ad_level_list);
|
HashSet<int> levelIds = new HashSet<int>(ad_level_list);
|
||||||
List<ADImageLibrary> filtered = ConfigSystem.GetConfig<ADImageLibrary>().Where(x => !levelIds.Contains(x.id)).ToList();
|
List<ADImageLibrary> filtered = ConfigSystem.GetADImageConfig().Where(x => !levelIds.Contains(x.id)).ToList();
|
||||||
if (filtered.Count > 0)
|
if (filtered.Count > 0)
|
||||||
{
|
{
|
||||||
AD_Alubum = filtered[UnityEngine.Random.Range(0, filtered.Count)].id;
|
AD_Alubum = filtered[UnityEngine.Random.Range(0, filtered.Count)].id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AD_Alubum = ConfigSystem.GetConfig<ADImageLibrary>()[UnityEngine.Random.Range(0, ConfigSystem.GetConfig<ADImageLibrary>().Count)].id;
|
AD_Alubum = ConfigSystem.GetADImageConfig()[UnityEngine.Random.Range(0, ConfigSystem.GetADImageConfig().Count)].id;
|
||||||
}
|
}
|
||||||
Debug.Log(JsonConvert.SerializeObject(filtered) + ",,,,,,,,,,,,,,,,,,,,");
|
Debug.Log(JsonConvert.SerializeObject(filtered) + ",,,,,,,,,,,,,,,,,,,,");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Spec_Alubum < 0)
|
if (Spec_Alubum < 0)
|
||||||
{
|
{
|
||||||
HashSet<int> levelIds = new HashSet<int>(special_level_list);
|
HashSet<int> levelIds = new HashSet<int>(special_level_list);
|
||||||
List<SpecialImageLibrary> filtered = ConfigSystem.GetConfig<SpecialImageLibrary>().Where(x => !levelIds.Contains(x.id)).ToList();
|
List<SpecialImageLibrary> filtered = ConfigSystem.GetSpecialImageConfig().Where(x => !levelIds.Contains(x.id)).ToList();
|
||||||
if (filtered.Count > 0)
|
if (filtered.Count > 0)
|
||||||
{
|
{
|
||||||
Spec_Alubum = filtered[UnityEngine.Random.Range(0, filtered.Count)].id;
|
Spec_Alubum = filtered[UnityEngine.Random.Range(0, filtered.Count)].id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Spec_Alubum = ConfigSystem.GetConfig<SpecialImageLibrary>()[UnityEngine.Random.Range(0, ConfigSystem.GetConfig<SpecialImageLibrary>().Count)].id;
|
Spec_Alubum = ConfigSystem.GetSpecialImageConfig()[UnityEngine.Random.Range(0, ConfigSystem.GetSpecialImageConfig().Count)].id;
|
||||||
}
|
}
|
||||||
Debug.Log(JsonConvert.SerializeObject(filtered) + ",,,,,,,,,,,,,,,,,,,,");
|
Debug.Log(JsonConvert.SerializeObject(filtered) + ",,,,,,,,,,,,,,,,,,,,");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Vip_Alubum < 0)
|
if (Vip_Alubum < 0)
|
||||||
{
|
{
|
||||||
HashSet<int> levelIds = new HashSet<int>(vip_level_list);
|
HashSet<int> levelIds = new HashSet<int>(vip_level_list);
|
||||||
List<VIPImageLibrary> filtered = ConfigSystem.GetConfig<VIPImageLibrary>().Where(x => !levelIds.Contains(x.id)).ToList();
|
List<VIPImageLibrary> filtered = ConfigSystem.GetVIPImageConfig().Where(x => !levelIds.Contains(x.id)).ToList();
|
||||||
if (filtered.Count > 0)
|
if (filtered.Count > 0)
|
||||||
{
|
{
|
||||||
Vip_Alubum = filtered[UnityEngine.Random.Range(0, filtered.Count)].id;
|
Vip_Alubum = filtered[UnityEngine.Random.Range(0, filtered.Count)].id;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Vip_Alubum = ConfigSystem.GetConfig<VIPImageLibrary>()[UnityEngine.Random.Range(0, ConfigSystem.GetConfig<VIPImageLibrary>().Count)].id;
|
Vip_Alubum = ConfigSystem.GetVIPImageConfig()[UnityEngine.Random.Range(0, ConfigSystem.GetVIPImageConfig().Count)].id;
|
||||||
}
|
}
|
||||||
Debug.Log(JsonConvert.SerializeObject(filtered) + ",,,,,,,,,,,,,,,,,,,,");
|
Debug.Log(JsonConvert.SerializeObject(filtered) + ",,,,,,,,,,,,,,,,,,,,");
|
||||||
}
|
}
|
||||||
PlayerPrefs.SetInt("Free_Alubum_0", Free_Alubum_0);
|
PlayerPrefs.SetInt("Free_Alubum_0", Free_Alubum_0);
|
||||||
PlayerPrefs.SetInt("Free_Alubum_1", Free_Alubum_1);
|
PlayerPrefs.SetInt("Free_Alubum_1", Free_Alubum_1);
|
||||||
PlayerPrefs.SetInt("AD_Alubum", AD_Alubum);
|
PlayerPrefs.SetInt("AD_Alubum", AD_Alubum);
|
||||||
PlayerPrefs.SetInt("Spec_Alubum", Spec_Alubum);
|
PlayerPrefs.SetInt("Spec_Alubum", Spec_Alubum);
|
||||||
PlayerPrefs.SetInt("Vip_Alubum", Vip_Alubum);
|
PlayerPrefs.SetInt("Vip_Alubum", Vip_Alubum);
|
||||||
|
|
||||||
List<string> downloadNameList = new List<string>
|
List<string> downloadNameList = new List<string>
|
||||||
{
|
{
|
||||||
FreeImageLibrary_[Free_Alubum_0].Name,
|
FreeImageLibrary_[Free_Alubum_0].Name,
|
||||||
FreeImageLibrary_[Free_Alubum_1].Name,
|
FreeImageLibrary_[Free_Alubum_1].Name,
|
||||||
ADImageLibrary_[AD_Alubum].Name,
|
ADImageLibrary_[AD_Alubum].Name,
|
||||||
SpecialImageLibrary_[Spec_Alubum].Name,
|
SpecialImageLibrary_[Spec_Alubum].Name,
|
||||||
VIPImageLibrary_[Vip_Alubum].Name
|
VIPImageLibrary_[Vip_Alubum].Name
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; i < GameHelper.GetCommonModel().MultiModal - 1; i++)
|
for (int i = 0; i < GameHelper.GetCommonModel().MultiModal - 1; i++)
|
||||||
{
|
{
|
||||||
downloadNameList.Insert(i, ConfigSystem.GetConfig<LevelUnlock>()[i].Name);
|
downloadNameList.Insert(i, ConfigSystem.GetLevelUnlockConfig()[i].Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.Log(
|
Debug.Log(
|
||||||
$"[init down picture Album]---1---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
$"[init down picture Album]---1---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
||||||
|
|
||||||
// 添加不在downloadNameList中的项,最多添加12个
|
// 添加不在downloadNameList中的项,最多添加12个
|
||||||
// var addedCount = 0;
|
// var addedCount = 0;
|
||||||
// for (var i = 0; i < liveConfigList.Count && addedCount < 6; i++)
|
// for (var i = 0; i < liveConfigList.Count && addedCount < 6; i++)
|
||||||
// if (!downloadNameList.Contains(liveConfigList[i].Name))
|
// if (!downloadNameList.Contains(liveConfigList[i].Name))
|
||||||
// {
|
// {
|
||||||
// downloadNameList.Add(liveConfigList[i].Name);
|
// downloadNameList.Add(liveConfigList[i].Name);
|
||||||
// addedCount++;
|
// addedCount++;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
Debug.Log(
|
Debug.Log(
|
||||||
$"[init down picture Album]---2---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
$"[init down picture Album]---2---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
||||||
|
|
||||||
// int centerIndex = GameHelper.GetLevel();
|
// int centerIndex = GameHelper.GetLevel();
|
||||||
// int totalCount = downloadNameList.Count;
|
// int totalCount = downloadNameList.Count;
|
||||||
|
|
||||||
// // 计算起始索引和实际要取的数量
|
// // 计算起始索引和实际要取的数量
|
||||||
// int rangeStart = Math.Max(0, centerIndex - 5);
|
// int rangeStart = Math.Max(0, centerIndex - 5);
|
||||||
// int rangeEnd = Math.Min(totalCount, centerIndex + 5);
|
// int rangeEnd = Math.Min(totalCount, centerIndex + 5);
|
||||||
// int rangeCount = rangeEnd - rangeStart;
|
// int rangeCount = rangeEnd - rangeStart;
|
||||||
|
|
||||||
// // 获取范围内元素并反转
|
// // 获取范围内元素并反转
|
||||||
// var segment = downloadNameList.GetRange(rangeStart, rangeCount);
|
// var segment = downloadNameList.GetRange(rangeStart, rangeCount);
|
||||||
// segment.Reverse();
|
// segment.Reverse();
|
||||||
|
|
||||||
// // 移除原始位置的元素
|
// // 移除原始位置的元素
|
||||||
// downloadNameList.RemoveRange(rangeStart, rangeCount);
|
// downloadNameList.RemoveRange(rangeStart, rangeCount);
|
||||||
|
|
||||||
// // 插入反转后的元素到最前面
|
// // 插入反转后的元素到最前面
|
||||||
// downloadNameList.InsertRange(0, segment);
|
// downloadNameList.InsertRange(0, segment);
|
||||||
|
|
||||||
|
|
||||||
Debug.Log(
|
Debug.Log(
|
||||||
$"[init down picture Album]---3---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
$"[init down picture Album]---3---nameList----------{JsonConvert.SerializeObject(downloadNameList)}");
|
||||||
|
|
||||||
foreach (var name in downloadNameList)
|
foreach (var name in downloadNameList)
|
||||||
{
|
{
|
||||||
var localPath = Path.Combine(TextureHelper.getResPath(), FolderNames.AlbumName, name + ".jpg");
|
var localPath = Path.Combine(TextureHelper.getResPath(), FolderNames.AlbumName, name + ".jpg");
|
||||||
Debug.Log($"[预下载 Albums 路径]-------localPath===={localPath}");
|
Debug.Log($"[预下载 Albums 路径]-------localPath===={localPath}");
|
||||||
if (!File.Exists(localPath))
|
if (!File.Exists(localPath))
|
||||||
{
|
{
|
||||||
Debug.Log($"[开始预下载 Albums ]--------------name-{name}");
|
Debug.Log($"[开始预下载 Albums ]--------------name-{name}");
|
||||||
TextureHelper.SetImgLoader(null, name,
|
TextureHelper.SetImgLoader(null, name,
|
||||||
s =>
|
s =>
|
||||||
{
|
{
|
||||||
Debug.Log($"[init down Album picture]----------------{name}");
|
Debug.Log($"[init down Album picture]----------------{name}");
|
||||||
}, "LevelAlbums/", FolderNames.AlbumName, false);
|
}, "LevelAlbums/", FolderNames.AlbumName, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,9 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
<?xml version='1.0' encoding='utf-8'?>
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
<resources xmlns:tools="http://schemas.android.com/tools" tools:keep="@string/gcm_defaultSenderId,@string/google_storage_bucket,@string/project_id,@string/google_api_key,@string/google_crash_reporting_api_key,@string/google_app_id">
|
||||||
</resources>
|
<string name="gcm_defaultSenderId" translatable="false">339238925993</string>
|
||||||
|
<string name="google_storage_bucket" translatable="false">ball-kingdom-crush.firebasestorage.app</string>
|
||||||
|
<string name="project_id" translatable="false">ball-kingdom-crush</string>
|
||||||
|
<string name="google_api_key" translatable="false">AIzaSyDxHji1beIuNjNbilpGCU8Knn_e7uPZO4Q</string>
|
||||||
|
<string name="google_crash_reporting_api_key" translatable="false">AIzaSyDxHji1beIuNjNbilpGCU8Knn_e7uPZO4Q</string>
|
||||||
|
<string name="google_app_id" translatable="false">1:339238925993:android:811016faebac0501da5bb8</string>
|
||||||
|
</resources>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?><resources><string name="com.crashlytics.android.build_id" translatable="false">360cc687-20b6-4da1-987e-70daa67adc9c</string></resources>
|
<?xml version="1.0" encoding="utf-8"?><resources><string name="com.crashlytics.android.build_id" translatable="false">cd78cd9b-c719-494b-9593-41184cca43b2</string></resources>
|
||||||
|
|||||||
@@ -1,123 +1,123 @@
|
|||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
--- !u!1 &8702631063239601380
|
--- !u!1 &8702631063239601380
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
serializedVersion: 6
|
serializedVersion: 6
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 6087296153318453413}
|
- component: {fileID: 6087296153318453413}
|
||||||
- component: {fileID: 3031433386932376368}
|
- component: {fileID: 3031433386932376368}
|
||||||
- component: {fileID: 3133524035003936403}
|
- component: {fileID: 3133524035003936403}
|
||||||
- component: {fileID: 6755228158183553068}
|
- component: {fileID: 6755228158183553068}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: fx_first_reward
|
m_Name: fx_first_reward
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
m_Icon: {fileID: 0}
|
m_Icon: {fileID: 0}
|
||||||
m_NavMeshLayer: 0
|
m_NavMeshLayer: 0
|
||||||
m_StaticEditorFlags: 0
|
m_StaticEditorFlags: 0
|
||||||
m_IsActive: 1
|
m_IsActive: 1
|
||||||
--- !u!4 &6087296153318453413
|
--- !u!4 &6087296153318453413
|
||||||
Transform:
|
Transform:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8702631063239601380}
|
m_GameObject: {fileID: 8702631063239601380}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
--- !u!33 &3031433386932376368
|
--- !u!33 &3031433386932376368
|
||||||
MeshFilter:
|
MeshFilter:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8702631063239601380}
|
m_GameObject: {fileID: 8702631063239601380}
|
||||||
m_Mesh: {fileID: 0}
|
m_Mesh: {fileID: 0}
|
||||||
--- !u!23 &3133524035003936403
|
--- !u!23 &3133524035003936403
|
||||||
MeshRenderer:
|
MeshRenderer:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8702631063239601380}
|
m_GameObject: {fileID: 8702631063239601380}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_CastShadows: 1
|
m_CastShadows: 1
|
||||||
m_ReceiveShadows: 1
|
m_ReceiveShadows: 1
|
||||||
m_DynamicOccludee: 1
|
m_DynamicOccludee: 1
|
||||||
m_StaticShadowCaster: 0
|
m_StaticShadowCaster: 0
|
||||||
m_MotionVectors: 1
|
m_MotionVectors: 1
|
||||||
m_LightProbeUsage: 1
|
m_LightProbeUsage: 1
|
||||||
m_ReflectionProbeUsage: 1
|
m_ReflectionProbeUsage: 1
|
||||||
m_RayTracingMode: 2
|
m_RayTracingMode: 2
|
||||||
m_RayTraceProcedural: 0
|
m_RayTraceProcedural: 0
|
||||||
m_RenderingLayerMask: 1
|
m_RenderingLayerMask: 1
|
||||||
m_RendererPriority: 0
|
m_RendererPriority: 0
|
||||||
m_Materials:
|
m_Materials:
|
||||||
- {fileID: 2100000, guid: ddfdf9fc621387e46b34822e5928535a, type: 2}
|
- {fileID: 2100000, guid: ddfdf9fc621387e46b34822e5928535a, type: 2}
|
||||||
m_StaticBatchInfo:
|
m_StaticBatchInfo:
|
||||||
firstSubMesh: 0
|
firstSubMesh: 0
|
||||||
subMeshCount: 0
|
subMeshCount: 0
|
||||||
m_StaticBatchRoot: {fileID: 0}
|
m_StaticBatchRoot: {fileID: 0}
|
||||||
m_ProbeAnchor: {fileID: 0}
|
m_ProbeAnchor: {fileID: 0}
|
||||||
m_LightProbeVolumeOverride: {fileID: 0}
|
m_LightProbeVolumeOverride: {fileID: 0}
|
||||||
m_ScaleInLightmap: 1
|
m_ScaleInLightmap: 1
|
||||||
m_ReceiveGI: 1
|
m_ReceiveGI: 1
|
||||||
m_PreserveUVs: 0
|
m_PreserveUVs: 0
|
||||||
m_IgnoreNormalsForChartDetection: 0
|
m_IgnoreNormalsForChartDetection: 0
|
||||||
m_ImportantGI: 0
|
m_ImportantGI: 0
|
||||||
m_StitchLightmapSeams: 1
|
m_StitchLightmapSeams: 1
|
||||||
m_SelectedEditorRenderState: 3
|
m_SelectedEditorRenderState: 3
|
||||||
m_MinimumChartSize: 4
|
m_MinimumChartSize: 4
|
||||||
m_AutoUVMaxDistance: 0.5
|
m_AutoUVMaxDistance: 0.5
|
||||||
m_AutoUVMaxAngle: 89
|
m_AutoUVMaxAngle: 89
|
||||||
m_LightmapParameters: {fileID: 0}
|
m_LightmapParameters: {fileID: 0}
|
||||||
m_SortingLayerID: 0
|
m_SortingLayerID: 0
|
||||||
m_SortingLayer: 0
|
m_SortingLayer: 0
|
||||||
m_SortingOrder: 0
|
m_SortingOrder: 0
|
||||||
m_AdditionalVertexStreams: {fileID: 0}
|
m_AdditionalVertexStreams: {fileID: 0}
|
||||||
--- !u!114 &6755228158183553068
|
--- !u!114 &6755228158183553068
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 8702631063239601380}
|
m_GameObject: {fileID: 8702631063239601380}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: d247ba06193faa74d9335f5481b2b56c, type: 3}
|
m_Script: {fileID: 11500000, guid: d247ba06193faa74d9335f5481b2b56c, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
skeletonDataAsset: {fileID: 11400000, guid: ff2355adab38616429ea63aa0a3ce8c6, type: 2}
|
skeletonDataAsset: {fileID: 11400000, guid: ff2355adab38616429ea63aa0a3ce8c6, type: 2}
|
||||||
initialSkinName:
|
initialSkinName:
|
||||||
initialFlipX: 0
|
initialFlipX: 0
|
||||||
initialFlipY: 0
|
initialFlipY: 0
|
||||||
updateWhenInvisible: 3
|
updateWhenInvisible: 3
|
||||||
separatorSlotNames: []
|
separatorSlotNames: []
|
||||||
zSpacing: 0
|
zSpacing: 0
|
||||||
useClipping: 1
|
useClipping: 1
|
||||||
immutableTriangles: 0
|
immutableTriangles: 0
|
||||||
pmaVertexColors: 1
|
pmaVertexColors: 1
|
||||||
clearStateOnDisable: 0
|
clearStateOnDisable: 0
|
||||||
tintBlack: 0
|
tintBlack: 0
|
||||||
singleSubmesh: 0
|
singleSubmesh: 0
|
||||||
fixDrawOrder: 0
|
fixDrawOrder: 0
|
||||||
addNormals: 0
|
addNormals: 0
|
||||||
calculateTangents: 0
|
calculateTangents: 0
|
||||||
maskInteraction: 0
|
maskInteraction: 0
|
||||||
maskMaterials:
|
maskMaterials:
|
||||||
materialsMaskDisabled: []
|
materialsMaskDisabled: []
|
||||||
materialsInsideMask: []
|
materialsInsideMask: []
|
||||||
materialsOutsideMask: []
|
materialsOutsideMask: []
|
||||||
disableRenderingOnOverride: 1
|
disableRenderingOnOverride: 1
|
||||||
_animationName:
|
_animationName:
|
||||||
loop: 1
|
loop: 1
|
||||||
timeScale: 1
|
timeScale: 1
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: c13e2d3740e824fc2ba1c4a18f37f906
|
guid: c13e2d3740e824fc2ba1c4a18f37f906
|
||||||
PrefabImporter:
|
PrefabImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName: effect.spine.fx_first_reward.assetbundle
|
assetBundleName: effect.spine.fx_first_reward.assetbundle
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
|
|
||||||
wings_new_rewards.png
|
wings_new_rewards.png
|
||||||
size: 1309,799
|
size: 1309,799
|
||||||
format: RGBA8888
|
format: RGBA8888
|
||||||
filter: Linear,Linear
|
filter: Linear,Linear
|
||||||
repeat: none
|
repeat: none
|
||||||
Bonus
|
Bonus
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 801, 272
|
xy: 801, 272
|
||||||
size: 506, 95
|
size: 506, 95
|
||||||
orig: 506, 95
|
orig: 506, 95
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
baoxiang
|
baoxiang
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 801, 369
|
xy: 801, 369
|
||||||
size: 459, 428
|
size: 459, 428
|
||||||
orig: 459, 428
|
orig: 459, 428
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
light
|
light
|
||||||
rotate: false
|
rotate: false
|
||||||
xy: 2, 2
|
xy: 2, 2
|
||||||
size: 797, 795
|
size: 797, 795
|
||||||
orig: 797, 795
|
orig: 797, 795
|
||||||
offset: 0, 0
|
offset: 0, 0
|
||||||
index: -1
|
index: -1
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 4c92f2a8ec5d5b54c86d63d8048c902e
|
guid: 4c92f2a8ec5d5b54c86d63d8048c902e
|
||||||
TextScriptImporter:
|
TextScriptImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: a5473f0b984615b4297b645f2bb17584
|
guid: a5473f0b984615b4297b645f2bb17584
|
||||||
TextScriptImporter:
|
TextScriptImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|||||||
@@ -1,127 +1,127 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 8b9574ff6f6f0084d9c91bf8e94aa45f
|
guid: 8b9574ff6f6f0084d9c91bf8e94aa45f
|
||||||
TextureImporter:
|
TextureImporter:
|
||||||
internalIDToNameTable: []
|
internalIDToNameTable: []
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
serializedVersion: 13
|
serializedVersion: 13
|
||||||
mipmaps:
|
mipmaps:
|
||||||
mipMapMode: 0
|
mipMapMode: 0
|
||||||
enableMipMap: 0
|
enableMipMap: 0
|
||||||
sRGBTexture: 1
|
sRGBTexture: 1
|
||||||
linearTexture: 0
|
linearTexture: 0
|
||||||
fadeOut: 0
|
fadeOut: 0
|
||||||
borderMipMap: 0
|
borderMipMap: 0
|
||||||
mipMapsPreserveCoverage: 0
|
mipMapsPreserveCoverage: 0
|
||||||
alphaTestReferenceValue: 0.5
|
alphaTestReferenceValue: 0.5
|
||||||
mipMapFadeDistanceStart: 1
|
mipMapFadeDistanceStart: 1
|
||||||
mipMapFadeDistanceEnd: 3
|
mipMapFadeDistanceEnd: 3
|
||||||
bumpmap:
|
bumpmap:
|
||||||
convertToNormalMap: 0
|
convertToNormalMap: 0
|
||||||
externalNormalMap: 0
|
externalNormalMap: 0
|
||||||
heightScale: 0.25
|
heightScale: 0.25
|
||||||
normalMapFilter: 0
|
normalMapFilter: 0
|
||||||
flipGreenChannel: 0
|
flipGreenChannel: 0
|
||||||
isReadable: 0
|
isReadable: 0
|
||||||
streamingMipmaps: 0
|
streamingMipmaps: 0
|
||||||
streamingMipmapsPriority: 0
|
streamingMipmapsPriority: 0
|
||||||
vTOnly: 0
|
vTOnly: 0
|
||||||
ignoreMipmapLimit: 0
|
ignoreMipmapLimit: 0
|
||||||
grayScaleToAlpha: 0
|
grayScaleToAlpha: 0
|
||||||
generateCubemap: 6
|
generateCubemap: 6
|
||||||
cubemapConvolution: 0
|
cubemapConvolution: 0
|
||||||
seamlessCubemap: 0
|
seamlessCubemap: 0
|
||||||
textureFormat: 1
|
textureFormat: 1
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
textureSettings:
|
textureSettings:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
filterMode: 1
|
filterMode: 1
|
||||||
aniso: 1
|
aniso: 1
|
||||||
mipBias: 0
|
mipBias: 0
|
||||||
wrapU: 0
|
wrapU: 0
|
||||||
wrapV: 0
|
wrapV: 0
|
||||||
wrapW: 0
|
wrapW: 0
|
||||||
nPOTScale: 1
|
nPOTScale: 1
|
||||||
lightmap: 0
|
lightmap: 0
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
spriteMode: 0
|
spriteMode: 0
|
||||||
spriteExtrude: 1
|
spriteExtrude: 1
|
||||||
spriteMeshType: 1
|
spriteMeshType: 1
|
||||||
alignment: 0
|
alignment: 0
|
||||||
spritePivot: {x: 0.5, y: 0.5}
|
spritePivot: {x: 0.5, y: 0.5}
|
||||||
spritePixelsToUnits: 100
|
spritePixelsToUnits: 100
|
||||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||||
spriteGenerateFallbackPhysicsShape: 1
|
spriteGenerateFallbackPhysicsShape: 1
|
||||||
alphaUsage: 1
|
alphaUsage: 1
|
||||||
alphaIsTransparency: 0
|
alphaIsTransparency: 0
|
||||||
spriteTessellationDetail: -1
|
spriteTessellationDetail: -1
|
||||||
textureType: 0
|
textureType: 0
|
||||||
textureShape: 1
|
textureShape: 1
|
||||||
singleChannelComponent: 0
|
singleChannelComponent: 0
|
||||||
flipbookRows: 1
|
flipbookRows: 1
|
||||||
flipbookColumns: 1
|
flipbookColumns: 1
|
||||||
maxTextureSizeSet: 0
|
maxTextureSizeSet: 0
|
||||||
compressionQualitySet: 0
|
compressionQualitySet: 0
|
||||||
textureFormatSet: 0
|
textureFormatSet: 0
|
||||||
ignorePngGamma: 0
|
ignorePngGamma: 0
|
||||||
applyGammaDecoding: 0
|
applyGammaDecoding: 0
|
||||||
swizzle: 50462976
|
swizzle: 50462976
|
||||||
cookieLightType: 0
|
cookieLightType: 0
|
||||||
platformSettings:
|
platformSettings:
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: DefaultTexturePlatform
|
buildTarget: DefaultTexturePlatform
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 0
|
textureCompression: 0
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Standalone
|
buildTarget: Standalone
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
resizeAlgorithm: 0
|
resizeAlgorithm: 0
|
||||||
textureFormat: -1
|
textureFormat: -1
|
||||||
textureCompression: 1
|
textureCompression: 1
|
||||||
compressionQuality: 50
|
compressionQuality: 50
|
||||||
crunchedCompression: 0
|
crunchedCompression: 0
|
||||||
allowsAlphaSplitting: 0
|
allowsAlphaSplitting: 0
|
||||||
overridden: 0
|
overridden: 0
|
||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
spriteSheet:
|
spriteSheet:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
sprites: []
|
sprites: []
|
||||||
outline: []
|
outline: []
|
||||||
physicsShape: []
|
physicsShape: []
|
||||||
bones: []
|
bones: []
|
||||||
spriteID:
|
spriteID:
|
||||||
internalID: 0
|
internalID: 0
|
||||||
vertices: []
|
vertices: []
|
||||||
indices:
|
indices:
|
||||||
edges: []
|
edges: []
|
||||||
weights: []
|
weights: []
|
||||||
secondaryTextures: []
|
secondaryTextures: []
|
||||||
nameFileIdTable: {}
|
nameFileIdTable: {}
|
||||||
mipmapLimitGroupName:
|
mipmapLimitGroupName:
|
||||||
pSDRemoveMatte: 0
|
pSDRemoveMatte: 0
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 5191a896aab382147bac9b23f23f1ffa
|
guid: 5191a896aab382147bac9b23f23f1ffa
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 11400000
|
mainObjectFileID: 11400000
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: e8323d0d51b09b64bb266a4cee8b9b87
|
guid: e8323d0d51b09b64bb266a4cee8b9b87
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 2100000
|
mainObjectFileID: 2100000
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|||||||
@@ -1,31 +1,31 @@
|
|||||||
%YAML 1.1
|
%YAML 1.1
|
||||||
%TAG !u! tag:unity3d.com,2011:
|
%TAG !u! tag:unity3d.com,2011:
|
||||||
--- !u!114 &11400000
|
--- !u!114 &11400000
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 0}
|
m_GameObject: {fileID: 0}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: f1b3b4b945939a54ea0b23d3396115fb, type: 3}
|
m_Script: {fileID: 11500000, guid: f1b3b4b945939a54ea0b23d3396115fb, type: 3}
|
||||||
m_Name: wings_new_rewards_SkeletonData
|
m_Name: wings_new_rewards_SkeletonData
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
atlasAssets:
|
atlasAssets:
|
||||||
- {fileID: 11400000, guid: 5191a896aab382147bac9b23f23f1ffa, type: 2}
|
- {fileID: 11400000, guid: 5191a896aab382147bac9b23f23f1ffa, type: 2}
|
||||||
scale: 0.01
|
scale: 0.01
|
||||||
skeletonJSON: {fileID: 4900000, guid: a5473f0b984615b4297b645f2bb17584, type: 3}
|
skeletonJSON: {fileID: 4900000, guid: a5473f0b984615b4297b645f2bb17584, type: 3}
|
||||||
isUpgradingBlendModeMaterials: 0
|
isUpgradingBlendModeMaterials: 0
|
||||||
blendModeMaterials:
|
blendModeMaterials:
|
||||||
requiresBlendModeMaterials: 0
|
requiresBlendModeMaterials: 0
|
||||||
applyAdditiveMaterial: 0
|
applyAdditiveMaterial: 0
|
||||||
additiveMaterials: []
|
additiveMaterials: []
|
||||||
multiplyMaterials: []
|
multiplyMaterials: []
|
||||||
screenMaterials: []
|
screenMaterials: []
|
||||||
skeletonDataModifiers: []
|
skeletonDataModifiers: []
|
||||||
fromAnimation: []
|
fromAnimation: []
|
||||||
toAnimation: []
|
toAnimation: []
|
||||||
duration: []
|
duration: []
|
||||||
defaultMix: 0.2
|
defaultMix: 0.2
|
||||||
controller: {fileID: 0}
|
controller: {fileID: 0}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: ff2355adab38616429ea63aa0a3ce8c6
|
guid: ff2355adab38616429ea63aa0a3ce8c6
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 11400000
|
mainObjectFileID: 11400000
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 1.6 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 784 KiB |
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 4.5 MiB |
|
Before Width: | Height: | Size: 3.3 MiB After Width: | Height: | Size: 4.0 MiB |
|
Before Width: | Height: | Size: 1.5 MiB After Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 2.2 MiB |
@@ -1,140 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: f03717a86352d5a4da9d6269479b879e
|
|
||||||
TextureImporter:
|
|
||||||
internalIDToNameTable: []
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 13
|
|
||||||
mipmaps:
|
|
||||||
mipMapMode: 0
|
|
||||||
enableMipMap: 1
|
|
||||||
sRGBTexture: 1
|
|
||||||
linearTexture: 0
|
|
||||||
fadeOut: 0
|
|
||||||
borderMipMap: 0
|
|
||||||
mipMapsPreserveCoverage: 0
|
|
||||||
alphaTestReferenceValue: 0.5
|
|
||||||
mipMapFadeDistanceStart: 1
|
|
||||||
mipMapFadeDistanceEnd: 3
|
|
||||||
bumpmap:
|
|
||||||
convertToNormalMap: 0
|
|
||||||
externalNormalMap: 0
|
|
||||||
heightScale: 0.25
|
|
||||||
normalMapFilter: 0
|
|
||||||
flipGreenChannel: 0
|
|
||||||
isReadable: 0
|
|
||||||
streamingMipmaps: 0
|
|
||||||
streamingMipmapsPriority: 0
|
|
||||||
vTOnly: 0
|
|
||||||
ignoreMipmapLimit: 0
|
|
||||||
grayScaleToAlpha: 0
|
|
||||||
generateCubemap: 6
|
|
||||||
cubemapConvolution: 0
|
|
||||||
seamlessCubemap: 0
|
|
||||||
textureFormat: 1
|
|
||||||
maxTextureSize: 2048
|
|
||||||
textureSettings:
|
|
||||||
serializedVersion: 2
|
|
||||||
filterMode: 1
|
|
||||||
aniso: 1
|
|
||||||
mipBias: 0
|
|
||||||
wrapU: 0
|
|
||||||
wrapV: 0
|
|
||||||
wrapW: 0
|
|
||||||
nPOTScale: 1
|
|
||||||
lightmap: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
spriteMode: 0
|
|
||||||
spriteExtrude: 1
|
|
||||||
spriteMeshType: 1
|
|
||||||
alignment: 0
|
|
||||||
spritePivot: {x: 0.5, y: 0.5}
|
|
||||||
spritePixelsToUnits: 100
|
|
||||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
spriteGenerateFallbackPhysicsShape: 1
|
|
||||||
alphaUsage: 1
|
|
||||||
alphaIsTransparency: 0
|
|
||||||
spriteTessellationDetail: -1
|
|
||||||
textureType: 0
|
|
||||||
textureShape: 1
|
|
||||||
singleChannelComponent: 0
|
|
||||||
flipbookRows: 1
|
|
||||||
flipbookColumns: 1
|
|
||||||
maxTextureSizeSet: 0
|
|
||||||
compressionQualitySet: 0
|
|
||||||
textureFormatSet: 0
|
|
||||||
ignorePngGamma: 0
|
|
||||||
applyGammaDecoding: 0
|
|
||||||
swizzle: 50462976
|
|
||||||
cookieLightType: 0
|
|
||||||
platformSettings:
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: DefaultTexturePlatform
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Standalone
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: iPhone
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Android
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
|
||||||
serializedVersion: 2
|
|
||||||
sprites: []
|
|
||||||
outline: []
|
|
||||||
physicsShape: []
|
|
||||||
bones: []
|
|
||||||
spriteID:
|
|
||||||
internalID: 0
|
|
||||||
vertices: []
|
|
||||||
indices:
|
|
||||||
edges: []
|
|
||||||
weights: []
|
|
||||||
secondaryTextures: []
|
|
||||||
nameFileIdTable: {}
|
|
||||||
mipmapLimitGroupName:
|
|
||||||
pSDRemoveMatte: 0
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
Before Width: | Height: | Size: 475 KiB After Width: | Height: | Size: 583 KiB |
|
Before Width: | Height: | Size: 643 KiB After Width: | Height: | Size: 2.6 MiB |
|
Before Width: | Height: | Size: 461 KiB After Width: | Height: | Size: 442 KiB |
|
Before Width: | Height: | Size: 212 KiB After Width: | Height: | Size: 208 KiB |
|
Before Width: | Height: | Size: 449 KiB After Width: | Height: | Size: 272 KiB |
|
Before Width: | Height: | Size: 768 KiB After Width: | Height: | Size: 998 KiB |
|
Before Width: | Height: | Size: 679 KiB |
@@ -1,127 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 1e89d0d8dd25bab4782eb767ea77b1f0
|
|
||||||
TextureImporter:
|
|
||||||
internalIDToNameTable: []
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 13
|
|
||||||
mipmaps:
|
|
||||||
mipMapMode: 0
|
|
||||||
enableMipMap: 1
|
|
||||||
sRGBTexture: 1
|
|
||||||
linearTexture: 0
|
|
||||||
fadeOut: 0
|
|
||||||
borderMipMap: 0
|
|
||||||
mipMapsPreserveCoverage: 0
|
|
||||||
alphaTestReferenceValue: 0.5
|
|
||||||
mipMapFadeDistanceStart: 1
|
|
||||||
mipMapFadeDistanceEnd: 3
|
|
||||||
bumpmap:
|
|
||||||
convertToNormalMap: 0
|
|
||||||
externalNormalMap: 0
|
|
||||||
heightScale: 0.25
|
|
||||||
normalMapFilter: 0
|
|
||||||
flipGreenChannel: 0
|
|
||||||
isReadable: 0
|
|
||||||
streamingMipmaps: 0
|
|
||||||
streamingMipmapsPriority: 0
|
|
||||||
vTOnly: 0
|
|
||||||
ignoreMipmapLimit: 0
|
|
||||||
grayScaleToAlpha: 0
|
|
||||||
generateCubemap: 6
|
|
||||||
cubemapConvolution: 0
|
|
||||||
seamlessCubemap: 0
|
|
||||||
textureFormat: 1
|
|
||||||
maxTextureSize: 2048
|
|
||||||
textureSettings:
|
|
||||||
serializedVersion: 2
|
|
||||||
filterMode: 1
|
|
||||||
aniso: 1
|
|
||||||
mipBias: 0
|
|
||||||
wrapU: 0
|
|
||||||
wrapV: 0
|
|
||||||
wrapW: 0
|
|
||||||
nPOTScale: 1
|
|
||||||
lightmap: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
spriteMode: 0
|
|
||||||
spriteExtrude: 1
|
|
||||||
spriteMeshType: 1
|
|
||||||
alignment: 0
|
|
||||||
spritePivot: {x: 0.5, y: 0.5}
|
|
||||||
spritePixelsToUnits: 100
|
|
||||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
spriteGenerateFallbackPhysicsShape: 1
|
|
||||||
alphaUsage: 1
|
|
||||||
alphaIsTransparency: 0
|
|
||||||
spriteTessellationDetail: -1
|
|
||||||
textureType: 0
|
|
||||||
textureShape: 1
|
|
||||||
singleChannelComponent: 0
|
|
||||||
flipbookRows: 1
|
|
||||||
flipbookColumns: 1
|
|
||||||
maxTextureSizeSet: 0
|
|
||||||
compressionQualitySet: 0
|
|
||||||
textureFormatSet: 0
|
|
||||||
ignorePngGamma: 0
|
|
||||||
applyGammaDecoding: 0
|
|
||||||
swizzle: 50462976
|
|
||||||
cookieLightType: 0
|
|
||||||
platformSettings:
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: DefaultTexturePlatform
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Standalone
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Android
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
|
||||||
serializedVersion: 2
|
|
||||||
sprites: []
|
|
||||||
outline: []
|
|
||||||
physicsShape: []
|
|
||||||
bones: []
|
|
||||||
spriteID:
|
|
||||||
internalID: 0
|
|
||||||
vertices: []
|
|
||||||
indices:
|
|
||||||
edges: []
|
|
||||||
weights: []
|
|
||||||
secondaryTextures: []
|
|
||||||
nameFileIdTable: {}
|
|
||||||
mipmapLimitGroupName:
|
|
||||||
pSDRemoveMatte: 0
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 7.0 MiB After Width: | Height: | Size: 7.5 MiB |
|
Before Width: | Height: | Size: 3.1 MiB After Width: | Height: | Size: 5.8 MiB |
|
Before Width: | Height: | Size: 8.3 MiB |
@@ -1,127 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 770110aaf5a0d0641883e7438d2273ff
|
|
||||||
TextureImporter:
|
|
||||||
internalIDToNameTable: []
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 13
|
|
||||||
mipmaps:
|
|
||||||
mipMapMode: 0
|
|
||||||
enableMipMap: 1
|
|
||||||
sRGBTexture: 1
|
|
||||||
linearTexture: 0
|
|
||||||
fadeOut: 0
|
|
||||||
borderMipMap: 0
|
|
||||||
mipMapsPreserveCoverage: 0
|
|
||||||
alphaTestReferenceValue: 0.5
|
|
||||||
mipMapFadeDistanceStart: 1
|
|
||||||
mipMapFadeDistanceEnd: 3
|
|
||||||
bumpmap:
|
|
||||||
convertToNormalMap: 0
|
|
||||||
externalNormalMap: 0
|
|
||||||
heightScale: 0.25
|
|
||||||
normalMapFilter: 0
|
|
||||||
flipGreenChannel: 0
|
|
||||||
isReadable: 0
|
|
||||||
streamingMipmaps: 0
|
|
||||||
streamingMipmapsPriority: 0
|
|
||||||
vTOnly: 0
|
|
||||||
ignoreMipmapLimit: 0
|
|
||||||
grayScaleToAlpha: 0
|
|
||||||
generateCubemap: 6
|
|
||||||
cubemapConvolution: 0
|
|
||||||
seamlessCubemap: 0
|
|
||||||
textureFormat: 1
|
|
||||||
maxTextureSize: 2048
|
|
||||||
textureSettings:
|
|
||||||
serializedVersion: 2
|
|
||||||
filterMode: 1
|
|
||||||
aniso: 1
|
|
||||||
mipBias: 0
|
|
||||||
wrapU: 0
|
|
||||||
wrapV: 0
|
|
||||||
wrapW: 0
|
|
||||||
nPOTScale: 1
|
|
||||||
lightmap: 0
|
|
||||||
compressionQuality: 50
|
|
||||||
spriteMode: 0
|
|
||||||
spriteExtrude: 1
|
|
||||||
spriteMeshType: 1
|
|
||||||
alignment: 0
|
|
||||||
spritePivot: {x: 0.5, y: 0.5}
|
|
||||||
spritePixelsToUnits: 100
|
|
||||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
|
||||||
spriteGenerateFallbackPhysicsShape: 1
|
|
||||||
alphaUsage: 1
|
|
||||||
alphaIsTransparency: 0
|
|
||||||
spriteTessellationDetail: -1
|
|
||||||
textureType: 0
|
|
||||||
textureShape: 1
|
|
||||||
singleChannelComponent: 0
|
|
||||||
flipbookRows: 1
|
|
||||||
flipbookColumns: 1
|
|
||||||
maxTextureSizeSet: 0
|
|
||||||
compressionQualitySet: 0
|
|
||||||
textureFormatSet: 0
|
|
||||||
ignorePngGamma: 0
|
|
||||||
applyGammaDecoding: 0
|
|
||||||
swizzle: 50462976
|
|
||||||
cookieLightType: 0
|
|
||||||
platformSettings:
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: DefaultTexturePlatform
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Standalone
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
- serializedVersion: 3
|
|
||||||
buildTarget: Android
|
|
||||||
maxTextureSize: 2048
|
|
||||||
resizeAlgorithm: 0
|
|
||||||
textureFormat: -1
|
|
||||||
textureCompression: 1
|
|
||||||
compressionQuality: 50
|
|
||||||
crunchedCompression: 0
|
|
||||||
allowsAlphaSplitting: 0
|
|
||||||
overridden: 0
|
|
||||||
ignorePlatformSupport: 0
|
|
||||||
androidETC2FallbackOverride: 0
|
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
|
||||||
spriteSheet:
|
|
||||||
serializedVersion: 2
|
|
||||||
sprites: []
|
|
||||||
outline: []
|
|
||||||
physicsShape: []
|
|
||||||
bones: []
|
|
||||||
spriteID:
|
|
||||||
internalID: 0
|
|
||||||
vertices: []
|
|
||||||
indices:
|
|
||||||
edges: []
|
|
||||||
weights: []
|
|
||||||
secondaryTextures: []
|
|
||||||
nameFileIdTable: {}
|
|
||||||
mipmapLimitGroupName:
|
|
||||||
pSDRemoveMatte: 0
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
|
Before Width: | Height: | Size: 479 KiB After Width: | Height: | Size: 483 KiB |
@@ -106,6 +106,19 @@ TextureImporter:
|
|||||||
ignorePlatformSupport: 0
|
ignorePlatformSupport: 0
|
||||||
androidETC2FallbackOverride: 0
|
androidETC2FallbackOverride: 0
|
||||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
|
- serializedVersion: 3
|
||||||
|
buildTarget: WebGL
|
||||||
|
maxTextureSize: 2048
|
||||||
|
resizeAlgorithm: 0
|
||||||
|
textureFormat: -1
|
||||||
|
textureCompression: 1
|
||||||
|
compressionQuality: 50
|
||||||
|
crunchedCompression: 0
|
||||||
|
allowsAlphaSplitting: 0
|
||||||
|
overridden: 0
|
||||||
|
ignorePlatformSupport: 0
|
||||||
|
androidETC2FallbackOverride: 0
|
||||||
|
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||||
- serializedVersion: 3
|
- serializedVersion: 3
|
||||||
buildTarget: Android
|
buildTarget: Android
|
||||||
maxTextureSize: 2048
|
maxTextureSize: 2048
|
||||||
|
|||||||
@@ -1,281 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using DataEyeAnalytics;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using UnityEngine;
|
|
||||||
|
|
||||||
namespace BallKingdomCrush
|
|
||||||
{
|
|
||||||
public class BIManager : MonoBehaviour
|
|
||||||
{
|
|
||||||
private static BIManager _instance;
|
|
||||||
private static readonly object _initLock = new object();
|
|
||||||
|
|
||||||
// 状态标志
|
|
||||||
private bool _initialized = false; // 仅在初始化成功后为 true
|
|
||||||
private bool _initializing = false; // 防止并发多次尝试初始化
|
|
||||||
|
|
||||||
|
|
||||||
private string ntpServer = "time.windows.com";
|
|
||||||
private string defaultChannel = "gp";
|
|
||||||
private int maxInitRetries = 6;
|
|
||||||
private float retryIntervalSeconds = 0.5f;
|
|
||||||
|
|
||||||
public static BIManager Instance
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_instance == null)
|
|
||||||
{
|
|
||||||
var go = new GameObject("BIManager");
|
|
||||||
DontDestroyOnLoad(go);
|
|
||||||
_instance = go.AddComponent<BIManager>();
|
|
||||||
}
|
|
||||||
|
|
||||||
return _instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Awake()
|
|
||||||
{
|
|
||||||
// 单例保护:如果场景里已有实例,销毁重复的
|
|
||||||
if (_instance == null)
|
|
||||||
{
|
|
||||||
_instance = this;
|
|
||||||
DontDestroyOnLoad(gameObject);
|
|
||||||
}
|
|
||||||
else if (_instance != this)
|
|
||||||
{
|
|
||||||
Destroy(gameObject);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Start()
|
|
||||||
{
|
|
||||||
// Start 调用 InitBI 是安全的:InitBI 本身是幂等且线程安全的
|
|
||||||
InitBI();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 对外统一初始化入口(幂等、线程安全)
|
|
||||||
/// </summary>
|
|
||||||
public void InitBI()
|
|
||||||
{
|
|
||||||
// 快速检查
|
|
||||||
if (_initialized) return;
|
|
||||||
|
|
||||||
lock (_initLock)
|
|
||||||
{
|
|
||||||
if (_initialized || _initializing)
|
|
||||||
{
|
|
||||||
// 已经初始化或正在初始化,直接返回
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_initializing = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 使用协程执行初始化(必要时可以做重试)
|
|
||||||
StartCoroutine(DoInitCoroutine());
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerator DoInitCoroutine()
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
int attempt = 0;
|
|
||||||
Exception lastException = null;
|
|
||||||
|
|
||||||
while (attempt < maxInitRetries)
|
|
||||||
{
|
|
||||||
attempt++;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
// 这里不主动调用 DataEyeAnalyticsAPI.Init(...) 假设你使用的是场景里的 DataEyeAnalytics 预制体,
|
|
||||||
// SDK 会在预制体 Awake/Start 里初始化。如果你的流程是手动 Init,请在这里调用 Init(appId)。
|
|
||||||
|
|
||||||
// 1) 校准时间(默认实例)
|
|
||||||
DataEyeAnalyticsAPI.CalibrateTimeWithNtp(ntpServer);
|
|
||||||
|
|
||||||
// 2) 设置超参数
|
|
||||||
var superProperties = new Dictionary<string, object>
|
|
||||||
{
|
|
||||||
{ "channel", defaultChannel }
|
|
||||||
};
|
|
||||||
DataEyeAnalyticsAPI.SetSuperProperties(superProperties);
|
|
||||||
|
|
||||||
// 3) 开启自动采集
|
|
||||||
DataEyeAnalyticsAPI.EnableAutoTrack(AUTO_TRACK_EVENTS.ALL);
|
|
||||||
|
|
||||||
// 如果上面没有抛异常,认为初始化成功
|
|
||||||
_initialized = true;
|
|
||||||
Debug.Log($"[BIManager] InitBI succeeded on attempt {attempt}");
|
|
||||||
yield break;
|
|
||||||
}
|
|
||||||
catch (ArgumentNullException ane)
|
|
||||||
{
|
|
||||||
// 典型:DataEye 内部 instance 还没创建(appId 为 null) -> retry
|
|
||||||
lastException = ane;
|
|
||||||
Debug.LogWarning(
|
|
||||||
$"[BIManager] DataEye not ready (attempt {attempt}), will retry. msg={ane.Message}");
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
// 其他异常,记录并决定是否重试
|
|
||||||
lastException = ex;
|
|
||||||
Debug.LogWarning($"[BIManager] InitBI attempt {attempt} threw: {ex.Message}");
|
|
||||||
}
|
|
||||||
|
|
||||||
// 等待后重试
|
|
||||||
yield return new WaitForSeconds(retryIntervalSeconds);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 重试用尽仍失败 —— 打日志(不再抛异常以免影响游戏流程)
|
|
||||||
Debug.LogError("[BIManager] InitBI failed after retries. Last exception: " +
|
|
||||||
(lastException?.ToString() ?? "null"));
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
lock (_initLock)
|
|
||||||
{
|
|
||||||
_initializing = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ================= 通用埋点 =================
|
|
||||||
public void TrackEvent(string eventName, Dictionary<string, object> properties = null)
|
|
||||||
{
|
|
||||||
// if (properties == null)
|
|
||||||
// properties = new Dictionary<string, object>();
|
|
||||||
//
|
|
||||||
// DataEyeAnalyticsAPI.Track(eventName, properties);
|
|
||||||
// DataEyeAnalyticsAPI.Flush();
|
|
||||||
//
|
|
||||||
// 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
|
|
||||||
}
|
|
||||||
@@ -64,9 +64,12 @@ public class CreatAnimalCard : MonoBehaviour
|
|||||||
card_item_list.Clear();
|
card_item_list.Clear();
|
||||||
|
|
||||||
// ---------- 新增:先从0~15中挑选 card_type_max 个不同的类型 ----------
|
// ---------- 新增:先从0~15中挑选 card_type_max 个不同的类型 ----------
|
||||||
List<int> allTypes = Enumerable.Range(0, 15).ToList(); // [0,1,2,...,15]
|
List<int> allTypes = Enumerable.Range(0, 15).ToList(); // [0,1,2,...,14]
|
||||||
List<int> chosenTypes = new List<int>();
|
List<int> chosenTypes = new List<int>();
|
||||||
for (int i = 0; i < card_type_max; i++)
|
|
||||||
|
int actualTypeMax = Mathf.Min(card_type_max, allTypes.Count);
|
||||||
|
|
||||||
|
for (int i = 0; i < actualTypeMax; i++)
|
||||||
{
|
{
|
||||||
int idx = UnityEngine.Random.Range(0, allTypes.Count);
|
int idx = UnityEngine.Random.Range(0, allTypes.Count);
|
||||||
chosenTypes.Add(allTypes[idx]);
|
chosenTypes.Add(allTypes[idx]);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
// 请将商品 ID 替换为你在 App Store Connect / Google Play Console 中配置的真实 ID。
|
// 请将商品 ID 替换为你在 App Store Connect / Google Play Console 中配置的真实 ID。
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using SDK_IAP;
|
using SDK_IAP;
|
||||||
@@ -196,7 +197,7 @@ namespace BallKingdomCrush
|
|||||||
if (result.success)
|
if (result.success)
|
||||||
{
|
{
|
||||||
Debug.Log($"[IAP Google] 订阅成功: {subscriptionName} ({result.productId}) | tid={result.transactionId}");
|
Debug.Log($"[IAP Google] 订阅成功: {subscriptionName} ({result.productId}) | tid={result.transactionId}");
|
||||||
ShowSubscriptionInfo();
|
// ShowSubscriptionInfo();
|
||||||
onSuccess?.Invoke();
|
onSuccess?.Invoke();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -269,20 +270,59 @@ namespace BallKingdomCrush
|
|||||||
// ──────────────────────────────────────────────────────────
|
// ──────────────────────────────────────────────────────────
|
||||||
// 订阅信息查询
|
// 订阅信息查询
|
||||||
// ──────────────────────────────────────────────────────────
|
// ──────────────────────────────────────────────────────────
|
||||||
public void ShowSubscriptionInfo()
|
/// <summary>显示指定商品的订阅信息</summary>
|
||||||
|
/// <param name="productId">商品ID</param>
|
||||||
|
public void ShowSubscriptionInfo(string productId)
|
||||||
{
|
{
|
||||||
var info = IAPManager.GetSubscriptionInfo(PRODUCT_VIP_MONTH);
|
var info = IAPManager.GetSubscriptionInfo(productId);
|
||||||
Debug.Log($"[IAP Google] VIP 订阅状态:");
|
Debug.Log($"[IAP Google] VIP 订阅状态 ({productId}):");
|
||||||
Debug.Log($" isSubscribed = {info.isSubscribed}");
|
Debug.Log($" isSubscribed = {info.isSubscribed}");
|
||||||
Debug.Log($" isExpired = {info.isExpired}");
|
Debug.Log($" isExpired = {info.isExpired}");
|
||||||
Debug.Log($" expireDate = {info.expireDate:yyyy-MM-dd HH:mm:ss}");
|
Debug.Log($" expireDate = {info.expireDate}");
|
||||||
Debug.Log($" isAutoRenewing= {info.isAutoRenewing}");
|
Debug.Log($" isAutoRenewing= {info.isAutoRenewing}");
|
||||||
|
|
||||||
|
if (info.isSubscribed && !info.isExpired)
|
||||||
|
{
|
||||||
|
int vipLevel = GetVipLevelByProductId(productId);
|
||||||
|
if (vipLevel > 0)
|
||||||
|
{
|
||||||
|
DataMgr.VipLevel.Value = vipLevel;
|
||||||
|
Debug.Log($"[IAP Google] 设置 VIP 等级: {vipLevel}");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (info.expireDate.Year > 1970 && info.expireDate.Year < 10000)
|
||||||
|
{
|
||||||
|
var expireTimestamp = ((DateTimeOffset)info.expireDate).ToUnixTimeSeconds();
|
||||||
|
Debug.Log($"Expire timestamp: {expireTimestamp}");
|
||||||
|
DataMgr.VipExpirationTime.Value = Math.Max(DataMgr.VipExpirationTime.Value, expireTimestamp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"[IAP Google] 无效的到期时间: {info.expireDate}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.Log($"[IAP Google] 用户未订阅或订阅已过期");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/// <summary>根据商品ID获取VIP等级</summary>
|
||||||
|
/// <param name="productId">商品ID</param>
|
||||||
|
/// <returns>VIP等级:周订阅=1,月订阅=2,年订阅=3,其他=0</returns>
|
||||||
|
private int GetVipLevelByProductId(string productId)
|
||||||
|
{
|
||||||
|
if (productId == PRODUCT_VIP_WEEK)
|
||||||
|
return 1;
|
||||||
|
else if (productId == PRODUCT_VIP_MONTH)
|
||||||
|
return 2;
|
||||||
|
else if (productId == PRODUCT_VIP_YEAR)
|
||||||
|
return 3;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ──────────────────────────────────────────────────────────
|
// ──────────────────────────────────────────────────────────
|
||||||
// 全局发货处理(OnDeliver 事件接收)
|
// 全局发货处理(OnDeliver 事件接收)
|
||||||
// ──────────────────────────────────────────────────────────
|
// ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 统一发货处理入口。
|
/// 统一发货处理入口。
|
||||||
/// 无论是新购买、补单、还是恢复购买,都会触发此方法。
|
/// 无论是新购买、补单、还是恢复购买,都会触发此方法。
|
||||||
@@ -290,97 +330,242 @@ namespace BallKingdomCrush
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void HandleDeliver(string productId)
|
private void HandleDeliver(string productId)
|
||||||
{
|
{
|
||||||
|
|
||||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
|
||||||
|
|
||||||
if (!IsValidProduct(productId))
|
if (!IsValidProduct(productId))
|
||||||
{
|
{
|
||||||
Debug.LogWarning($"[IAP Google] 非法商品ID,拒绝发货: {productId}");
|
Debug.LogWarning($"[IAP Google] 非法商品ID,拒绝发货: {productId}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Debug.Log($"[IAP Google] 发货通知: {productId}");
|
|
||||||
|
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.IAP_PAY_SUCCESS, productId);
|
if (productId == PRODUCT_VIP_WEEK || productId == PRODUCT_VIP_MONTH || productId == PRODUCT_VIP_YEAR)
|
||||||
|
{
|
||||||
PurchasingManager.SendEventClickByName(productId,"open");
|
// 订阅商品:需要先获取有效的订阅信息,成功后才会分发支付成功消息
|
||||||
PurchasingManager.SendEventClickByName(productId,"success");
|
StartCoroutine(DelayedGetSubscriptionInfo(productId));
|
||||||
|
}
|
||||||
// switch (productId)
|
else
|
||||||
// {
|
{
|
||||||
// // 消耗品
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
||||||
// case PRODUCT_FIRST_GIFT:
|
|
||||||
// Debug.Log("[IAP Google] 发放首充礼包 - 100金币");
|
// 非订阅商品(消耗品):直接发货
|
||||||
// // GoldManager.Add(100);
|
Debug.Log($"[IAP Google] 发货通知: {productId}");
|
||||||
// break;
|
GameDispatcher.Instance.Dispatch(GameMsg.IAP_PAY_SUCCESS, productId);
|
||||||
//
|
PurchasingManager.SendEventClickByName(productId, "open");
|
||||||
// case PRODUCT_REMOVE_ADS:
|
PurchasingManager.SendEventClickByName(productId, "success");
|
||||||
// Debug.Log("[IAP Google] 发放移除广告权益");
|
}
|
||||||
// // AdsManager.Disable();
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case PRODUCT_PASS_BONUS:
|
|
||||||
// Debug.Log("[IAP Google] 发放通行证礼包");
|
|
||||||
// // PassBonusManager.Grant();
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case PRODUCT_SHOP_1:
|
|
||||||
// Debug.Log("[IAP Google] 发放商店档位1奖励");
|
|
||||||
// // ShopManager.GrantReward(1);
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case PRODUCT_SHOP_2:
|
|
||||||
// Debug.Log("[IAP Google] 发放商店档位2奖励");
|
|
||||||
// // ShopManager.GrantReward(2);
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case PRODUCT_SHOP_3:
|
|
||||||
// Debug.Log("[IAP Google] 发放商店档位3奖励");
|
|
||||||
// // ShopManager.GrantReward(3);
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case PRODUCT_SHOP_4:
|
|
||||||
// Debug.Log("[IAP Google] 发放商店档位4奖励");
|
|
||||||
// // ShopManager.GrantReward(4);
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case PRODUCT_SHOP_5:
|
|
||||||
// Debug.Log("[IAP Google] 发放商店档位5奖励");
|
|
||||||
// // ShopManager.GrantReward(5);
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case PRODUCT_THREE_DAY:
|
|
||||||
// Debug.Log("[IAP Google] 发放三天礼包");
|
|
||||||
// // ThreeDayManager.Grant();
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// // 非消耗品
|
|
||||||
// case PRODUCT_SPACE_BONUS:
|
|
||||||
// Debug.Log("[IAP Google] 增加背包空间一格");
|
|
||||||
// // InventoryManager.AddSpace(1);
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// // 订阅
|
|
||||||
// case PRODUCT_VIP_WEEK:
|
|
||||||
// Debug.Log("[IAP Google] 激活VIP周卡");
|
|
||||||
// // VipManager.Activate(7);
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case PRODUCT_VIP_MONTH:
|
|
||||||
// Debug.Log("[IAP Google] 激活VIP月卡");
|
|
||||||
// // VipManager.Activate(30);
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// case PRODUCT_VIP_YEAR:
|
|
||||||
// Debug.Log("[IAP Google] 激活VIP年卡");
|
|
||||||
// // VipManager.Activate(365);
|
|
||||||
// break;
|
|
||||||
//
|
|
||||||
// default:
|
|
||||||
// Debug.LogWarning($"[IAP Google] 未知商品 ID: {productId}");
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private IEnumerator DelayedGetSubscriptionInfo(string productId)
|
||||||
|
{
|
||||||
|
Debug.Log($"[IAP Google] 开始获取订阅信息: {productId}");
|
||||||
|
|
||||||
|
// 先尝试立即获取一次
|
||||||
|
var immediateInfo = IAPManager.GetSubscriptionInfo(productId);
|
||||||
|
|
||||||
|
// 检查是否是无效数据
|
||||||
|
bool isInvalid = immediateInfo.expireDate == default(DateTime) ||
|
||||||
|
(immediateInfo.expireDate.Year == 1 && !immediateInfo.isSubscribed);
|
||||||
|
|
||||||
|
if (!isInvalid && immediateInfo.isSubscribed)
|
||||||
|
{
|
||||||
|
// 立即获取到了有效数据,直接处理
|
||||||
|
bool success = ProcessSubscriptionInfo(immediateInfo, productId);
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
DispatchPaySuccess(productId);
|
||||||
|
}
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 无效数据,开始重试
|
||||||
|
Debug.Log($"[IAP Google] 订阅信息未就绪,开始重试...");
|
||||||
|
|
||||||
|
int maxRetries = 5;
|
||||||
|
float waitTime = 1.5f;
|
||||||
|
for (int i = 0; i < maxRetries; i++)
|
||||||
|
{
|
||||||
|
yield return new WaitForSeconds(waitTime); // 每次等待0.5秒
|
||||||
|
|
||||||
|
var info = IAPManager.GetSubscriptionInfo(productId);
|
||||||
|
|
||||||
|
if (info.isSubscribed && !info.isExpired && info.expireDate.Year > 1970)
|
||||||
|
{
|
||||||
|
Debug.Log($"[IAP Google] 订阅信息获取成功 (重试 {i + 1} 次)");
|
||||||
|
bool success = ProcessSubscriptionInfo(info, productId);
|
||||||
|
if (success)
|
||||||
|
{
|
||||||
|
DispatchPaySuccess(productId);
|
||||||
|
}
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
|
||||||
|
Debug.Log($"[IAP Google] 第 {i + 1} 次重试: isSubscribed={info.isSubscribed}, isExpired={info.isExpired}, expireDate={info.expireDate}");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 所有重试都失败了,使用降级方案
|
||||||
|
Debug.LogError($"[IAP Google] 无法获取订阅信息,使用降级方案");
|
||||||
|
bool fallbackSuccess = ProcessFallbackSubscription(productId);
|
||||||
|
if (fallbackSuccess)
|
||||||
|
{
|
||||||
|
DispatchPaySuccess(productId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 降级也失败了,上报错误,不分发支付成功
|
||||||
|
Debug.LogError($"[IAP Google] 降级方案也失败,支付成功消息将不分发,请检查配置");
|
||||||
|
PurchasingManager.SendEventClickByName(productId, "open");
|
||||||
|
// 可选:向用户显示错误提示
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 处理订阅信息,设置VIP等级和过期时间
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>是否设置成功</returns>
|
||||||
|
private bool ProcessSubscriptionInfo(SubscriptionInfoLite info, string productId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Debug.Log($"[IAP Google] VIP 订阅状态 ({productId}):");
|
||||||
|
Debug.Log($" isSubscribed = {info.isSubscribed}");
|
||||||
|
Debug.Log($" isExpired = {info.isExpired}");
|
||||||
|
Debug.Log($" expireDate = {info.expireDate}");
|
||||||
|
Debug.Log($" isAutoRenewing= {info.isAutoRenewing}");
|
||||||
|
|
||||||
|
// 获取VIP等级
|
||||||
|
int vipLevel = GetVipLevelByProductId(productId);
|
||||||
|
if (vipLevel <= 0)
|
||||||
|
{
|
||||||
|
Debug.LogError($"[IAP Google] 无法获取VIP等级,商品ID: {productId}");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取过期时间戳
|
||||||
|
long expireTimestamp = 0;
|
||||||
|
if (info.expireDate.Year > 1970 && info.expireDate.Year < 10000)
|
||||||
|
{
|
||||||
|
expireTimestamp = ((DateTimeOffset)info.expireDate).ToUnixTimeSeconds();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"[IAP Google] 无效的到期时间: {info.expireDate},使用预估时间");
|
||||||
|
expireTimestamp = GetEstimatedExpireTimestamp(productId);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (expireTimestamp <= 0)
|
||||||
|
{
|
||||||
|
Debug.LogError($"[IAP Google] 无法获取有效的过期时间戳");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 保存数据(使用前后对比,确保设置成功)
|
||||||
|
int oldVipLevel = DataMgr.VipLevel.Value;
|
||||||
|
long oldExpireTime = DataMgr.VipExpirationTime.Value;
|
||||||
|
|
||||||
|
DataMgr.VipLevel.Value = Math.Max(DataMgr.VipLevel.Value, vipLevel);
|
||||||
|
DataMgr.VipExpirationTime.Value = Math.Max(DataMgr.VipExpirationTime.Value, expireTimestamp);
|
||||||
|
|
||||||
|
// 验证设置是否成功
|
||||||
|
bool vipLevelSuccess = DataMgr.VipLevel.Value >= vipLevel;
|
||||||
|
bool expireTimeSuccess = DataMgr.VipExpirationTime.Value >= expireTimestamp;
|
||||||
|
|
||||||
|
if (vipLevelSuccess && expireTimeSuccess)
|
||||||
|
{
|
||||||
|
Debug.Log($"[IAP Google] VIP设置成功 - 等级: {vipLevel} (原:{oldVipLevel}), 过期时间: {expireTimestamp} (原:{oldExpireTime})");
|
||||||
|
|
||||||
|
// 可选:触发VIP状态更新事件
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Debug.LogError($"[IAP Google] VIP设置失败 - 等级设置: {vipLevelSuccess}, 过期时间设置: {expireTimeSuccess}");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.LogError($"[IAP Google] 处理订阅信息时发生异常: {e.Message}\n{e.StackTrace}");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 降级方案:当无法从商店获取订阅信息时,根据商品类型估算VIP信息
|
||||||
|
/// </summary>
|
||||||
|
private bool ProcessFallbackSubscription(string productId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Debug.LogWarning($"[IAP Google] 执行降级方案: {productId}");
|
||||||
|
|
||||||
|
int vipLevel = GetVipLevelByProductId(productId);
|
||||||
|
if (vipLevel <= 0)
|
||||||
|
{
|
||||||
|
Debug.LogError($"[IAP Google] 降级方案失败 - 无法获取VIP等级");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
long expireTimestamp = GetEstimatedExpireTimestamp(productId);
|
||||||
|
if (expireTimestamp <= 0)
|
||||||
|
{
|
||||||
|
Debug.LogError($"[IAP Google] 降级方案失败 - 无法获取预估过期时间");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置VIP信息
|
||||||
|
DataMgr.VipLevel.Value = Math.Max(DataMgr.VipLevel.Value, vipLevel);
|
||||||
|
DataMgr.VipExpirationTime.Value = Math.Max(DataMgr.VipExpirationTime.Value, expireTimestamp);
|
||||||
|
|
||||||
|
Debug.Log($"[IAP Google] 降级方案成功 - 等级: {vipLevel}, 过期时间: {expireTimestamp}");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Debug.LogError($"[IAP Google] 降级方案异常: {e.Message}");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 获取预估的过期时间戳
|
||||||
|
/// </summary>
|
||||||
|
private long GetEstimatedExpireTimestamp(string productId)
|
||||||
|
{
|
||||||
|
TimeSpan duration;
|
||||||
|
if (productId == PRODUCT_VIP_WEEK)
|
||||||
|
{
|
||||||
|
duration = TimeSpan.FromDays(7);
|
||||||
|
}
|
||||||
|
else if (productId == PRODUCT_VIP_MONTH)
|
||||||
|
{
|
||||||
|
duration = TimeSpan.FromDays(30);
|
||||||
|
}
|
||||||
|
else if (productId == PRODUCT_VIP_YEAR)
|
||||||
|
{
|
||||||
|
duration = TimeSpan.FromDays(365);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
duration = TimeSpan.FromDays(30);
|
||||||
|
}
|
||||||
|
|
||||||
|
var expireDate = DateTime.UtcNow.Add(duration);
|
||||||
|
return ((DateTimeOffset)expireDate).ToUnixTimeSeconds();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 分发支付成功消息(统一出口)
|
||||||
|
/// </summary>
|
||||||
|
private void DispatchPaySuccess(string productId)
|
||||||
|
{
|
||||||
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
||||||
|
|
||||||
|
Debug.Log($"[IAP Google] 支付成功并完成发货: {productId}");
|
||||||
|
GameDispatcher.Instance.Dispatch(GameMsg.IAP_PAY_SUCCESS, productId);
|
||||||
|
PurchasingManager.SendEventClickByName(productId, "open");
|
||||||
|
PurchasingManager.SendEventClickByName(productId, "success");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>验证商品ID是否为已定义的有效商品</summary>
|
/// <summary>验证商品ID是否为已定义的有效商品</summary>
|
||||||
/// <param name="productId">商品ID</param>
|
/// <param name="productId">商品ID</param>
|
||||||
/// <returns>是否为有效商品</returns>
|
/// <returns>是否为有效商品</returns>
|
||||||
|
|||||||
@@ -38,8 +38,8 @@ public class LoveLegendRoot : MonoBehaviour
|
|||||||
App.InitApplication(SuperApplication.Instance);
|
App.InitApplication(SuperApplication.Instance);
|
||||||
NetworkManager.haveSimCard = HasSIMCard();
|
NetworkManager.haveSimCard = HasSIMCard();
|
||||||
|
|
||||||
MarkdownKit.Instance.LoadText("privacy", "https://official.piggyhydration.com/privacy.md");
|
MarkdownKit.Instance.LoadText("privacy", "https://www.ballcrushbest.com/privacy.md");
|
||||||
MarkdownKit.Instance.LoadText("user", "https://official.piggyhydration.com/user.md");
|
MarkdownKit.Instance.LoadText("user", "https://www.ballcrushbest.com/user.md");
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string adInfoLabel = "";
|
private static string adInfoLabel = "";
|
||||||
|
|||||||
@@ -537,7 +537,7 @@ public class MaxPayManager
|
|||||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
||||||
// Debug.LogWarning("OnPurchaseFailedproduct:" + product.transactionID + " failureReason:" + failureReason);
|
// Debug.LogWarning("OnPurchaseFailedproduct:" + product.transactionID + " failureReason:" + failureReason);
|
||||||
|
|
||||||
BIManager.Instance.TrackPurchase(paydata.amount, paydata.currency, "1", paydata.sku, "paid_err");
|
// 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; });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,462 +1,462 @@
|
|||||||
|
|
||||||
using FGUI.ZM_Common_01;
|
using FGUI.ZM_Common_01;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using FairyGUI;
|
using FairyGUI;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using FGUI.LG_albums;
|
using FGUI.LG_albums;
|
||||||
using FGUI.LG_Common;
|
using FGUI.LG_Common;
|
||||||
using SGModule.DataStorage;
|
using SGModule.DataStorage;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using SGModule.Common.Extensions;
|
using SGModule.Common.Extensions;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using SGModule.NetKit;
|
using SGModule.NetKit;
|
||||||
namespace BallKingdomCrush
|
namespace BallKingdomCrush
|
||||||
{
|
{
|
||||||
public class AlbumDetailUI : BaseUI
|
public class AlbumDetailUI : BaseUI
|
||||||
{
|
{
|
||||||
private AlbumDetailUICtrl ctrl;
|
private AlbumDetailUICtrl ctrl;
|
||||||
private AlbumDetailModel model;
|
private AlbumDetailModel model;
|
||||||
private FGUI.LG_albums.com_albumsDetail ui;
|
private FGUI.LG_albums.com_albumsDetail ui;
|
||||||
|
|
||||||
public AlbumDetailUI(AlbumDetailUICtrl ctrl) : base(ctrl)
|
public AlbumDetailUI(AlbumDetailUICtrl ctrl) : base(ctrl)
|
||||||
{
|
{
|
||||||
uiName = UIConst.AlbumDetailUI;
|
uiName = UIConst.AlbumDetailUI;
|
||||||
this.ctrl = ctrl;
|
this.ctrl = ctrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetUIInfo(UIInfo uiInfo)
|
protected override void SetUIInfo(UIInfo uiInfo)
|
||||||
{
|
{
|
||||||
uiInfo.packageName = "LG_albums";
|
uiInfo.packageName = "LG_albums";
|
||||||
uiInfo.assetName = "com_albumsDetail";
|
uiInfo.assetName = "com_albumsDetail";
|
||||||
uiInfo.layerType = UILayerType.Popup;
|
uiInfo.layerType = UILayerType.Popup;
|
||||||
uiInfo.isNeedOpenAnim = false;
|
uiInfo.isNeedOpenAnim = false;
|
||||||
uiInfo.isNeedCloseAnim = false;
|
uiInfo.isNeedCloseAnim = false;
|
||||||
uiInfo.isNeedUIMask = true;
|
uiInfo.isNeedUIMask = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 生命周期
|
#region 生命周期
|
||||||
protected override void OnInit()
|
protected override void OnInit()
|
||||||
{
|
{
|
||||||
//model = ModuleManager.Instance.GetModel(ModelConst.AlbumDetailModel) as AlbumDetailModel;
|
//model = ModuleManager.Instance.GetModel(ModelConst.AlbumDetailModel) as AlbumDetailModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClose()
|
protected override void OnClose()
|
||||||
{
|
{
|
||||||
if (loader != null && !loader.isDisposed && loader.texture != null)
|
if (loader != null && !loader.isDisposed && loader.texture != null)
|
||||||
{
|
{
|
||||||
loader.texture.Dispose();
|
loader.texture.Dispose();
|
||||||
loader.texture = null;
|
loader.texture = null;
|
||||||
}
|
}
|
||||||
loader = null;
|
loader = null;
|
||||||
|
|
||||||
if (new_index != -1)
|
if (new_index != -1)
|
||||||
{
|
{
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.UnlockAlbums, index);
|
GameDispatcher.Instance.Dispatch(GameMsg.UnlockAlbums, index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnBind()
|
protected override void OnBind()
|
||||||
{
|
{
|
||||||
ui = baseUI as FGUI.LG_albums.com_albumsDetail;
|
ui = baseUI as FGUI.LG_albums.com_albumsDetail;
|
||||||
}
|
}
|
||||||
private List<LevelUnlock> LevelData;
|
private List<LevelUnlock> LevelData;
|
||||||
private int new_index = -1;
|
private int new_index = -1;
|
||||||
private int index;
|
private int index;
|
||||||
|
|
||||||
private GLoader loader = new GLoader();
|
private GLoader loader = new GLoader();
|
||||||
protected override void OnOpenBefore(object args)
|
protected override void OnOpenBefore(object args)
|
||||||
{
|
{
|
||||||
index = (int)args;
|
index = (int)args;
|
||||||
Debug.Log(index);
|
Debug.Log(index);
|
||||||
ui.btn_close.SetClick(() =>
|
ui.btn_close.SetClick(() =>
|
||||||
{
|
{
|
||||||
CtrlCloseUI();
|
CtrlCloseUI();
|
||||||
});
|
});
|
||||||
LevelData = ConfigSystem.GetConfig<LevelUnlock>();
|
LevelData = ConfigSystem.GetLevelUnlockConfig();
|
||||||
// ui.list_.SetVirtual();
|
// ui.list_.SetVirtual();
|
||||||
// ui.list_.itemRenderer = RendererList;
|
// ui.list_.itemRenderer = RendererList;
|
||||||
// ui.list_.numItems = GameHelper.GetLevel() - 1;
|
// ui.list_.numItems = GameHelper.GetLevel() - 1;
|
||||||
// ui.list_.ScrollToView(new_index);
|
// ui.list_.ScrollToView(new_index);
|
||||||
|
|
||||||
RendererList();
|
RendererList();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnOpen(object args)
|
protected override void OnOpen(object args)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnHide()
|
protected override void OnHide()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisplay(object args)
|
protected override void OnDisplay(object args)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 消息
|
#region 消息
|
||||||
protected override void AddListener()
|
protected override void AddListener()
|
||||||
{
|
{
|
||||||
GameDispatcher.Instance.AddListener(GameMsg.BuyVip, refrsh);
|
GameDispatcher.Instance.AddListener(GameMsg.BuyVip, refrsh);
|
||||||
}
|
}
|
||||||
protected override void RemoveListener()
|
protected override void RemoveListener()
|
||||||
{
|
{
|
||||||
GameDispatcher.Instance.RemoveListener(GameMsg.BuyVip, refrsh);
|
GameDispatcher.Instance.RemoveListener(GameMsg.BuyVip, refrsh);
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
//初始化页面逻辑
|
//初始化页面逻辑
|
||||||
private void refrsh(object a = null)
|
private void refrsh(object a = null)
|
||||||
{
|
{
|
||||||
DOVirtual.DelayedCall(0.5f, () =>
|
DOVirtual.DelayedCall(0.5f, () =>
|
||||||
{
|
{
|
||||||
// ui.list_.numItems = GameHelper.GetLevel() - 1;
|
// ui.list_.numItems = GameHelper.GetLevel() - 1;
|
||||||
RendererList();
|
RendererList();
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
// void RendererList(int index, GObject obj)
|
// void RendererList(int index, GObject obj)
|
||||||
void RendererList()
|
void RendererList()
|
||||||
{
|
{
|
||||||
|
|
||||||
item_albumsDetails item = (item_albumsDetails)ui.com_item;
|
item_albumsDetails item = (item_albumsDetails)ui.com_item;
|
||||||
|
|
||||||
loader = item.com_loader.GetChild("loader") as GLoader;
|
loader = item.com_loader.GetChild("loader") as GLoader;
|
||||||
|
|
||||||
// if (GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>()))
|
// if (GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>()))
|
||||||
// {
|
// {
|
||||||
// (item.btn_vip as btn_claim_2).have_vip.selectedIndex = 1;
|
// (item.btn_vip as btn_claim_2).have_vip.selectedIndex = 1;
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// if (GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>()))
|
// if (GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>()))
|
||||||
// {
|
// {
|
||||||
// (item.btn_watch as btn_claim_1).have_vip.selectedIndex = 1;
|
// (item.btn_watch as btn_claim_1).have_vip.selectedIndex = 1;
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
var downloadCoinNum = ConfigSystem.GetCommonConf().CoinsDownload;
|
var downloadCoinNum = ConfigSystem.GetCommonConf().CoinsDownload;
|
||||||
var btn_down_coin = (FGUI.LG_Common.btn_unlock)item.btn_download_coin;
|
var btn_down_coin = (FGUI.LG_Common.btn_unlock)item.btn_download_coin;
|
||||||
btn_down_coin.title = downloadCoinNum.As<string>();
|
btn_down_coin.title = downloadCoinNum.As<string>();
|
||||||
btn_down_coin.down_load.selectedIndex = GameHelper.GetVipLevel() >= 1 ? 0 : 1;
|
btn_down_coin.down_load.selectedIndex = GameHelper.GetVipLevel() >= 1 ? 0 : 1;
|
||||||
|
|
||||||
|
|
||||||
if (GameHelper.GetVipLevel() > 0)
|
if (GameHelper.GetVipLevel() > 0)
|
||||||
{
|
{
|
||||||
(item.btn_download as FGUI.LG_Common.btn_claim).have_vip.selectedIndex = 1;
|
(item.btn_download as FGUI.LG_Common.btn_claim).have_vip.selectedIndex = 1;
|
||||||
item.is_vip.selectedIndex = 1;
|
item.is_vip.selectedIndex = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item.is_vip.selectedIndex = 0;
|
item.is_vip.selectedIndex = 0;
|
||||||
}
|
}
|
||||||
if (index < GameHelper.GetCommonModel().MultiModal - 1)
|
if (index < GameHelper.GetCommonModel().MultiModal - 1)
|
||||||
{
|
{
|
||||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||||
item.btn_download.SetClick(() =>
|
item.btn_download.SetClick(() =>
|
||||||
{
|
{
|
||||||
|
|
||||||
if (GameHelper.GetVipLevel() > 0)
|
if (GameHelper.GetVipLevel() > 0)
|
||||||
{
|
{
|
||||||
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GameHelper.ShowVideoAd("DownloadImage", isSuccess =>
|
GameHelper.ShowVideoAd("DownloadImage", isSuccess =>
|
||||||
{
|
{
|
||||||
if (isSuccess)
|
if (isSuccess)
|
||||||
{
|
{
|
||||||
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
btn_down_coin.SetClick(() =>
|
btn_down_coin.SetClick(() =>
|
||||||
{
|
{
|
||||||
if (GameHelper.Get101() >= downloadCoinNum)
|
if (GameHelper.Get101() >= downloadCoinNum)
|
||||||
{
|
{
|
||||||
DataMgr.Coin.Value -= downloadCoinNum;
|
DataMgr.Coin.Value -= downloadCoinNum;
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
||||||
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
||||||
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
|
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GameHelper.ShowTips("no_enough_gold", true);
|
GameHelper.ShowTips("no_enough_gold", true);
|
||||||
|
|
||||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Levelunlock levelunlock_ = DataMgr.LevelUnlockListNew.Value.FirstOrDefault(x => x.level_ == index + 1);
|
Levelunlock levelunlock_ = DataMgr.LevelUnlockListNew.Value.FirstOrDefault(x => x.level_ == index + 1);
|
||||||
string file_name = "";
|
string file_name = "";
|
||||||
if (levelunlock_ != null)
|
if (levelunlock_ != null)
|
||||||
{
|
{
|
||||||
if (levelunlock_.type == 0)
|
if (levelunlock_.type == 0)
|
||||||
{
|
{
|
||||||
if (levelunlock_.config_index >= ConfigSystem.GetConfig<FreeImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<FreeImageLibrary>().Count - 1;
|
if (levelunlock_.config_index >= ConfigSystem.GetFreeImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetFreeImageConfig().Count - 1;
|
||||||
FreeImageLibrary _leveldata = ConfigSystem.GetConfig<FreeImageLibrary>()[levelunlock_.config_index];
|
FreeImageLibrary _leveldata = ConfigSystem.GetFreeImageConfig()[levelunlock_.config_index];
|
||||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||||
file_name = _leveldata.Name;
|
file_name = _leveldata.Name;
|
||||||
}
|
}
|
||||||
else if (levelunlock_.type == 1)
|
else if (levelunlock_.type == 1)
|
||||||
{
|
{
|
||||||
if (levelunlock_.config_index >= ConfigSystem.GetConfig<ADImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<ADImageLibrary>().Count - 1;
|
if (levelunlock_.config_index >= ConfigSystem.GetADImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetADImageConfig().Count - 1;
|
||||||
ADImageLibrary _leveldata = ConfigSystem.GetConfig<ADImageLibrary>()[levelunlock_.config_index];
|
ADImageLibrary _leveldata = ConfigSystem.GetADImageConfig()[levelunlock_.config_index];
|
||||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||||
file_name = _leveldata.Name;
|
file_name = _leveldata.Name;
|
||||||
}
|
}
|
||||||
else if (levelunlock_.type == 2)
|
else if (levelunlock_.type == 2)
|
||||||
{
|
{
|
||||||
if (levelunlock_.config_index >= ConfigSystem.GetConfig<SpecialImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<SpecialImageLibrary>().Count - 1;
|
if (levelunlock_.config_index >= ConfigSystem.GetSpecialImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetSpecialImageConfig().Count - 1;
|
||||||
SpecialImageLibrary _leveldata = ConfigSystem.GetConfig<SpecialImageLibrary>()[levelunlock_.config_index];
|
SpecialImageLibrary _leveldata = ConfigSystem.GetSpecialImageConfig()[levelunlock_.config_index];
|
||||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||||
file_name = _leveldata.Name;
|
file_name = _leveldata.Name;
|
||||||
}
|
}
|
||||||
else if (levelunlock_.type == 3)
|
else if (levelunlock_.type == 3)
|
||||||
{
|
{
|
||||||
if (levelunlock_.config_index >= ConfigSystem.GetConfig<VIPImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<VIPImageLibrary>().Count - 1;
|
if (levelunlock_.config_index >= ConfigSystem.GetVIPImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetVIPImageConfig().Count - 1;
|
||||||
VIPImageLibrary _leveldata = ConfigSystem.GetConfig<VIPImageLibrary>()[levelunlock_.config_index];
|
VIPImageLibrary _leveldata = ConfigSystem.GetVIPImageConfig()[levelunlock_.config_index];
|
||||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||||
file_name = _leveldata.Name;
|
file_name = _leveldata.Name;
|
||||||
}
|
}
|
||||||
item.btn_download.SetClick(() =>
|
item.btn_download.SetClick(() =>
|
||||||
{
|
{
|
||||||
|
|
||||||
if (GameHelper.GetVipLevel() > 0)
|
if (GameHelper.GetVipLevel() > 0)
|
||||||
{
|
{
|
||||||
TextureHelper.SaveImageToAlbum(file_name, FolderNames.AlbumName, CtrlCloseUI);
|
TextureHelper.SaveImageToAlbum(file_name, FolderNames.AlbumName, CtrlCloseUI);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GameHelper.ShowVideoAd("DownloadImage", isSuccess =>
|
GameHelper.ShowVideoAd("DownloadImage", isSuccess =>
|
||||||
{
|
{
|
||||||
if (isSuccess)
|
if (isSuccess)
|
||||||
{
|
{
|
||||||
TextureHelper.SaveImageToAlbum(file_name, FolderNames.AlbumName, CtrlCloseUI);
|
TextureHelper.SaveImageToAlbum(file_name, FolderNames.AlbumName, CtrlCloseUI);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
btn_down_coin.SetClick(() =>
|
btn_down_coin.SetClick(() =>
|
||||||
{
|
{
|
||||||
if (GameHelper.Get101() >= downloadCoinNum)
|
if (GameHelper.Get101() >= downloadCoinNum)
|
||||||
{
|
{
|
||||||
DataMgr.Coin.Value -= downloadCoinNum;
|
DataMgr.Coin.Value -= downloadCoinNum;
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
||||||
TextureHelper.SaveImageToAlbum(file_name, FolderNames.AlbumName, CtrlCloseUI);
|
TextureHelper.SaveImageToAlbum(file_name, FolderNames.AlbumName, CtrlCloseUI);
|
||||||
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
|
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GameHelper.ShowTips("no_enough_gold", true);
|
GameHelper.ShowTips("no_enough_gold", true);
|
||||||
|
|
||||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||||
item.btn_download.SetClick(() =>
|
item.btn_download.SetClick(() =>
|
||||||
{
|
{
|
||||||
|
|
||||||
if (GameHelper.GetVipLevel() > 0)
|
if (GameHelper.GetVipLevel() > 0)
|
||||||
{
|
{
|
||||||
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GameHelper.ShowVideoAd("DownloadImage", isSuccess =>
|
GameHelper.ShowVideoAd("DownloadImage", isSuccess =>
|
||||||
{
|
{
|
||||||
if (isSuccess)
|
if (isSuccess)
|
||||||
{
|
{
|
||||||
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
btn_down_coin.SetClick(() =>
|
btn_down_coin.SetClick(() =>
|
||||||
{
|
{
|
||||||
if (GameHelper.Get101() >= downloadCoinNum)
|
if (GameHelper.Get101() >= downloadCoinNum)
|
||||||
{
|
{
|
||||||
DataMgr.Coin.Value -= downloadCoinNum;
|
DataMgr.Coin.Value -= downloadCoinNum;
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
||||||
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
TextureHelper.SaveImageToAlbum(LevelData[index].Name, FolderNames.AlbumName, CtrlCloseUI);
|
||||||
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
|
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GameHelper.ShowTips("no_enough_gold", true);
|
GameHelper.ShowTips("no_enough_gold", true);
|
||||||
|
|
||||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (LevelData[index].LeveType == 0)
|
// if (LevelData[index].LeveType == 0)
|
||||||
// {
|
// {
|
||||||
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/");
|
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/");
|
||||||
// item.type.selectedIndex = 0;
|
// item.type.selectedIndex = 0;
|
||||||
// }
|
// }
|
||||||
// else if (LevelData[index].LeveType == 1) //特殊关
|
// else if (LevelData[index].LeveType == 1) //特殊关
|
||||||
// {
|
// {
|
||||||
// if (DataMgr.LevelUnlockList.Value.Contains(index))
|
// if (DataMgr.LevelUnlockList.Value.Contains(index))
|
||||||
// {
|
// {
|
||||||
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/");
|
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/");
|
||||||
// item.type.selectedIndex = 0;
|
// item.type.selectedIndex = 0;
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// item.type.selectedIndex = 1;
|
// item.type.selectedIndex = 1;
|
||||||
// item.btn_pay.title = LevelData[index].PassCoins.ToString();
|
// item.btn_pay.title = LevelData[index].PassCoins.ToString();
|
||||||
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, (s) =>
|
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, (s) =>
|
||||||
// {
|
// {
|
||||||
// TextureHelper.SetImageBlur(item.com_loader.GetChild("loader") as GLoader);
|
// TextureHelper.SetImageBlur(item.com_loader.GetChild("loader") as GLoader);
|
||||||
// }, "LevelAlbums/");
|
// }, "LevelAlbums/");
|
||||||
// item.btn_pay.SetClick(() =>
|
// item.btn_pay.SetClick(() =>
|
||||||
// {
|
// {
|
||||||
// if (DataMgr.Coin.Value >= LevelData[index].PassCoins)
|
// if (DataMgr.Coin.Value >= LevelData[index].PassCoins)
|
||||||
// {
|
// {
|
||||||
// new_index = index;
|
// new_index = index;
|
||||||
// DataMgr.Coin.Value -= LevelData[index].PassCoins;
|
// DataMgr.Coin.Value -= LevelData[index].PassCoins;
|
||||||
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||||
// DataMgr.LevelUnlockList.Value.Add(index);
|
// DataMgr.LevelUnlockList.Value.Add(index);
|
||||||
// GameHelper.ShowTips("Unlocked!");
|
// GameHelper.ShowTips("Unlocked!");
|
||||||
// DataMgr.LevelUnlockList.Save();
|
// DataMgr.LevelUnlockList.Save();
|
||||||
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||||
// CtrlCloseUI();
|
// CtrlCloseUI();
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// GameHelper.ShowTips("Not enough golds");
|
// GameHelper.ShowTips("Not enough golds");
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
// item.btn_watch.SetClick(() =>
|
// item.btn_watch.SetClick(() =>
|
||||||
// {
|
// {
|
||||||
// if (GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>()))
|
// if (GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>()))
|
||||||
// {
|
// {
|
||||||
// new_index = index;
|
// new_index = index;
|
||||||
// DataMgr.LevelUnlockList.Value.Add(index);
|
// DataMgr.LevelUnlockList.Value.Add(index);
|
||||||
// GameHelper.ShowTips("Unlocked!");
|
// GameHelper.ShowTips("Unlocked!");
|
||||||
// DataMgr.LevelUnlockList.Save();
|
// DataMgr.LevelUnlockList.Save();
|
||||||
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||||
// CtrlCloseUI();
|
// CtrlCloseUI();
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// GameHelper.ShowVideoAd("UnlockSpecialLevel", isSuccess =>
|
// GameHelper.ShowVideoAd("UnlockSpecialLevel", isSuccess =>
|
||||||
// {
|
// {
|
||||||
// if (isSuccess)
|
// if (isSuccess)
|
||||||
// {
|
// {
|
||||||
// new_index = index;
|
// new_index = index;
|
||||||
// DataMgr.LevelUnlockList.Value.Add(index);
|
// DataMgr.LevelUnlockList.Value.Add(index);
|
||||||
// GameHelper.ShowTips("Unlocked!");
|
// GameHelper.ShowTips("Unlocked!");
|
||||||
// DataMgr.LevelUnlockList.Save();
|
// DataMgr.LevelUnlockList.Save();
|
||||||
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||||
// CtrlCloseUI();
|
// CtrlCloseUI();
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// else if (LevelData[index].LeveType == 2)//vip关
|
// else if (LevelData[index].LeveType == 2)//vip关
|
||||||
// {
|
// {
|
||||||
// if (DataMgr.LevelUnlockList.Value.Contains(index))
|
// if (DataMgr.LevelUnlockList.Value.Contains(index))
|
||||||
// {
|
// {
|
||||||
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/");
|
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/");
|
||||||
// item.type.selectedIndex = 0;
|
// item.type.selectedIndex = 0;
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// item.type.selectedIndex = 2;
|
// item.type.selectedIndex = 2;
|
||||||
// item.btn_pay.title = LevelData[index].PassCoins.ToString();
|
// item.btn_pay.title = LevelData[index].PassCoins.ToString();
|
||||||
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, (s) =>
|
// TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, (s) =>
|
||||||
// {
|
// {
|
||||||
// TextureHelper.SetImageBlur(item.com_loader.GetChild("loader") as GLoader);
|
// TextureHelper.SetImageBlur(item.com_loader.GetChild("loader") as GLoader);
|
||||||
// }, "LevelAlbums/");
|
// }, "LevelAlbums/");
|
||||||
// item.btn_pay.SetClick(() =>
|
// item.btn_pay.SetClick(() =>
|
||||||
// {
|
// {
|
||||||
// if (DataMgr.Coin.Value >= LevelData[index].PassCoins)
|
// if (DataMgr.Coin.Value >= LevelData[index].PassCoins)
|
||||||
// {
|
// {
|
||||||
// new_index = index;
|
// new_index = index;
|
||||||
// DataMgr.Coin.Value -= LevelData[index].PassCoins;
|
// DataMgr.Coin.Value -= LevelData[index].PassCoins;
|
||||||
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
// GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||||
// DataMgr.LevelUnlockList.Value.Add(index);
|
// DataMgr.LevelUnlockList.Value.Add(index);
|
||||||
// GameHelper.ShowTips("Unlocked!");
|
// GameHelper.ShowTips("Unlocked!");
|
||||||
// DataMgr.LevelUnlockList.Save();
|
// DataMgr.LevelUnlockList.Save();
|
||||||
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||||
// CtrlCloseUI();
|
// CtrlCloseUI();
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// GameHelper.ShowTips("Not enough golds");
|
// GameHelper.ShowTips("Not enough golds");
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
// item.btn_vip.SetClick(() =>
|
// item.btn_vip.SetClick(() =>
|
||||||
// {
|
// {
|
||||||
// if (GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>()))
|
// if (GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>()))
|
||||||
// {
|
// {
|
||||||
// new_index = index;
|
// new_index = index;
|
||||||
// DataMgr.LevelUnlockList.Value.Add(index);
|
// DataMgr.LevelUnlockList.Value.Add(index);
|
||||||
// GameHelper.ShowTips("Unlocked!");
|
// GameHelper.ShowTips("Unlocked!");
|
||||||
// DataMgr.LevelUnlockList.Save();
|
// DataMgr.LevelUnlockList.Save();
|
||||||
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
// GameDispatcher.Instance.Dispatch(GameMsg.UnlockLevelsuccess);
|
||||||
// CtrlCloseUI();
|
// CtrlCloseUI();
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// uiCtrlDispatcher.Dispatch(UICtrlMsg.VipClubViewUI_Open, 2);
|
// uiCtrlDispatcher.Dispatch(UICtrlMsg.VipClubViewUI_Open, 2);
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// if (item.type.selectedIndex == 0)
|
// if (item.type.selectedIndex == 0)
|
||||||
// {
|
// {
|
||||||
// if (GameHelper.GetVipPrivilege(Subscription.FreeDownImage.As<int>()))
|
// if (GameHelper.GetVipPrivilege(Subscription.FreeDownImage.As<int>()))
|
||||||
// {
|
// {
|
||||||
// (item.btn_download as FGUI.LG_Common.btn_claim).have_vip.selectedIndex = 1;
|
// (item.btn_download as FGUI.LG_Common.btn_claim).have_vip.selectedIndex = 1;
|
||||||
// item.is_vip.selectedIndex = 1;
|
// item.is_vip.selectedIndex = 1;
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// item.is_vip.selectedIndex = 0;
|
// item.is_vip.selectedIndex = 0;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// else if (item.type.selectedIndex == 1)
|
// else if (item.type.selectedIndex == 1)
|
||||||
// {
|
// {
|
||||||
// if (GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>()))
|
// if (GameHelper.GetVipPrivilege(Subscription.SLVLevel.As<int>()))
|
||||||
// {
|
// {
|
||||||
// item.is_vip.selectedIndex = 1;
|
// item.is_vip.selectedIndex = 1;
|
||||||
// }
|
// }
|
||||||
// else item.is_vip.selectedIndex = 0;
|
// else item.is_vip.selectedIndex = 0;
|
||||||
|
|
||||||
// }
|
// }
|
||||||
// else if (item.type.selectedIndex == 2)
|
// else if (item.type.selectedIndex == 2)
|
||||||
// {
|
// {
|
||||||
// if (GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>()))
|
// if (GameHelper.GetVipPrivilege(Subscription.VipLevel.As<int>()))
|
||||||
// {
|
// {
|
||||||
// item.is_vip.selectedIndex = 1;
|
// item.is_vip.selectedIndex = 1;
|
||||||
// }
|
// }
|
||||||
// else item.is_vip.selectedIndex = 0;
|
// else item.is_vip.selectedIndex = 0;
|
||||||
|
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,431 +1,431 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using FairyGUI;
|
using FairyGUI;
|
||||||
using FGUI.LG_albums;
|
using FGUI.LG_albums;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace BallKingdomCrush
|
namespace BallKingdomCrush
|
||||||
{
|
{
|
||||||
public class AlubumUI : BaseUI
|
public class AlubumUI : BaseUI
|
||||||
{
|
{
|
||||||
private AlubumUICtrl ctrl;
|
private AlubumUICtrl ctrl;
|
||||||
private AlubumModel model;
|
private AlubumModel model;
|
||||||
private com_albums ui;
|
private com_albums ui;
|
||||||
private long[] UpDatatime;
|
private long[] UpDatatime;
|
||||||
|
|
||||||
public AlubumUI(AlubumUICtrl ctrl) : base(ctrl)
|
public AlubumUI(AlubumUICtrl ctrl) : base(ctrl)
|
||||||
{
|
{
|
||||||
uiName = UIConst.AlubumUI;
|
uiName = UIConst.AlubumUI;
|
||||||
this.ctrl = ctrl;
|
this.ctrl = ctrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetUIInfo(UIInfo uiInfo)
|
protected override void SetUIInfo(UIInfo uiInfo)
|
||||||
{
|
{
|
||||||
uiInfo.packageName = "LG_albums";
|
uiInfo.packageName = "LG_albums";
|
||||||
uiInfo.assetName = "com_albums";
|
uiInfo.assetName = "com_albums";
|
||||||
uiInfo.layerType = UILayerType.Popup;
|
uiInfo.layerType = UILayerType.Popup;
|
||||||
uiInfo.isNeedOpenAnim = false;
|
uiInfo.isNeedOpenAnim = false;
|
||||||
uiInfo.isNeedCloseAnim = false;
|
uiInfo.isNeedCloseAnim = false;
|
||||||
uiInfo.isNeedUIMask = true;
|
uiInfo.isNeedUIMask = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化页面逻辑
|
//初始化页面逻辑
|
||||||
private void InitView(object a = null)
|
private void InitView(object a = null)
|
||||||
{
|
{
|
||||||
UpDatatime = new long[LevelData.Count];
|
UpDatatime = new long[LevelData.Count];
|
||||||
ImageName = new string[LevelData.Count];
|
ImageName = new string[LevelData.Count];
|
||||||
ui.list_albums.itemRenderer = RendererList;
|
ui.list_albums.itemRenderer = RendererList;
|
||||||
ui.list_albums.numItems = LevelData.Count;
|
ui.list_albums.numItems = LevelData.Count;
|
||||||
|
|
||||||
InitScroll();
|
InitScroll();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetItemData(object obj = null)
|
private void SetItemData(object obj = null)
|
||||||
{
|
{
|
||||||
UpDatatime[(int)obj] = 0;
|
UpDatatime[(int)obj] = 0;
|
||||||
ui.list_albums.RefreshVirtualList();
|
ui.list_albums.RefreshVirtualList();
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 生命周期
|
#region 生命周期
|
||||||
|
|
||||||
protected override void OnInit()
|
protected override void OnInit()
|
||||||
{
|
{
|
||||||
GLoaderPool.Instance.Init(null, 24, 312, 310);
|
GLoaderPool.Instance.Init(null, 24, 312, 310);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClose()
|
protected override void OnClose()
|
||||||
{
|
{
|
||||||
foreach (var t in loader_list)
|
foreach (var t in loader_list)
|
||||||
if (t != null && !t.isDisposed && t.texture != null)
|
if (t != null && !t.isDisposed && t.texture != null)
|
||||||
{
|
{
|
||||||
t.texture.Dispose();
|
t.texture.Dispose();
|
||||||
t.texture = null;
|
t.texture = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1. 解除 UI 对 Loader 的引用
|
// 1. 解除 UI 对 Loader 的引用
|
||||||
for (var i = 0; i < ui.list_albums.numChildren; i++)
|
for (var i = 0; i < ui.list_albums.numChildren; i++)
|
||||||
{
|
{
|
||||||
var item = ui.list_albums.GetChildAt(i) as item_albums;
|
var item = ui.list_albums.GetChildAt(i) as item_albums;
|
||||||
if (item != null && item.com_loader.loader != null) item.com_loader.loader = null; // 清掉 GLoader 引用
|
if (item != null && item.com_loader.loader != null) item.com_loader.loader = null; // 清掉 GLoader 引用
|
||||||
}
|
}
|
||||||
|
|
||||||
activeLoaders.Clear();
|
activeLoaders.Clear();
|
||||||
_fileIsExist.Clear();
|
_fileIsExist.Clear();
|
||||||
|
|
||||||
GLoaderPool.Instance.DisposeAll();
|
GLoaderPool.Instance.DisposeAll();
|
||||||
|
|
||||||
TextureHelper.ClearMaterialPool();
|
TextureHelper.ClearMaterialPool();
|
||||||
|
|
||||||
// 强制卸载未使用的资源
|
// 强制卸载未使用的资源
|
||||||
// Resources.UnloadUnusedAssets();
|
// Resources.UnloadUnusedAssets();
|
||||||
// MemoryManager.CleanMemoryMonitor();
|
// MemoryManager.CleanMemoryMonitor();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnBind()
|
protected override void OnBind()
|
||||||
{
|
{
|
||||||
ui = baseUI as com_albums;
|
ui = baseUI as com_albums;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<LevelUnlock> LevelData;
|
private List<LevelUnlock> LevelData;
|
||||||
|
|
||||||
private readonly List<GLoader> loader_list = new();
|
private readonly List<GLoader> loader_list = new();
|
||||||
|
|
||||||
protected override void OnOpenBefore(object args)
|
protected override void OnOpenBefore(object args)
|
||||||
{
|
{
|
||||||
_throttle = new Throttle(1f);
|
_throttle = new Throttle(1f);
|
||||||
|
|
||||||
LevelData = ConfigSystem.GetConfig<LevelUnlock>();
|
LevelData = ConfigSystem.GetLevelUnlockConfig();
|
||||||
ui.list_albums.SetVirtual();
|
ui.list_albums.SetVirtual();
|
||||||
ui.btn_close1.SetClick(() => { CtrlCloseUI(); });
|
ui.btn_close1.SetClick(() => { CtrlCloseUI(); });
|
||||||
InitView();
|
InitView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private const int MaxVisibleCount = 18; // 一屏显示18个
|
private const int MaxVisibleCount = 18; // 一屏显示18个
|
||||||
private const int PreloadCount = 3; // 上下各预加载一屏
|
private const int PreloadCount = 3; // 上下各预加载一屏
|
||||||
private readonly Dictionary<int, GLoader> activeLoaders = new();
|
private readonly Dictionary<int, GLoader> activeLoaders = new();
|
||||||
private readonly Dictionary<int, bool> _fileIsExist = new();
|
private readonly Dictionary<int, bool> _fileIsExist = new();
|
||||||
|
|
||||||
private Throttle _throttle;
|
private Throttle _throttle;
|
||||||
|
|
||||||
private void InitScroll()
|
private void InitScroll()
|
||||||
{
|
{
|
||||||
// ui.list_albums.scrollPane.onScroll.Add(OnScrollUpdate);
|
// ui.list_albums.scrollPane.onScroll.Add(OnScrollUpdate);
|
||||||
ui.list_albums.scrollPane.onScrollEnd.Add(OnScrollEndCB); // 保留结束时的整理
|
ui.list_albums.scrollPane.onScrollEnd.Add(OnScrollEndCB); // 保留结束时的整理
|
||||||
|
|
||||||
OnScrollEnd();
|
OnScrollEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnScrollUpdate()
|
private void OnScrollUpdate()
|
||||||
{
|
{
|
||||||
_throttle.Execute(UpdateVisibleAndPreload);
|
_throttle.Execute(UpdateVisibleAndPreload);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnScrollEndCB()
|
private void OnScrollEndCB()
|
||||||
{
|
{
|
||||||
// UpdateVisibleAndPreload();
|
// UpdateVisibleAndPreload();
|
||||||
|
|
||||||
OnScrollEnd();
|
OnScrollEnd();
|
||||||
|
|
||||||
// Debug.Log("更新一次");
|
// Debug.Log("更新一次");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateVisibleAndPreload()
|
private void UpdateVisibleAndPreload()
|
||||||
{
|
{
|
||||||
// Debug.Log("[UpdateVisibleAndPreload]--------111111--------- ");
|
// Debug.Log("[UpdateVisibleAndPreload]--------111111--------- ");
|
||||||
// if (LevelData == null || LevelData.Count == 0) return;
|
// if (LevelData == null || LevelData.Count == 0) return;
|
||||||
|
|
||||||
// var firstVisibleIndex = ui.list_albums.GetFirstChildInView();
|
// var firstVisibleIndex = ui.list_albums.GetFirstChildInView();
|
||||||
// var lastVisibleIndex = Mathf.Min(firstVisibleIndex + MaxVisibleCount - 1, ui.list_albums.numItems - 1);
|
// var lastVisibleIndex = Mathf.Min(firstVisibleIndex + MaxVisibleCount - 1, ui.list_albums.numItems - 1);
|
||||||
|
|
||||||
// var startIndex = Mathf.Max(0, firstVisibleIndex - PreloadCount);
|
// var startIndex = Mathf.Max(0, firstVisibleIndex - PreloadCount);
|
||||||
// var endIndex = Mathf.Min(ui.list_albums.numItems - 1, lastVisibleIndex + PreloadCount);
|
// var endIndex = Mathf.Min(ui.list_albums.numItems - 1, lastVisibleIndex + PreloadCount);
|
||||||
|
|
||||||
// // 回收超出范围 loader
|
// // 回收超出范围 loader
|
||||||
// var keysToRemove = new List<int>();
|
// var keysToRemove = new List<int>();
|
||||||
// foreach (var kv in activeLoaders)
|
// foreach (var kv in activeLoaders)
|
||||||
// {
|
// {
|
||||||
// var idx = kv.Key;
|
// var idx = kv.Key;
|
||||||
// if (idx < startIndex || idx > endIndex)
|
// if (idx < startIndex || idx > endIndex)
|
||||||
// {
|
// {
|
||||||
// GLoaderPool.Instance.ReturnLoader(kv.Value);
|
// GLoaderPool.Instance.ReturnLoader(kv.Value);
|
||||||
// var oldItem = ui.list_albums.GetChildAt(idx) as item_albums;
|
// var oldItem = ui.list_albums.GetChildAt(idx) as item_albums;
|
||||||
// if (oldItem != null) oldItem.com_loader.loader = null;
|
// if (oldItem != null) oldItem.com_loader.loader = null;
|
||||||
// keysToRemove.Add(idx);
|
// keysToRemove.Add(idx);
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// foreach (var k in keysToRemove) activeLoaders.Remove(k);
|
// foreach (var k in keysToRemove) activeLoaders.Remove(k);
|
||||||
|
|
||||||
|
|
||||||
// // 分配 loader 并加载图片
|
// // 分配 loader 并加载图片
|
||||||
// for (var i = startIndex; i <= endIndex; i++)
|
// for (var i = startIndex; i <= endIndex; i++)
|
||||||
// {
|
// {
|
||||||
// if (activeLoaders.ContainsKey(i)) continue;
|
// if (activeLoaders.ContainsKey(i)) continue;
|
||||||
|
|
||||||
// var item = ui.list_albums.GetChildAt(i) as item_albums;
|
// var item = ui.list_albums.GetChildAt(i) as item_albums;
|
||||||
// if (item == null) continue;
|
// if (item == null) continue;
|
||||||
|
|
||||||
// if (item.com_loader.loader != null && !item.com_loader.loader.isDisposed)
|
// if (item.com_loader.loader != null && !item.com_loader.loader.isDisposed)
|
||||||
// GLoaderPool.Instance.ReturnLoader(item.com_loader.loader);
|
// GLoaderPool.Instance.ReturnLoader(item.com_loader.loader);
|
||||||
|
|
||||||
// var loader = GLoaderPool.Instance.GetLoader();
|
// var loader = GLoaderPool.Instance.GetLoader();
|
||||||
// item.com_loader.loader = loader;
|
// item.com_loader.loader = loader;
|
||||||
// item.com_loader.AddChild(loader);
|
// item.com_loader.AddChild(loader);
|
||||||
// loader.SetSize(item.com_loader.loader.width, item.com_loader.loader.height);
|
// loader.SetSize(item.com_loader.loader.width, item.com_loader.loader.height);
|
||||||
|
|
||||||
// _fileIsExist.TryGetValue(i, out var value);
|
// _fileIsExist.TryGetValue(i, out var value);
|
||||||
// if (!value)
|
// if (!value)
|
||||||
// {
|
// {
|
||||||
// var localPath = Path.Combine(TextureHelper.getResPath(), LevelData[i].Name + ".jpg");
|
// var localPath = Path.Combine(TextureHelper.getResPath(), LevelData[i].Name + ".jpg");
|
||||||
|
|
||||||
// if (File.Exists(localPath))
|
// if (File.Exists(localPath))
|
||||||
// {
|
// {
|
||||||
// _fileIsExist[i] = true;
|
// _fileIsExist[i] = true;
|
||||||
// Debug.Log($"[SetImgLoader] 本地存在,直接加载 {LevelData[i].Name}");
|
// Debug.Log($"[SetImgLoader] 本地存在,直接加载 {LevelData[i].Name}");
|
||||||
// CrazyAsyKit.StartCoroutine(TextureHelper.LoadTexture(LevelData[i].Name, loader, null,
|
// CrazyAsyKit.StartCoroutine(TextureHelper.LoadTexture(LevelData[i].Name, loader, null,
|
||||||
// "LevelAlbums/"));
|
// "LevelAlbums/"));
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// _fileIsExist[i] = false;
|
// _fileIsExist[i] = false;
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// else
|
// else
|
||||||
// {
|
// {
|
||||||
// CrazyAsyKit.StartCoroutine(TextureHelper.LoadTexture(LevelData[i].Name, loader, null,
|
// CrazyAsyKit.StartCoroutine(TextureHelper.LoadTexture(LevelData[i].Name, loader, null,
|
||||||
// "LevelAlbums/"));
|
// "LevelAlbums/"));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// activeLoaders[i] = loader;
|
// activeLoaders[i] = loader;
|
||||||
// }
|
// }
|
||||||
// Debug.Log($"[ScrollUpdate] active loaders={activeLoaders.Count}, pool={GLoaderPool.Instance.GetPoolCount()}, inUse={GLoaderPool.Instance.GetInUseCount()}");
|
// Debug.Log($"[ScrollUpdate] active loaders={activeLoaders.Count}, pool={GLoaderPool.Instance.GetPoolCount()}, inUse={GLoaderPool.Instance.GetInUseCount()}");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnScrollEnd()
|
private void OnScrollEnd()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < UpDatatime.Length; i++)
|
for (int i = 0; i < UpDatatime.Length; i++)
|
||||||
{
|
{
|
||||||
UpDatatime[i] = 0;
|
UpDatatime[i] = 0;
|
||||||
// ImageName[i] = "";
|
// ImageName[i] = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
// DOVirtual.DelayedCall(0.1f, () =>
|
// DOVirtual.DelayedCall(0.1f, () =>
|
||||||
// {
|
// {
|
||||||
ui.list_albums.RefreshVirtualList();
|
ui.list_albums.RefreshVirtualList();
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// if (LevelData == null || LevelData.Count == 0) return;
|
// if (LevelData == null || LevelData.Count == 0) return;
|
||||||
|
|
||||||
// var firstVisibleIndex = ui.list_albums.GetFirstChildInView();
|
// var firstVisibleIndex = ui.list_albums.GetFirstChildInView();
|
||||||
// var lastVisibleIndex = Mathf.Min(firstVisibleIndex + MaxVisibleCount - 1, ui.list_albums.numItems - 1);
|
// var lastVisibleIndex = Mathf.Min(firstVisibleIndex + MaxVisibleCount - 1, ui.list_albums.numItems - 1);
|
||||||
|
|
||||||
// var startIndex = Mathf.Max(0, firstVisibleIndex - PreloadCount);
|
// var startIndex = Mathf.Max(0, firstVisibleIndex - PreloadCount);
|
||||||
// var endIndex = Mathf.Min(ui.list_albums.numItems - 1, lastVisibleIndex + PreloadCount);
|
// var endIndex = Mathf.Min(ui.list_albums.numItems - 1, lastVisibleIndex + PreloadCount);
|
||||||
|
|
||||||
// // Debug.Log($"[ScrollEnd] start index={startIndex} end index={endIndex}");
|
// // Debug.Log($"[ScrollEnd] start index={startIndex} end index={endIndex}");
|
||||||
|
|
||||||
|
|
||||||
// var tasks = new List<(GLoader loader, string fileName, Action<NTexture> callback, string folder)>();
|
// var tasks = new List<(GLoader loader, string fileName, Action<NTexture> callback, string folder)>();
|
||||||
// // 分配 loader 并加载图片
|
// // 分配 loader 并加载图片
|
||||||
// for (var i = startIndex; i <= endIndex; i++)
|
// for (var i = startIndex; i <= endIndex; i++)
|
||||||
// {
|
// {
|
||||||
// _fileIsExist.TryGetValue(i, out var value);
|
// _fileIsExist.TryGetValue(i, out var value);
|
||||||
|
|
||||||
// if (value) continue;
|
// if (value) continue;
|
||||||
|
|
||||||
// if (GameHelper.GetLevel() < i + 1) continue;
|
// if (GameHelper.GetLevel() < i + 1) continue;
|
||||||
|
|
||||||
// var item = ui.list_albums.GetChildAt(i) as item_albums;
|
// var item = ui.list_albums.GetChildAt(i) as item_albums;
|
||||||
// if (item == null) continue;
|
// if (item == null) continue;
|
||||||
// if (item.com_loader.loader != null && !item.com_loader.loader.isDisposed)
|
// if (item.com_loader.loader != null && !item.com_loader.loader.isDisposed)
|
||||||
// GLoaderPool.Instance.ReturnLoader(item.com_loader.loader);
|
// GLoaderPool.Instance.ReturnLoader(item.com_loader.loader);
|
||||||
// var loader = GLoaderPool.Instance.GetLoader();
|
// var loader = GLoaderPool.Instance.GetLoader();
|
||||||
// item.com_loader.loader = loader;
|
// item.com_loader.loader = loader;
|
||||||
// item.com_loader.AddChild(loader);
|
// item.com_loader.AddChild(loader);
|
||||||
// loader.SetSize(item.com_loader.loader.width, item.com_loader.loader.height);
|
// loader.SetSize(item.com_loader.loader.width, item.com_loader.loader.height);
|
||||||
|
|
||||||
// var idx = i;
|
// var idx = i;
|
||||||
// tasks.Add((loader, LevelData[i].Name, NTexture =>
|
// tasks.Add((loader, LevelData[i].Name, NTexture =>
|
||||||
// {
|
// {
|
||||||
// if (NTexture != null) _fileIsExist[idx] = true;
|
// if (NTexture != null) _fileIsExist[idx] = true;
|
||||||
// }, "LevelAlbums/"));
|
// }, "LevelAlbums/"));
|
||||||
|
|
||||||
// activeLoaders[i] = loader;
|
// activeLoaders[i] = loader;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// if (tasks.Count > 0) TextureHelper.SetImgLoaders(tasks);
|
// if (tasks.Count > 0) TextureHelper.SetImgLoaders(tasks);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string[] ImageName;
|
private string[] ImageName;
|
||||||
|
|
||||||
private void RendererList(int index, GObject obj)
|
private void RendererList(int index, GObject obj)
|
||||||
{
|
{
|
||||||
// Debug.Log("Render list" );
|
// Debug.Log("Render list" );
|
||||||
|
|
||||||
// Debug.Log(JsonConvert.SerializeObject(LevelData[index]));
|
// Debug.Log(JsonConvert.SerializeObject(LevelData[index]));
|
||||||
|
|
||||||
item_albums item = (item_albums)obj;
|
item_albums item = (item_albums)obj;
|
||||||
item.text_num.text = (index + 1).ToString();
|
item.text_num.text = (index + 1).ToString();
|
||||||
if (index < GameHelper.GetCommonModel().MultiModal - 1)
|
if (index < GameHelper.GetCommonModel().MultiModal - 1)
|
||||||
{
|
{
|
||||||
item.type_.selectedIndex = 0;
|
item.type_.selectedIndex = 0;
|
||||||
if (GameHelper.GetLevel() > index + 1)
|
if (GameHelper.GetLevel() > index + 1)
|
||||||
{
|
{
|
||||||
item.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.AlbumDetailUI_Open, index); });
|
item.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.AlbumDetailUI_Open, index); });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item.SetClick(() => { GameHelper.ShowTips("lv_unlock", true); });
|
item.SetClick(() => { GameHelper.ShowTips("lv_unlock", true); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Levelunlock levelunlock_ = DataMgr.LevelUnlockListNew.Value.FirstOrDefault(x => x.level_ == index + 1);
|
Levelunlock levelunlock_ = DataMgr.LevelUnlockListNew.Value.FirstOrDefault(x => x.level_ == index + 1);
|
||||||
if (levelunlock_ != null)
|
if (levelunlock_ != null)
|
||||||
{
|
{
|
||||||
item.type_.selectedIndex = levelunlock_.type;
|
item.type_.selectedIndex = levelunlock_.type;
|
||||||
}
|
}
|
||||||
else item.type_.selectedIndex = 0;
|
else item.type_.selectedIndex = 0;
|
||||||
if (GameHelper.GetLevel() > index + 1)
|
if (GameHelper.GetLevel() > index + 1)
|
||||||
{
|
{
|
||||||
item.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.AlbumDetailUI_Open, index); });
|
item.SetClick(() => { uiCtrlDispatcher.Dispatch(UICtrlMsg.AlbumDetailUI_Open, index); });
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item.SetClick(() => { GameHelper.ShowTips("lv_unlock", true); });
|
item.SetClick(() => { GameHelper.ShowTips("lv_unlock", true); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (GameHelper.GetNowTime() < UpDatatime[index] + 1) return;
|
if (GameHelper.GetNowTime() < UpDatatime[index] + 1) return;
|
||||||
UpDatatime[index] = GameHelper.GetNowTime();
|
UpDatatime[index] = GameHelper.GetNowTime();
|
||||||
// if (!activeLoaders.ContainsValue(item.com_loader.loader)) activeLoaders[index] = item.com_loader.loader;
|
// if (!activeLoaders.ContainsValue(item.com_loader.loader)) activeLoaders[index] = item.com_loader.loader;
|
||||||
if (!loader_list.Contains(item.com_loader.GetChild("loader") as GLoader))
|
if (!loader_list.Contains(item.com_loader.GetChild("loader") as GLoader))
|
||||||
loader_list.Add(item.com_loader.GetChild("loader") as GLoader);
|
loader_list.Add(item.com_loader.GetChild("loader") as GLoader);
|
||||||
|
|
||||||
|
|
||||||
if (index < GameHelper.GetCommonModel().MultiModal - 1)
|
if (index < GameHelper.GetCommonModel().MultiModal - 1)
|
||||||
{
|
{
|
||||||
if (GameHelper.GetLevel() > index + 1)
|
if (GameHelper.GetLevel() > index + 1)
|
||||||
{
|
{
|
||||||
item.isUnlock.selectedIndex = 1;
|
item.isUnlock.selectedIndex = 1;
|
||||||
if (item.com_loader.loader.texture == null ||
|
if (item.com_loader.loader.texture == null ||
|
||||||
item.com_loader.loader.texture.nativeTexture.name != LevelData[index].Name)
|
item.com_loader.loader.texture.nativeTexture.name != LevelData[index].Name)
|
||||||
{
|
{
|
||||||
// item.isUnlock.selectedIndex = 0;
|
// item.isUnlock.selectedIndex = 0;
|
||||||
// if (item.com_loader.loader.texture != null)
|
// if (item.com_loader.loader.texture != null)
|
||||||
// {
|
// {
|
||||||
// item.com_loader.loader.texture.Dispose(); // 释放 GPU 资源
|
// item.com_loader.loader.texture.Dispose(); // 释放 GPU 资源
|
||||||
// item.com_loader.loader.texture = null; // 断开引用
|
// item.com_loader.loader.texture = null; // 断开引用
|
||||||
// }
|
// }
|
||||||
|
|
||||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name,
|
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name,
|
||||||
(a) => { Debug.Log(item.com_loader.loader.texture.nativeTexture.name); }, "LevelAlbums/", FolderNames.AlbumName);
|
(a) => { Debug.Log(item.com_loader.loader.texture.nativeTexture.name); }, "LevelAlbums/", FolderNames.AlbumName);
|
||||||
|
|
||||||
ImageName[index] = LevelData[index].Name;
|
ImageName[index] = LevelData[index].Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
item.touchable = true;
|
item.touchable = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item.isUnlock.selectedIndex = 0;
|
item.isUnlock.selectedIndex = 0;
|
||||||
// item.touchable = false;
|
// item.touchable = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Levelunlock levelunlock_ = DataMgr.LevelUnlockListNew.Value.FirstOrDefault(x => x.level_ == index + 1);
|
Levelunlock levelunlock_ = DataMgr.LevelUnlockListNew.Value.FirstOrDefault(x => x.level_ == index + 1);
|
||||||
|
|
||||||
if (GameHelper.GetLevel() > index + 1)
|
if (GameHelper.GetLevel() > index + 1)
|
||||||
{
|
{
|
||||||
if (levelunlock_ != null)
|
if (levelunlock_ != null)
|
||||||
{
|
{
|
||||||
item.isUnlock.selectedIndex = 1;
|
item.isUnlock.selectedIndex = 1;
|
||||||
|
|
||||||
if (item.com_loader.loader.texture == null || item.com_loader.loader.texture.nativeTexture.name != ImageName[index])
|
if (item.com_loader.loader.texture == null || item.com_loader.loader.texture.nativeTexture.name != ImageName[index])
|
||||||
{
|
{
|
||||||
|
|
||||||
if (levelunlock_.type == 0)
|
if (levelunlock_.type == 0)
|
||||||
{
|
{
|
||||||
if (levelunlock_.config_index >= ConfigSystem.GetConfig<FreeImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<FreeImageLibrary>().Count - 1;
|
if (levelunlock_.config_index >= ConfigSystem.GetFreeImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetFreeImageConfig().Count - 1;
|
||||||
FreeImageLibrary _leveldata = ConfigSystem.GetConfig<FreeImageLibrary>()[levelunlock_.config_index];
|
FreeImageLibrary _leveldata = ConfigSystem.GetFreeImageConfig()[levelunlock_.config_index];
|
||||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||||
ImageName[index] = LevelData[index].Name;
|
ImageName[index] = LevelData[index].Name;
|
||||||
}
|
}
|
||||||
else if (levelunlock_.type == 1)
|
else if (levelunlock_.type == 1)
|
||||||
{
|
{
|
||||||
if (levelunlock_.config_index >= ConfigSystem.GetConfig<ADImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<ADImageLibrary>().Count - 1;
|
if (levelunlock_.config_index >= ConfigSystem.GetADImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetADImageConfig().Count - 1;
|
||||||
ADImageLibrary _leveldata = ConfigSystem.GetConfig<ADImageLibrary>()[levelunlock_.config_index];
|
ADImageLibrary _leveldata = ConfigSystem.GetADImageConfig()[levelunlock_.config_index];
|
||||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||||
ImageName[index] = LevelData[index].Name;
|
ImageName[index] = LevelData[index].Name;
|
||||||
}
|
}
|
||||||
else if (levelunlock_.type == 2)
|
else if (levelunlock_.type == 2)
|
||||||
{
|
{
|
||||||
if (levelunlock_.config_index >= ConfigSystem.GetConfig<SpecialImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<SpecialImageLibrary>().Count - 1;
|
if (levelunlock_.config_index >= ConfigSystem.GetSpecialImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetSpecialImageConfig().Count - 1;
|
||||||
SpecialImageLibrary _leveldata = ConfigSystem.GetConfig<SpecialImageLibrary>()[levelunlock_.config_index];
|
SpecialImageLibrary _leveldata = ConfigSystem.GetSpecialImageConfig()[levelunlock_.config_index];
|
||||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||||
ImageName[index] = LevelData[index].Name;
|
ImageName[index] = LevelData[index].Name;
|
||||||
}
|
}
|
||||||
else if (levelunlock_.type == 3)
|
else if (levelunlock_.type == 3)
|
||||||
{
|
{
|
||||||
if (levelunlock_.config_index >= ConfigSystem.GetConfig<VIPImageLibrary>().Count) levelunlock_.config_index = ConfigSystem.GetConfig<VIPImageLibrary>().Count - 1;
|
if (levelunlock_.config_index >= ConfigSystem.GetVIPImageConfig().Count) levelunlock_.config_index = ConfigSystem.GetVIPImageConfig().Count - 1;
|
||||||
VIPImageLibrary _leveldata = ConfigSystem.GetConfig<VIPImageLibrary>()[levelunlock_.config_index];
|
VIPImageLibrary _leveldata = ConfigSystem.GetVIPImageConfig()[levelunlock_.config_index];
|
||||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, _leveldata.Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||||
ImageName[index] = LevelData[index].Name;
|
ImageName[index] = LevelData[index].Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
item.isUnlock.selectedIndex = 1;
|
item.isUnlock.selectedIndex = 1;
|
||||||
if (item.com_loader.loader.texture == null || item.com_loader.loader.texture.nativeTexture.name != LevelData[index].Name)
|
if (item.com_loader.loader.texture == null || item.com_loader.loader.texture.nativeTexture.name != LevelData[index].Name)
|
||||||
{
|
{
|
||||||
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
TextureHelper.SetImgLoader(item.com_loader.GetChild("loader") as GLoader, LevelData[index].Name, null, "LevelAlbums/", FolderNames.AlbumName);
|
||||||
ImageName[index] = LevelData[index].Name;
|
ImageName[index] = LevelData[index].Name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// item.touchable = false;
|
// item.touchable = false;
|
||||||
item.isUnlock.selectedIndex = 0;
|
item.isUnlock.selectedIndex = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnOpen(object args)
|
protected override void OnOpen(object args)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnHide()
|
protected override void OnHide()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisplay(object args)
|
protected override void OnDisplay(object args)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 消息
|
#region 消息
|
||||||
|
|
||||||
protected override void AddListener()
|
protected override void AddListener()
|
||||||
{
|
{
|
||||||
GameDispatcher.Instance.AddListener(GameMsg.UnlockAlbums, SetItemData);
|
GameDispatcher.Instance.AddListener(GameMsg.UnlockAlbums, SetItemData);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void RemoveListener()
|
protected override void RemoveListener()
|
||||||
{
|
{
|
||||||
GameDispatcher.Instance.RemoveListener(GameMsg.UnlockAlbums, SetItemData);
|
GameDispatcher.Instance.RemoveListener(GameMsg.UnlockAlbums, SetItemData);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,296 +1,296 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using FairyGUI;
|
using FairyGUI;
|
||||||
using FGUI.LG_live;
|
using FGUI.LG_live;
|
||||||
using SGModule.Common.Extensions;
|
using SGModule.Common.Extensions;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Video;
|
using UnityEngine.Video;
|
||||||
|
|
||||||
namespace BallKingdomCrush
|
namespace BallKingdomCrush
|
||||||
{
|
{
|
||||||
public class LiveUI : BaseUI
|
public class LiveUI : BaseUI
|
||||||
{
|
{
|
||||||
private const int MaxVisibleCount = 6; // 一屏最多6个播放器
|
private const int MaxVisibleCount = 6; // 一屏最多6个播放器
|
||||||
private static readonly Dictionary<item_live, VideoPlayer> dictionary_ = new();
|
private static readonly Dictionary<item_live, VideoPlayer> dictionary_ = new();
|
||||||
private LiveUICtrl ctrl;
|
private LiveUICtrl ctrl;
|
||||||
|
|
||||||
private float late_time = 0.1f;
|
private float late_time = 0.1f;
|
||||||
private List<Live> LiveConfig;
|
private List<Live> LiveConfig;
|
||||||
private LiveModel model;
|
private LiveModel model;
|
||||||
private com_live ui;
|
private com_live ui;
|
||||||
|
|
||||||
|
|
||||||
private GameObject videoParent;
|
private GameObject videoParent;
|
||||||
|
|
||||||
public LiveUI(LiveUICtrl ctrl) : base(ctrl)
|
public LiveUI(LiveUICtrl ctrl) : base(ctrl)
|
||||||
{
|
{
|
||||||
uiName = UIConst.LiveUI;
|
uiName = UIConst.LiveUI;
|
||||||
this.ctrl = ctrl;
|
this.ctrl = ctrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetUIInfo(UIInfo uiInfo)
|
protected override void SetUIInfo(UIInfo uiInfo)
|
||||||
{
|
{
|
||||||
uiInfo.packageName = "LG_live";
|
uiInfo.packageName = "LG_live";
|
||||||
uiInfo.assetName = "com_live";
|
uiInfo.assetName = "com_live";
|
||||||
uiInfo.layerType = UILayerType.Popup;
|
uiInfo.layerType = UILayerType.Popup;
|
||||||
uiInfo.isNeedOpenAnim = false;
|
uiInfo.isNeedOpenAnim = false;
|
||||||
uiInfo.isNeedCloseAnim = false;
|
uiInfo.isNeedCloseAnim = false;
|
||||||
uiInfo.isNeedUIMask = true;
|
uiInfo.isNeedUIMask = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateEvent()
|
private void UpdateEvent()
|
||||||
{
|
{
|
||||||
late_time = 0.1f;
|
late_time = 0.1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始化页面逻辑
|
// 初始化页面逻辑
|
||||||
private void InitView()
|
private void InitView()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 生命周期
|
#region 生命周期
|
||||||
|
|
||||||
protected override void OnInit()
|
protected override void OnInit()
|
||||||
{
|
{
|
||||||
videoParent = new GameObject("VideoPlayerParent");
|
videoParent = new GameObject("VideoPlayerParent");
|
||||||
VideoPlayerPool.Instance.Init(videoParent, MaxVisibleCount);
|
VideoPlayerPool.Instance.Init(videoParent, MaxVisibleCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClose()
|
protected override void OnClose()
|
||||||
{
|
{
|
||||||
// 归还所有播放器
|
// 归还所有播放器
|
||||||
foreach (var kvp in dictionary_)
|
foreach (var kvp in dictionary_)
|
||||||
VideoPlayerPool.Instance.ReturnPlayer(kvp.Value);
|
VideoPlayerPool.Instance.ReturnPlayer(kvp.Value);
|
||||||
|
|
||||||
dictionary_.Clear();
|
dictionary_.Clear();
|
||||||
VideoPlayerPool.Instance.DisposeAll();
|
VideoPlayerPool.Instance.DisposeAll();
|
||||||
Object.Destroy(videoParent);
|
Object.Destroy(videoParent);
|
||||||
|
|
||||||
foreach (var t in loader_list)
|
foreach (var t in loader_list)
|
||||||
if (t != null && !t.isDisposed && t.texture != null)
|
if (t != null && !t.isDisposed && t.texture != null)
|
||||||
{
|
{
|
||||||
t.texture.Dispose();
|
t.texture.Dispose();
|
||||||
t.texture = null;
|
t.texture = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLoaderPool.Instance.DisposeAll();
|
GLoaderPool.Instance.DisposeAll();
|
||||||
TextureHelper.ClearMaterialPool();
|
TextureHelper.ClearMaterialPool();
|
||||||
|
|
||||||
// 强制卸载未使用的资源
|
// 强制卸载未使用的资源
|
||||||
Resources.UnloadUnusedAssets();
|
// Resources.UnloadUnusedAssets();
|
||||||
MemoryManager.CleanMemoryMonitor();
|
// MemoryManager.CleanMemoryMonitor();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnBind()
|
protected override void OnBind()
|
||||||
{
|
{
|
||||||
ui = baseUI as com_live;
|
ui = baseUI as com_live;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly List<GLoader> loader_list = new();
|
private readonly List<GLoader> loader_list = new();
|
||||||
|
|
||||||
|
|
||||||
protected override void OnOpenBefore(object args)
|
protected override void OnOpenBefore(object args)
|
||||||
{
|
{
|
||||||
LiveConfig = ConfigSystem.GetConfig<Live>();
|
LiveConfig = ConfigSystem.GetLiveConfig();
|
||||||
|
|
||||||
ui.list_.itemRenderer = RendererList;
|
ui.list_.itemRenderer = RendererList;
|
||||||
Debug.Log($"LiveConfig.Count==1=== {LiveConfig.Count}");
|
Debug.Log($"LiveConfig.Count==1=== {LiveConfig.Count}");
|
||||||
ui.list_.numItems = LiveConfig.Count;
|
ui.list_.numItems = LiveConfig.Count;
|
||||||
|
|
||||||
ui.btn_close.SetClick(() => { CtrlCloseUI(); });
|
ui.btn_close.SetClick(() => { CtrlCloseUI(); });
|
||||||
|
|
||||||
InitView();
|
InitView();
|
||||||
|
|
||||||
// 滚动过程中实时刷新可见播放器
|
// 滚动过程中实时刷新可见播放器
|
||||||
ui.list_.scrollPane.onScrollEnd.Add(OnScrollEnd);
|
ui.list_.scrollPane.onScrollEnd.Add(OnScrollEnd);
|
||||||
|
|
||||||
// 打开页面时初始化一次
|
// 打开页面时初始化一次
|
||||||
OnScrollEnd();
|
OnScrollEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private HashSet<item_live> lastVisibleItems = new();
|
private HashSet<item_live> lastVisibleItems = new();
|
||||||
|
|
||||||
private void OnScrollEnd()
|
private void OnScrollEnd()
|
||||||
{
|
{
|
||||||
Debug.Log($"[OnScrollEnd]==lastVisibleItems=== {lastVisibleItems.Count}");
|
Debug.Log($"[OnScrollEnd]==lastVisibleItems=== {lastVisibleItems.Count}");
|
||||||
// 1️⃣ 回收上一次的可见播放器
|
// 1️⃣ 回收上一次的可见播放器
|
||||||
foreach (var oldItem in lastVisibleItems)
|
foreach (var oldItem in lastVisibleItems)
|
||||||
if (dictionary_.TryGetValue(oldItem, out var player))
|
if (dictionary_.TryGetValue(oldItem, out var player))
|
||||||
{
|
{
|
||||||
player.Pause();
|
player.Pause();
|
||||||
player.targetTexture?.Release();
|
player.targetTexture?.Release();
|
||||||
VideoPlayerPool.Instance.ReturnPlayer(player);
|
VideoPlayerPool.Instance.ReturnPlayer(player);
|
||||||
dictionary_.Remove(oldItem);
|
dictionary_.Remove(oldItem);
|
||||||
oldItem.com_loader.visible = false;
|
oldItem.com_loader.visible = false;
|
||||||
oldItem.img_cover.visible = true;
|
oldItem.img_cover.visible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastVisibleItems.Clear();
|
lastVisibleItems.Clear();
|
||||||
|
|
||||||
|
|
||||||
// 2️⃣ 获取当前可见项
|
// 2️⃣ 获取当前可见项
|
||||||
var firstIndex = ui.list_.GetFirstChildInView();
|
var firstIndex = ui.list_.GetFirstChildInView();
|
||||||
var lastIndex = Mathf.Min(firstIndex + MaxVisibleCount, ui.list_.numItems);
|
var lastIndex = Mathf.Min(firstIndex + MaxVisibleCount, ui.list_.numItems);
|
||||||
|
|
||||||
HashSet<item_live> newVisibleItems = new();
|
HashSet<item_live> newVisibleItems = new();
|
||||||
for (var i = firstIndex; i < lastIndex; i++)
|
for (var i = firstIndex; i < lastIndex; i++)
|
||||||
if (ui.list_.GetChildAt(i) is item_live item)
|
if (ui.list_.GetChildAt(i) is item_live item)
|
||||||
{
|
{
|
||||||
newVisibleItems.Add(item);
|
newVisibleItems.Add(item);
|
||||||
|
|
||||||
// 分配播放器
|
// 分配播放器
|
||||||
if (!dictionary_.ContainsKey(item))
|
if (!dictionary_.ContainsKey(item))
|
||||||
{
|
{
|
||||||
var player = VideoPlayerPool.Instance.GetPlayer();
|
var player = VideoPlayerPool.Instance.GetPlayer();
|
||||||
if (player != null)
|
if (player != null)
|
||||||
{
|
{
|
||||||
dictionary_[item] = player;
|
dictionary_[item] = player;
|
||||||
BindPlayerToItem(item, i);
|
BindPlayerToItem(item, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3️⃣ 保存为“上一次可见项”
|
// 3️⃣ 保存为“上一次可见项”
|
||||||
lastVisibleItems = newVisibleItems;
|
lastVisibleItems = newVisibleItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BindPlayerToItem(item_live item, int index)
|
private void BindPlayerToItem(item_live item, int index)
|
||||||
{
|
{
|
||||||
var data = PreDownloadManager.GetLiveDataByIndex(LiveConfig[index], index);
|
var data = PreDownloadManager.GetLiveDataByIndex(LiveConfig[index], index);
|
||||||
|
|
||||||
Debug.Log($"[绑定播放器 进度] progress==1=== {data.progress}");
|
Debug.Log($"[绑定播放器 进度] progress==1=== {data.progress}");
|
||||||
if (data.progress <= 0) return;
|
if (data.progress <= 0) return;
|
||||||
|
|
||||||
var player = dictionary_[item];
|
var player = dictionary_[item];
|
||||||
var loader = item.com_loader.GetChild("loader") as GLoader;
|
var loader = item.com_loader.GetChild("loader") as GLoader;
|
||||||
item.com_loader.visible = true;
|
item.com_loader.visible = true;
|
||||||
|
|
||||||
if (!loader_list.Contains(loader)) loader_list.Add(loader);
|
if (!loader_list.Contains(loader)) loader_list.Add(loader);
|
||||||
|
|
||||||
TextureHelper.SetVideoLoader(player, loader, LiveConfig[index].Name, vp =>
|
TextureHelper.SetVideoLoader(player, loader, LiveConfig[index].Name, vp =>
|
||||||
{
|
{
|
||||||
if (vp != null && !item.isDisposed)
|
if (vp != null && !item.isDisposed)
|
||||||
{
|
{
|
||||||
if (data.progress >= 100)
|
if (data.progress >= 100)
|
||||||
{
|
{
|
||||||
item.img_cover.visible = false;
|
item.img_cover.visible = false;
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.liveVideoLoaded);
|
GameDispatcher.Instance.Dispatch(GameMsg.liveVideoLoaded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void RendererList(int index, GObject obj)
|
private void RendererList(int index, GObject obj)
|
||||||
{
|
{
|
||||||
var livedata_ = PreDownloadManager.GetLiveDataByIndex(LiveConfig[index], index);
|
var livedata_ = PreDownloadManager.GetLiveDataByIndex(LiveConfig[index], index);
|
||||||
|
|
||||||
var item = (item_live)obj;
|
var item = (item_live)obj;
|
||||||
|
|
||||||
// UI状态显示
|
// UI状态显示
|
||||||
item.state.selectedIndex = livedata_.progress <= 0 ? 1 : 0;
|
item.state.selectedIndex = livedata_.progress <= 0 ? 1 : 0;
|
||||||
|
|
||||||
if (LiveConfig[index].SubscribeUnlock == 1)
|
if (LiveConfig[index].SubscribeUnlock == 1)
|
||||||
{
|
{
|
||||||
if (livedata_.progress < 100) item.vip.selectedIndex = 1;
|
if (livedata_.progress < 100) item.vip.selectedIndex = 1;
|
||||||
else item.vip.selectedIndex = 2;
|
else item.vip.selectedIndex = 2;
|
||||||
}
|
}
|
||||||
else item.vip.selectedIndex = 0;
|
else item.vip.selectedIndex = 0;
|
||||||
|
|
||||||
item.mask.img_mask.fillAmount = (float)(100 - livedata_.progress) / 100;
|
item.mask.img_mask.fillAmount = (float)(100 - livedata_.progress) / 100;
|
||||||
var coverLoader = item.img_cover.GetChild("loader") as GLoader;
|
var coverLoader = item.img_cover.GetChild("loader") as GLoader;
|
||||||
LiveVideoManager.Instance.GetVideoCover(coverLoader, LiveConfig[index].Name + "_cover", (tex) => {
|
LiveVideoManager.Instance.GetVideoCover(coverLoader, LiveConfig[index].Name + "_cover", (tex) => {
|
||||||
if (tex != null) {
|
if (tex != null) {
|
||||||
|
|
||||||
if (coverLoader != null) {
|
if (coverLoader != null) {
|
||||||
coverLoader.texture = new NTexture(tex);
|
coverLoader.texture = new NTexture(tex);
|
||||||
coverLoader.visible = true;
|
coverLoader.visible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 点击事件
|
// 点击事件
|
||||||
item.SetClick(() =>
|
item.SetClick(() =>
|
||||||
{
|
{
|
||||||
if (GameHelper.GetLevel() < GameHelper.GetCommonModel().UnlockLive[1])
|
if (GameHelper.GetLevel() < GameHelper.GetCommonModel().UnlockLive[1])
|
||||||
{
|
{
|
||||||
if (DataMgr.IsUnlockLive.Value < 0 && DataMgr.VipLevel.Value < 0) UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SecretUnlockUI_Open, 2);
|
if (DataMgr.IsUnlockLive.Value < 0 && DataMgr.VipLevel.Value < 0) UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.SecretUnlockUI_Open, 2);
|
||||||
else if (DataMgr.IsUnlockLive.Value == 0) UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.UnlockTipsUI_Open, 2);
|
else if (DataMgr.IsUnlockLive.Value == 0) UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.UnlockTipsUI_Open, 2);
|
||||||
else HandleDetailOpen(item, index);
|
else HandleDetailOpen(item, index);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
HandleDetailOpen(item, index);
|
HandleDetailOpen(item, index);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleDetailOpen(item_live item, int index)
|
private void HandleDetailOpen(item_live item, int index)
|
||||||
{
|
{
|
||||||
if (dictionary_.TryGetValue(item, out var player))
|
if (dictionary_.TryGetValue(item, out var player))
|
||||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.LiveDetailUI_Open, (index, player));
|
uiCtrlDispatcher.Dispatch(UICtrlMsg.LiveDetailUI_Open, (index, player));
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnOpen(object args)
|
protected override void OnOpen(object args)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnHide()
|
protected override void OnHide()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisplay(object args)
|
protected override void OnDisplay(object args)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 消息
|
#region 消息
|
||||||
|
|
||||||
protected override void AddListener()
|
protected override void AddListener()
|
||||||
{
|
{
|
||||||
GameDispatcher.Instance.AddListener(GameMsg.LiveChange, Refresh);
|
GameDispatcher.Instance.AddListener(GameMsg.LiveChange, Refresh);
|
||||||
HallManager.Instance.UpdateEvent += UpdateEvent;
|
HallManager.Instance.UpdateEvent += UpdateEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void RemoveListener()
|
protected override void RemoveListener()
|
||||||
{
|
{
|
||||||
GameDispatcher.Instance.RemoveListener(GameMsg.LiveChange, Refresh);
|
GameDispatcher.Instance.RemoveListener(GameMsg.LiveChange, Refresh);
|
||||||
HallManager.Instance.UpdateEvent -= UpdateEvent;
|
HallManager.Instance.UpdateEvent -= UpdateEvent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void Refresh(object param = null)
|
private void Refresh(object param = null)
|
||||||
{
|
{
|
||||||
var index = param.As<int>();
|
var index = param.As<int>();
|
||||||
// ui.list_.itemRenderer = RendererList;
|
// ui.list_.itemRenderer = RendererList;
|
||||||
// Debug.Log($"LiveConfig.Count==2=== {LiveConfig.Count}");
|
// Debug.Log($"LiveConfig.Count==2=== {LiveConfig.Count}");
|
||||||
// ui.list_.numItems = LiveConfig.Count;
|
// ui.list_.numItems = LiveConfig.Count;
|
||||||
|
|
||||||
|
|
||||||
if (ui.list_.GetChildAt(index) is item_live item)
|
if (ui.list_.GetChildAt(index) is item_live item)
|
||||||
{
|
{
|
||||||
item.state.selectedIndex = 0;
|
item.state.selectedIndex = 0;
|
||||||
var livedata_ = PreDownloadManager.GetLiveDataByIndex(LiveConfig[index], index);
|
var livedata_ = PreDownloadManager.GetLiveDataByIndex(LiveConfig[index], index);
|
||||||
item.mask.img_mask.fillAmount = (float)(100 - livedata_.progress) / 100;
|
item.mask.img_mask.fillAmount = (float)(100 - livedata_.progress) / 100;
|
||||||
BindPlayerToItem(item, index);
|
BindPlayerToItem(item, index);
|
||||||
if (LiveConfig[index].SubscribeUnlock == 1)
|
if (LiveConfig[index].SubscribeUnlock == 1)
|
||||||
{
|
{
|
||||||
if (livedata_.progress < 100) item.vip.selectedIndex = 1;
|
if (livedata_.progress < 100) item.vip.selectedIndex = 1;
|
||||||
else item.vip.selectedIndex = 2;
|
else item.vip.selectedIndex = 2;
|
||||||
}
|
}
|
||||||
else item.vip.selectedIndex = 0;
|
else item.vip.selectedIndex = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LiveData
|
public class LiveData
|
||||||
{
|
{
|
||||||
public int AD_num;
|
public int AD_num;
|
||||||
public int progress;
|
public int progress;
|
||||||
public int Singleprogress;
|
public int Singleprogress;
|
||||||
public long LiveADTime;
|
public long LiveADTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,346 +1,346 @@
|
|||||||
using System;
|
using System;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using FairyGUI;
|
using FairyGUI;
|
||||||
using FGUI.LG_Common;
|
using FGUI.LG_Common;
|
||||||
using FGUI.LG_live;
|
using FGUI.LG_live;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using SGModule.Common.Extensions;
|
using SGModule.Common.Extensions;
|
||||||
using SGModule.NetKit;
|
using SGModule.NetKit;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Video;
|
using UnityEngine.Video;
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
|
|
||||||
namespace BallKingdomCrush
|
namespace BallKingdomCrush
|
||||||
{
|
{
|
||||||
public class LiveDetailUI : BaseUI
|
public class LiveDetailUI : BaseUI
|
||||||
{
|
{
|
||||||
private LiveDetailUICtrl ctrl;
|
private LiveDetailUICtrl ctrl;
|
||||||
private LiveDetailModel model;
|
private LiveDetailModel model;
|
||||||
private com_liveDetail ui;
|
private com_liveDetail ui;
|
||||||
private VideoPlayer video;
|
private VideoPlayer video;
|
||||||
|
|
||||||
public LiveDetailUI(LiveDetailUICtrl ctrl) : base(ctrl)
|
public LiveDetailUI(LiveDetailUICtrl ctrl) : base(ctrl)
|
||||||
{
|
{
|
||||||
uiName = UIConst.LiveDetailUI;
|
uiName = UIConst.LiveDetailUI;
|
||||||
this.ctrl = ctrl;
|
this.ctrl = ctrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetUIInfo(UIInfo uiInfo)
|
protected override void SetUIInfo(UIInfo uiInfo)
|
||||||
{
|
{
|
||||||
uiInfo.packageName = "LG_live";
|
uiInfo.packageName = "LG_live";
|
||||||
uiInfo.assetName = "com_liveDetail";
|
uiInfo.assetName = "com_liveDetail";
|
||||||
uiInfo.layerType = UILayerType.Popup;
|
uiInfo.layerType = UILayerType.Popup;
|
||||||
uiInfo.isNeedOpenAnim = false;
|
uiInfo.isNeedOpenAnim = false;
|
||||||
uiInfo.isNeedCloseAnim = false;
|
uiInfo.isNeedCloseAnim = false;
|
||||||
uiInfo.isNeedUIMask = true;
|
uiInfo.isNeedUIMask = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//初始化页面逻辑
|
//初始化页面逻辑
|
||||||
private void Updata()
|
private void Updata()
|
||||||
{
|
{
|
||||||
if (GameHelper.GetNowTime() < livedata_.LiveADTime)
|
if (GameHelper.GetNowTime() < livedata_.LiveADTime)
|
||||||
{
|
{
|
||||||
Debug.Log("??????????????????");
|
Debug.Log("??????????????????");
|
||||||
(ui.btn_watchad as btn_ad).state.selectedIndex = 1;
|
(ui.btn_watchad as btn_ad).state.selectedIndex = 1;
|
||||||
(ui.btn_watchad as btn_ad).text_time.text = CommonHelper.TimeFormat(
|
(ui.btn_watchad as btn_ad).text_time.text = CommonHelper.TimeFormat(
|
||||||
(int)livedata_.LiveADTime - Convert.ToInt32(GameHelper.GetNowTime()),
|
(int)livedata_.LiveADTime - Convert.ToInt32(GameHelper.GetNowTime()),
|
||||||
CountDownType.Hour);
|
CountDownType.Hour);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
(ui.btn_watchad as btn_ad).state.selectedIndex = 0;
|
(ui.btn_watchad as btn_ad).state.selectedIndex = 0;
|
||||||
if (LiveConfig.AD == livedata_.AD_num + 1)
|
if (LiveConfig.AD == livedata_.AD_num + 1)
|
||||||
ui.btn_watchad.title = "+" + (100 - livedata_.progress) + "%";
|
ui.btn_watchad.title = "+" + (100 - livedata_.progress) + "%";
|
||||||
else
|
else
|
||||||
ui.btn_watchad.title = "+" + livedata_.Singleprogress + "%";
|
ui.btn_watchad.title = "+" + livedata_.Singleprogress + "%";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitView(object a = null)
|
private void InitView(object a = null)
|
||||||
{
|
{
|
||||||
// TextureHelper.SetImgLoader(ui.com_loader.GetChild("loader") as GLoader, LiveConfig.Name, () =>
|
// TextureHelper.SetImgLoader(ui.com_loader.GetChild("loader") as GLoader, LiveConfig.Name, () =>
|
||||||
// {
|
// {
|
||||||
|
|
||||||
// });
|
// });
|
||||||
Debug.Log(JsonConvert.SerializeObject(livedata_));
|
Debug.Log(JsonConvert.SerializeObject(livedata_));
|
||||||
Debug.Log(JsonConvert.SerializeObject(LiveConfig));
|
Debug.Log(JsonConvert.SerializeObject(LiveConfig));
|
||||||
|
|
||||||
Updata();
|
Updata();
|
||||||
var btn_down_coin = ((btn_unlock)ui.btn_download_coin);
|
var btn_down_coin = ((btn_unlock)ui.btn_download_coin);
|
||||||
if (GameHelper.GetVipLevel() >= 1)
|
if (GameHelper.GetVipLevel() >= 1)
|
||||||
{
|
{
|
||||||
(ui.btn_download as btn_claim_1).have_vip.selectedIndex = 1;
|
(ui.btn_download as btn_claim_1).have_vip.selectedIndex = 1;
|
||||||
ui.is_vip.selectedIndex = 1;
|
ui.is_vip.selectedIndex = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui.is_vip.selectedIndex = 0;
|
ui.is_vip.selectedIndex = 0;
|
||||||
btn_down_coin.down_load.selectedIndex = 1;
|
btn_down_coin.down_load.selectedIndex = 1;
|
||||||
}
|
}
|
||||||
if (livedata_.progress < 100)
|
if (livedata_.progress < 100)
|
||||||
{
|
{
|
||||||
ui.state.selectedIndex = 0;
|
ui.state.selectedIndex = 0;
|
||||||
if (LiveConfig.AD == 0) ui.can_speed.selectedIndex = 1;
|
if (LiveConfig.AD == 0) ui.can_speed.selectedIndex = 1;
|
||||||
if (LiveConfig.SubscribeUnlock == 1)
|
if (LiveConfig.SubscribeUnlock == 1)
|
||||||
{
|
{
|
||||||
ui.SubscribeUnlock.selectedIndex = 1;
|
ui.SubscribeUnlock.selectedIndex = 1;
|
||||||
if (GameHelper.GetVipLevel() > 0)
|
if (GameHelper.GetVipLevel() > 0)
|
||||||
{
|
{
|
||||||
ui.btn_pay.visible = false;
|
ui.btn_pay.visible = false;
|
||||||
ui.btn_watchad.visible = false;
|
ui.btn_watchad.visible = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui.SubscribeUnlock.selectedIndex = 0;
|
ui.SubscribeUnlock.selectedIndex = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ui.state.selectedIndex = 1;
|
ui.state.selectedIndex = 1;
|
||||||
if (video != null) video.Play();
|
if (video != null) video.Play();
|
||||||
}
|
}
|
||||||
|
|
||||||
(ui.img_cover.GetChild("img_mask") as GImage).fillAmount = (float)(100 - livedata_.progress) / 100;
|
(ui.img_cover.GetChild("img_mask") as GImage).fillAmount = (float)(100 - livedata_.progress) / 100;
|
||||||
ui.progress_live.value = (float)livedata_.progress;
|
ui.progress_live.value = (float)livedata_.progress;
|
||||||
|
|
||||||
//ui.btn_pay.title = LiveConfig.GoldCoins.ToString();
|
//ui.btn_pay.title = LiveConfig.GoldCoins.ToString();
|
||||||
Debug.Log(LiveConfig.GoldCoins);
|
Debug.Log(LiveConfig.GoldCoins);
|
||||||
var need_gold = (int)MathF.Ceiling((100f - livedata_.progress) * LiveConfig.GoldCoins / 100);
|
var need_gold = (int)MathF.Ceiling((100f - livedata_.progress) * LiveConfig.GoldCoins / 100);
|
||||||
ui.btn_pay.title = need_gold.ToString();
|
ui.btn_pay.title = need_gold.ToString();
|
||||||
|
|
||||||
if (LiveConfig.AD == livedata_.AD_num + 1)
|
if (LiveConfig.AD == livedata_.AD_num + 1)
|
||||||
ui.btn_watchad.title = "+" + (100 - livedata_.progress) + "%";
|
ui.btn_watchad.title = "+" + (100 - livedata_.progress) + "%";
|
||||||
else
|
else
|
||||||
ui.btn_watchad.title = "+" + livedata_.Singleprogress + "%";
|
ui.btn_watchad.title = "+" + livedata_.Singleprogress + "%";
|
||||||
|
|
||||||
|
|
||||||
ui.btn_pay.SetClick(() =>
|
ui.btn_pay.SetClick(() =>
|
||||||
{
|
{
|
||||||
if (DataMgr.Coin.Value >= need_gold)
|
if (DataMgr.Coin.Value >= need_gold)
|
||||||
{
|
{
|
||||||
DataMgr.Coin.Value -= need_gold;
|
DataMgr.Coin.Value -= need_gold;
|
||||||
|
|
||||||
livedata_.progress = 100;
|
livedata_.progress = 100;
|
||||||
DataMgr.LiveDataDic.Value[index] = livedata_;
|
DataMgr.LiveDataDic.Value[index] = livedata_;
|
||||||
Debug.Log($"[解锁成功 0] LiveData总数为: {DataMgr.LiveDataDic.Value.Count}");
|
Debug.Log($"[解锁成功 0] LiveData总数为: {DataMgr.LiveDataDic.Value.Count}");
|
||||||
DataMgr.LiveDataDic.Save();
|
DataMgr.LiveDataDic.Save();
|
||||||
|
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
GameDispatcher.Instance.Dispatch(GameMsg.Gold_refresh);
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.LiveChange, index);
|
GameDispatcher.Instance.Dispatch(GameMsg.LiveChange, index);
|
||||||
|
|
||||||
InitView();
|
InitView();
|
||||||
GameHelper.ShowTips("unlock_success", true);
|
GameHelper.ShowTips("unlock_success", true);
|
||||||
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.unlock_live_resources);
|
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.unlock_live_resources);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GameHelper.ShowTips("no_enough_gold", true);
|
GameHelper.ShowTips("no_enough_gold", true);
|
||||||
|
|
||||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ui.btn_watchad.SetClick(() =>
|
ui.btn_watchad.SetClick(() =>
|
||||||
{
|
{
|
||||||
if (livedata_.LiveADTime < GameHelper.GetNowTime())
|
if (livedata_.LiveADTime < GameHelper.GetNowTime())
|
||||||
GameHelper.ShowVideoAd("UnlockLive", isSuccess =>
|
GameHelper.ShowVideoAd("UnlockLive", isSuccess =>
|
||||||
{
|
{
|
||||||
if (isSuccess)
|
if (isSuccess)
|
||||||
{
|
{
|
||||||
livedata_.AD_num++;
|
livedata_.AD_num++;
|
||||||
if (LiveConfig.AD == livedata_.AD_num)
|
if (LiveConfig.AD == livedata_.AD_num)
|
||||||
{
|
{
|
||||||
livedata_.progress = 100;
|
livedata_.progress = 100;
|
||||||
GameHelper.ShowTips("unlock_success", true);
|
GameHelper.ShowTips("unlock_success", true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
livedata_.progress += livedata_.Singleprogress;
|
livedata_.progress += livedata_.Singleprogress;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataMgr.LiveDataDic.Value[index] = livedata_;
|
DataMgr.LiveDataDic.Value[index] = livedata_;
|
||||||
Debug.Log($"[解锁成功 1] LiveData总数为: {DataMgr.LiveDataDic.Value.Count}");
|
Debug.Log($"[解锁成功 1] LiveData总数为: {DataMgr.LiveDataDic.Value.Count}");
|
||||||
DataMgr.LiveDataDic.Save();
|
DataMgr.LiveDataDic.Save();
|
||||||
|
|
||||||
livedata_.LiveADTime = GameHelper.GetNowTime() + LiveConfig.CD;
|
livedata_.LiveADTime = GameHelper.GetNowTime() + LiveConfig.CD;
|
||||||
SaveData.SaveDataFunc();
|
SaveData.SaveDataFunc();
|
||||||
// if (livedata_.progress == 100) HandlePvPlay();
|
// if (livedata_.progress == 100) HandlePvPlay();
|
||||||
InitView();
|
InitView();
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.LiveChange, index);
|
GameDispatcher.Instance.Dispatch(GameMsg.LiveChange, index);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
ui.btn_vip_unlock.SetClick(() =>
|
ui.btn_vip_unlock.SetClick(() =>
|
||||||
{
|
{
|
||||||
if (GameHelper.GetVipLevel() > 0)
|
if (GameHelper.GetVipLevel() > 0)
|
||||||
{
|
{
|
||||||
livedata_.progress = 100;
|
livedata_.progress = 100;
|
||||||
DataMgr.LiveDataDic.Value[index] = livedata_;
|
DataMgr.LiveDataDic.Value[index] = livedata_;
|
||||||
Debug.Log($"[解锁成功 0] LiveData总数为: {DataMgr.LiveDataDic.Value.Count}");
|
Debug.Log($"[解锁成功 0] LiveData总数为: {DataMgr.LiveDataDic.Value.Count}");
|
||||||
DataMgr.LiveDataDic.Save();
|
DataMgr.LiveDataDic.Save();
|
||||||
|
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.LiveChange, index);
|
GameDispatcher.Instance.Dispatch(GameMsg.LiveChange, index);
|
||||||
|
|
||||||
// HandlePvPlay();
|
// HandlePvPlay();
|
||||||
InitView();
|
InitView();
|
||||||
GameHelper.ShowTips("unlock_success", true);
|
GameHelper.ShowTips("unlock_success", true);
|
||||||
|
|
||||||
string eventName = ADEventTrack.Property.vip_live_unclock_ + (index + 1);
|
string eventName = ADEventTrack.Property.vip_live_unclock_ + (index + 1);
|
||||||
TrackKit.SendEvent(ADEventTrack.VipLive, eventName);
|
TrackKit.SendEvent(ADEventTrack.VipLive, eventName);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.VipClubViewUI_Open, 2);
|
uiCtrlDispatcher.Dispatch(UICtrlMsg.VipClubViewUI_Open, 2);
|
||||||
TrackKit.SendEvent(ADEventTrack.VipLive, ADEventTrack.Property.vip_live_unclock);
|
TrackKit.SendEvent(ADEventTrack.VipLive, ADEventTrack.Property.vip_live_unclock);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 生命周期
|
#region 生命周期
|
||||||
|
|
||||||
protected override void OnInit()
|
protected override void OnInit()
|
||||||
{
|
{
|
||||||
//model = ModuleManager.Instance.GetModel(ModelConst.LiveDetailModel) as LiveDetailModel;
|
//model = ModuleManager.Instance.GetModel(ModelConst.LiveDetailModel) as LiveDetailModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClose()
|
protected override void OnClose()
|
||||||
{
|
{
|
||||||
if (video != null) Object.Destroy(video.gameObject);
|
if (video != null) Object.Destroy(video.gameObject);
|
||||||
HallManager.Instance.UpdateSecondEvent -= Updata;
|
HallManager.Instance.UpdateSecondEvent -= Updata;
|
||||||
|
|
||||||
VideoPlayerHandover.Return();
|
VideoPlayerHandover.Return();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnBind()
|
protected override void OnBind()
|
||||||
{
|
{
|
||||||
ui = baseUI as com_liveDetail;
|
ui = baseUI as com_liveDetail;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandlePvPlay()
|
private void HandlePvPlay()
|
||||||
{
|
{
|
||||||
Debug.Log("HandlePvPlay: " + index);
|
Debug.Log("HandlePvPlay: " + index);
|
||||||
var secondUIRoot = ui.displayObject.gameObject.transform;
|
var secondUIRoot = ui.displayObject.gameObject.transform;
|
||||||
var loader = ui.com_loader.GetChild("loader") as GLoader;
|
var loader = ui.com_loader.GetChild("loader") as GLoader;
|
||||||
|
|
||||||
|
|
||||||
// 接管播放器
|
// 接管播放器
|
||||||
VideoPlayerHandover.TakeOver(player, secondUIRoot, loader);
|
VideoPlayerHandover.TakeOver(player, secondUIRoot, loader);
|
||||||
ui.img_cover.visible = false;
|
ui.img_cover.visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int index;
|
private int index;
|
||||||
private VideoPlayer player;
|
private VideoPlayer player;
|
||||||
private LiveData livedata_;
|
private LiveData livedata_;
|
||||||
private Live LiveConfig;
|
private Live LiveConfig;
|
||||||
|
|
||||||
protected override void OnOpenBefore(object args)
|
protected override void OnOpenBefore(object args)
|
||||||
{
|
{
|
||||||
var tuple = ((int index, VideoPlayer player))args;
|
var tuple = ((int index, VideoPlayer player))args;
|
||||||
|
|
||||||
index = tuple.index;
|
index = tuple.index;
|
||||||
player = tuple.player;
|
player = tuple.player;
|
||||||
player.audioOutputMode = VideoAudioOutputMode.None;
|
player.audioOutputMode = VideoAudioOutputMode.None;
|
||||||
|
|
||||||
// 从配置表取配置(这里还是 List,如果有 Id 字段可改成字典)
|
// 从配置表取配置(这里还是 List,如果有 Id 字段可改成字典)
|
||||||
LiveConfig = ConfigSystem.GetConfig<Live>()[index];
|
LiveConfig = ConfigSystem.GetLiveConfig()[index];
|
||||||
|
|
||||||
livedata_ = PreDownloadManager.GetLiveDataByIndex(LiveConfig, index);
|
livedata_ = PreDownloadManager.GetLiveDataByIndex(LiveConfig, index);
|
||||||
|
|
||||||
ui.btn_close.SetClick(() => { CtrlCloseUI(); });
|
ui.btn_close.SetClick(() => { CtrlCloseUI(); });
|
||||||
|
|
||||||
|
|
||||||
if (livedata_.progress >= 100 && LiveVideoManager.Instance.ExistVideo(LiveConfig.Name))
|
if (livedata_.progress >= 100 && LiveVideoManager.Instance.ExistVideo(LiveConfig.Name))
|
||||||
HandlePvPlay();
|
HandlePvPlay();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var coverLoader = ui.img_cover.GetChild("loader") as GLoader;
|
var coverLoader = ui.img_cover.GetChild("loader") as GLoader;
|
||||||
LiveVideoManager.Instance.GetVideoCover(coverLoader, LiveConfig.Name + "_cover", (tex) =>
|
LiveVideoManager.Instance.GetVideoCover(coverLoader, LiveConfig.Name + "_cover", (tex) =>
|
||||||
{
|
{
|
||||||
if (tex != null)
|
if (tex != null)
|
||||||
{
|
{
|
||||||
if (coverLoader != null)
|
if (coverLoader != null)
|
||||||
{
|
{
|
||||||
coverLoader.texture = new NTexture(tex);
|
coverLoader.texture = new NTexture(tex);
|
||||||
coverLoader.visible = true;
|
coverLoader.visible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var btn_down_coin = ((btn_unlock)ui.btn_download_coin);
|
var btn_down_coin = ((btn_unlock)ui.btn_download_coin);
|
||||||
var downloadCoinNum = ConfigSystem.GetCommonConf().CoinsDownload;
|
var downloadCoinNum = ConfigSystem.GetCommonConf().CoinsDownload;
|
||||||
btn_down_coin.title = downloadCoinNum.ToString();
|
btn_down_coin.title = downloadCoinNum.ToString();
|
||||||
HallManager.Instance.UpdateSecondEvent += Updata;
|
HallManager.Instance.UpdateSecondEvent += Updata;
|
||||||
|
|
||||||
btn_down_coin.SetClick(() =>
|
btn_down_coin.SetClick(() =>
|
||||||
{
|
{
|
||||||
|
|
||||||
if (GameHelper.Get101() >= downloadCoinNum)
|
if (GameHelper.Get101() >= downloadCoinNum)
|
||||||
{
|
{
|
||||||
DataMgr.Coin.Value -= downloadCoinNum;
|
DataMgr.Coin.Value -= downloadCoinNum;
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
GameDispatcher.Instance.Dispatch(GameMsg.Update101);
|
||||||
TextureHelper.SaveVideoToAlbum(LiveConfig.Name, CtrlCloseUI);
|
TextureHelper.SaveVideoToAlbum(LiveConfig.Name, CtrlCloseUI);
|
||||||
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
|
TrackKit.SendEvent(ADEventTrack.Coinsbuy, ADEventTrack.Property.download);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GameHelper.ShowTips("no_enough_gold", true);
|
GameHelper.ShowTips("no_enough_gold", true);
|
||||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
uiCtrlDispatcher.Dispatch(UICtrlMsg.BuygoldUI_Open);
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
ui.btn_download.SetClick(() =>
|
ui.btn_download.SetClick(() =>
|
||||||
{
|
{
|
||||||
if (GameHelper.GetVipLevel() >= 1)
|
if (GameHelper.GetVipLevel() >= 1)
|
||||||
{
|
{
|
||||||
TextureHelper.SaveVideoToAlbum(LiveConfig.Name, CtrlCloseUI);
|
TextureHelper.SaveVideoToAlbum(LiveConfig.Name, CtrlCloseUI);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
GameHelper.ShowVideoAd("DownloadLive", isSuccess =>
|
GameHelper.ShowVideoAd("DownloadLive", isSuccess =>
|
||||||
{
|
{
|
||||||
if (isSuccess) TextureHelper.SaveVideoToAlbum(LiveConfig.Name, CtrlCloseUI);
|
if (isSuccess) TextureHelper.SaveVideoToAlbum(LiveConfig.Name, CtrlCloseUI);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
InitView();
|
InitView();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnOpen(object args)
|
protected override void OnOpen(object args)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnHide()
|
protected override void OnHide()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisplay(object args)
|
protected override void OnDisplay(object args)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 消息
|
#region 消息
|
||||||
|
|
||||||
protected override void AddListener()
|
protected override void AddListener()
|
||||||
{
|
{
|
||||||
GameDispatcher.Instance.AddListener(GameMsg.BuyVip, InitView);
|
GameDispatcher.Instance.AddListener(GameMsg.BuyVip, InitView);
|
||||||
GameDispatcher.Instance.AddListener(GameMsg.liveVideoLoaded, liveVideoLoaded);
|
GameDispatcher.Instance.AddListener(GameMsg.liveVideoLoaded, liveVideoLoaded);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void RemoveListener()
|
protected override void RemoveListener()
|
||||||
{
|
{
|
||||||
HallManager.Instance.UpdateSecondEvent -= Updata;
|
HallManager.Instance.UpdateSecondEvent -= Updata;
|
||||||
GameDispatcher.Instance.RemoveListener(GameMsg.BuyVip, InitView);
|
GameDispatcher.Instance.RemoveListener(GameMsg.BuyVip, InitView);
|
||||||
GameDispatcher.Instance.RemoveListener(GameMsg.liveVideoLoaded, liveVideoLoaded);
|
GameDispatcher.Instance.RemoveListener(GameMsg.liveVideoLoaded, liveVideoLoaded);
|
||||||
}
|
}
|
||||||
private void liveVideoLoaded(object o)
|
private void liveVideoLoaded(object o)
|
||||||
{
|
{
|
||||||
HandlePvPlay();
|
HandlePvPlay();
|
||||||
// InitView();
|
// InitView();
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,235 +1,239 @@
|
|||||||
using System;
|
using System;
|
||||||
using FairyGUI;
|
using FairyGUI;
|
||||||
using FGUI.ZM_Setting_07;
|
using FGUI.ZM_Setting_07;
|
||||||
|
|
||||||
|
|
||||||
// using FGUI.G006_menu;
|
// using FGUI.G006_menu;
|
||||||
|
|
||||||
|
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace BallKingdomCrush
|
namespace BallKingdomCrush
|
||||||
{
|
{
|
||||||
public class MenuUI : BaseUI
|
public class MenuUI : BaseUI
|
||||||
{
|
{
|
||||||
private MenuUICtrl ctrl;
|
private MenuUICtrl ctrl;
|
||||||
private MenuModel model;
|
private MenuModel model;
|
||||||
private FGUI.ZM_Setting_07.com_setting ui;
|
private FGUI.ZM_Setting_07.com_setting ui;
|
||||||
private int selectIndex = -1;
|
private int selectIndex = -1;
|
||||||
|
|
||||||
private int total_item;
|
private int total_item;
|
||||||
|
|
||||||
public MenuUI(MenuUICtrl ctrl) : base(ctrl)
|
public MenuUI(MenuUICtrl ctrl) : base(ctrl)
|
||||||
{
|
{
|
||||||
uiName = UIConst.MenuUI;
|
uiName = UIConst.MenuUI;
|
||||||
this.ctrl = ctrl;
|
this.ctrl = ctrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetUIInfo(UIInfo uiInfo)
|
protected override void SetUIInfo(UIInfo uiInfo)
|
||||||
{
|
{
|
||||||
uiInfo.packageName = "ZM_Setting_07";
|
uiInfo.packageName = "ZM_Setting_07";
|
||||||
uiInfo.assetName = "com_setting";
|
uiInfo.assetName = "com_setting";
|
||||||
uiInfo.layerType = UILayerType.Popup;
|
uiInfo.layerType = UILayerType.Popup;
|
||||||
uiInfo.isNeedOpenAnim = false;
|
uiInfo.isNeedOpenAnim = false;
|
||||||
uiInfo.isNeedCloseAnim = false;
|
uiInfo.isNeedCloseAnim = false;
|
||||||
uiInfo.isNeedUIMask = true;
|
uiInfo.isNeedUIMask = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 生命周期
|
#region 生命周期
|
||||||
|
|
||||||
protected override void OnInit()
|
protected override void OnInit()
|
||||||
{
|
{
|
||||||
model = moduleManager.GetModel(ModelConst.MenuModel) as MenuModel;
|
model = moduleManager.GetModel(ModelConst.MenuModel) as MenuModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClose()
|
protected override void OnClose()
|
||||||
{
|
{
|
||||||
CommonHelper.FadeOut(ui);
|
CommonHelper.FadeOut(ui);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnBind()
|
protected override void OnBind()
|
||||||
{
|
{
|
||||||
ui = baseUI as FGUI.ZM_Setting_07.com_setting;
|
ui = baseUI as FGUI.ZM_Setting_07.com_setting;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnOpenBefore(object args)
|
protected override void OnOpenBefore(object args)
|
||||||
{
|
{
|
||||||
total_item = 8;
|
total_item = 8;
|
||||||
selectIndex = DataMgr.PlayerAvatarId.Value;
|
selectIndex = DataMgr.PlayerAvatarId.Value;
|
||||||
|
|
||||||
InitView();
|
InitView();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnOpen(object args)
|
protected override void OnOpen(object args)
|
||||||
{
|
{
|
||||||
CommonHelper.FadeIn(ui);
|
CommonHelper.FadeIn(ui);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnHide()
|
protected override void OnHide()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisplay(object args)
|
protected override void OnDisplay(object args)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 消息
|
#region 消息
|
||||||
|
|
||||||
protected override void AddListener()
|
protected override void AddListener()
|
||||||
{
|
{
|
||||||
HallManager.Instance.AddChangeGiftSwitch(InitView);
|
HallManager.Instance.AddChangeGiftSwitch(InitView);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void RemoveListener()
|
protected override void RemoveListener()
|
||||||
{
|
{
|
||||||
HallManager.Instance.RemoveChangeGiftSwitch(InitView);
|
HallManager.Instance.RemoveChangeGiftSwitch(InitView);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void InitView()
|
private void InitView()
|
||||||
{
|
{
|
||||||
var namStr = GameHelper.GetUserName();
|
var namStr = GameHelper.GetUserName();
|
||||||
// com_Person.edit_name.input.text = namStr;
|
// com_Person.edit_name.input.text = namStr;
|
||||||
// com_Person.btn_update.SetClick(UpdateUserInfo);
|
// com_Person.btn_update.SetClick(UpdateUserInfo);
|
||||||
// com_Person.edit_name.btn_amend.SetClick(SaveName);
|
// com_Person.edit_name.btn_amend.SetClick(SaveName);
|
||||||
|
|
||||||
ui.btn_back.SetClick(OnCloseView);
|
ui.btn_back.SetClick(OnCloseView);
|
||||||
ui.btn_music.SetClick(OnClickSetMusic);
|
ui.btn_music.SetClick(OnClickSetMusic);
|
||||||
ui.btn_sound.SetClick(OnClickSoundBtn);
|
ui.btn_sound.SetClick(OnClickSoundBtn);
|
||||||
|
|
||||||
ui.btn_privacy.menus.selectedIndex = btn_menu.Menus_privacy;
|
ui.btn_privacy.menus.selectedIndex = btn_menu.Menus_privacy;
|
||||||
ui.btn_terms.menus.selectedIndex = btn_menu.Menus_terms;
|
ui.btn_terms.menus.selectedIndex = btn_menu.Menus_terms;
|
||||||
ui.btn_language.menus.selectedIndex = btn_menu.Menus_delete;
|
ui.btn_language.menus.selectedIndex = btn_menu.Menus_delete;
|
||||||
ui.btn_official.menus.selectedIndex = btn_menu.Menus_official;
|
ui.btn_official.menus.selectedIndex = btn_menu.Menus_official;
|
||||||
ui.btn_restore.menus.selectedIndex = 4;
|
ui.btn_email.menus.selectedIndex = 5;
|
||||||
|
ui.btn_restore.menus.selectedIndex = 4;
|
||||||
ui.btn_privacy.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 0); });
|
|
||||||
ui.btn_terms.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 1); });
|
ui.btn_privacy.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 0); });
|
||||||
ui.btn_language.SetClick(() =>
|
ui.btn_terms.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, 1); });
|
||||||
{
|
ui.btn_language.SetClick(() =>
|
||||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LanguageViewUI_Open);
|
{
|
||||||
});
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LanguageViewUI_Open);
|
||||||
ui.btn_official.SetClick(() => { Application.OpenURL("https://official.piggyhydration.com/"); });
|
});
|
||||||
ui.btn_restore.SetClick(Restore);
|
ui.btn_official.SetClick(() => { Application.OpenURL("https://www.ballcrushbest.com"); });
|
||||||
|
ui.btn_restore.SetClick(Restore);
|
||||||
SetUID();
|
ui.btn_email.SetClick(() => {
|
||||||
SetVersion();
|
GameHelper.OpenEmail();
|
||||||
RefreshMusicUI();
|
});
|
||||||
|
|
||||||
// com_Person.list.itemRenderer = UpdateItem;
|
SetUID();
|
||||||
// com_Person.list.numItems = total_item;
|
SetVersion();
|
||||||
}
|
RefreshMusicUI();
|
||||||
|
|
||||||
private void Restore()
|
// com_Person.list.itemRenderer = UpdateItem;
|
||||||
{
|
// com_Person.list.numItems = total_item;
|
||||||
if (GameHelper.IsAdModelOfPay()) return;
|
}
|
||||||
// GooglePayManager.Instance.RestoreNonConsumable();
|
|
||||||
}
|
private void Restore()
|
||||||
// private void UpdateItem(int index, GObject items)
|
{
|
||||||
// {
|
if (GameHelper.IsAdModelOfPay()) return;
|
||||||
// var currentIndex = index + 1;
|
// GooglePayManager.Instance.RestoreNonConsumable();
|
||||||
// var head = items as btn_item_head;
|
}
|
||||||
// var imgHead = head.head as btn_head;
|
// private void UpdateItem(int index, GObject items)
|
||||||
|
// {
|
||||||
// TextureHelper.SetAvatarToLoader(currentIndex, imgHead.load_avatar);
|
// var currentIndex = index + 1;
|
||||||
// head.head_select.selectedIndex = selectIndex == currentIndex
|
// var head = items as btn_item_head;
|
||||||
// ? btn_item_head.Head_select_select
|
// var imgHead = head.head as btn_head;
|
||||||
// : btn_item_head.Head_select_none;
|
|
||||||
|
// TextureHelper.SetAvatarToLoader(currentIndex, imgHead.load_avatar);
|
||||||
// head.SetClick(() =>
|
// head.head_select.selectedIndex = selectIndex == currentIndex
|
||||||
// {
|
// ? btn_item_head.Head_select_select
|
||||||
// selectIndex = currentIndex;
|
// : btn_item_head.Head_select_none;
|
||||||
// com_Person.list.numItems = total_item;
|
|
||||||
// });
|
// head.SetClick(() =>
|
||||||
|
// {
|
||||||
|
// selectIndex = currentIndex;
|
||||||
// }
|
// com_Person.list.numItems = total_item;
|
||||||
|
// });
|
||||||
|
|
||||||
private void UpdateUserInfo()
|
|
||||||
{
|
// }
|
||||||
if (selectIndex != -1)
|
|
||||||
{
|
|
||||||
DataMgr.PlayerAvatarId.Value = selectIndex;
|
private void UpdateUserInfo()
|
||||||
}
|
{
|
||||||
|
if (selectIndex != -1)
|
||||||
SaveName();
|
{
|
||||||
|
DataMgr.PlayerAvatarId.Value = selectIndex;
|
||||||
OnCloseView();
|
}
|
||||||
|
|
||||||
}
|
SaveName();
|
||||||
|
|
||||||
private void SaveName()
|
OnCloseView();
|
||||||
{
|
|
||||||
// var name = com_Person.edit_name.input.text;
|
}
|
||||||
|
|
||||||
// if (string.IsNullOrEmpty(name) || name.IsNullOrWhiteSpace())
|
private void SaveName()
|
||||||
// {
|
{
|
||||||
// GameHelper.ShowTips("empty_input", true);
|
// var name = com_Person.edit_name.input.text;
|
||||||
// return;
|
|
||||||
// }
|
// if (string.IsNullOrEmpty(name) || name.IsNullOrWhiteSpace())
|
||||||
|
// {
|
||||||
// // if (name.Equals(GameHelper.GetPlayerInviteCode()))
|
// GameHelper.ShowTips("empty_input", true);
|
||||||
// // {
|
// return;
|
||||||
// // return;
|
// }
|
||||||
// // }
|
|
||||||
|
// // if (name.Equals(GameHelper.GetPlayerInviteCode()))
|
||||||
// if (name.Equals(PreferencesMgr.Instance.PlayerName)) return;
|
// // {
|
||||||
|
// // return;
|
||||||
// GameHelper.ShowTips($"Name changed successfully");
|
// // }
|
||||||
// PreferencesMgr.Instance.PlayerName = name;
|
|
||||||
}
|
// if (name.Equals(PreferencesMgr.Instance.PlayerName)) return;
|
||||||
|
|
||||||
private void SetVersion()
|
// GameHelper.ShowTips($"Name changed successfully");
|
||||||
{
|
// PreferencesMgr.Instance.PlayerName = name;
|
||||||
ui.text_version.SetVar("count", Application.version).FlushVars();
|
}
|
||||||
}
|
|
||||||
|
private void SetVersion()
|
||||||
private void SetUID()
|
{
|
||||||
{
|
ui.text_version.SetVar("count", Application.version).FlushVars();
|
||||||
ui.text_uid.SetVar("UID", GameHelper.GetLoginModel().Uid.ToString()).FlushVars();
|
}
|
||||||
}
|
|
||||||
|
private void SetUID()
|
||||||
public override void OnSwitchLanguage()
|
{
|
||||||
{
|
ui.text_uid.SetVar("UID", GameHelper.GetLoginModel().Uid.ToString()).FlushVars();
|
||||||
base.OnSwitchLanguage();
|
}
|
||||||
|
|
||||||
SetVersion();
|
public override void OnSwitchLanguage()
|
||||||
|
{
|
||||||
SetUID();
|
base.OnSwitchLanguage();
|
||||||
}
|
|
||||||
private void CloseMenu(Action action = null)
|
SetVersion();
|
||||||
{
|
|
||||||
CtrlCloseUI();
|
SetUID();
|
||||||
action?.Invoke();
|
}
|
||||||
}
|
private void CloseMenu(Action action = null)
|
||||||
private void OnCloseView()
|
{
|
||||||
{
|
CtrlCloseUI();
|
||||||
CloseMenu();
|
action?.Invoke();
|
||||||
}
|
}
|
||||||
|
private void OnCloseView()
|
||||||
private void OnClickSetMusic()
|
{
|
||||||
{
|
CloseMenu();
|
||||||
model.IsOpenMusic = !model.IsOpenMusic;
|
}
|
||||||
RefreshMusicUI();
|
|
||||||
}
|
private void OnClickSetMusic()
|
||||||
|
{
|
||||||
private void OnClickSoundBtn()
|
model.IsOpenMusic = !model.IsOpenMusic;
|
||||||
{
|
RefreshMusicUI();
|
||||||
model.IsOpenEffect = !model.IsOpenEffect;
|
}
|
||||||
RefreshMusicUI();
|
|
||||||
}
|
private void OnClickSoundBtn()
|
||||||
|
{
|
||||||
private void RefreshMusicUI()
|
model.IsOpenEffect = !model.IsOpenEffect;
|
||||||
{
|
RefreshMusicUI();
|
||||||
ui.btn_music.music_on_off.selectedIndex =
|
}
|
||||||
model.IsOpenMusic ? 0 : 1;
|
|
||||||
ui.btn_sound.sound_on_off.selectedIndex =
|
private void RefreshMusicUI()
|
||||||
model.IsOpenEffect ? 0 : 1;
|
{
|
||||||
}
|
ui.btn_music.music_on_off.selectedIndex =
|
||||||
}
|
model.IsOpenMusic ? 0 : 1;
|
||||||
|
ui.btn_sound.sound_on_off.selectedIndex =
|
||||||
|
model.IsOpenEffect ? 0 : 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,123 +1,123 @@
|
|||||||
using System;
|
using System;
|
||||||
|
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Spine.Unity;
|
using Spine.Unity;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace BallKingdomCrush
|
namespace BallKingdomCrush
|
||||||
{
|
{
|
||||||
public class OpenGameUI : BaseUI
|
public class OpenGameUI : BaseUI
|
||||||
{
|
{
|
||||||
private OpenGameUICtrl ctrl;
|
private OpenGameUICtrl ctrl;
|
||||||
private OpenGameModel model;
|
private OpenGameModel model;
|
||||||
private FGUI.ZM_Game_04.com_open ui;
|
private FGUI.ZM_Game_04.com_open ui;
|
||||||
|
|
||||||
public OpenGameUI(OpenGameUICtrl ctrl) : base(ctrl)
|
public OpenGameUI(OpenGameUICtrl ctrl) : base(ctrl)
|
||||||
{
|
{
|
||||||
uiName = UIConst.OpenGameUI;
|
uiName = UIConst.OpenGameUI;
|
||||||
this.ctrl = ctrl;
|
this.ctrl = ctrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void SetUIInfo(UIInfo uiInfo)
|
protected override void SetUIInfo(UIInfo uiInfo)
|
||||||
{
|
{
|
||||||
uiInfo.packageName = "ZM_Game_04";
|
uiInfo.packageName = "ZM_Game_04";
|
||||||
uiInfo.assetName = "com_open";
|
uiInfo.assetName = "com_open";
|
||||||
uiInfo.layerType = UILayerType.Highest;
|
uiInfo.layerType = UILayerType.Highest;
|
||||||
uiInfo.isNeedOpenAnim = false;
|
uiInfo.isNeedOpenAnim = false;
|
||||||
uiInfo.isNeedCloseAnim = false;
|
uiInfo.isNeedCloseAnim = false;
|
||||||
uiInfo.isNeedUIMask = false;
|
uiInfo.isNeedUIMask = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 生命周期
|
#region 生命周期
|
||||||
protected override void OnInit()
|
protected override void OnInit()
|
||||||
{
|
{
|
||||||
// model = ModuleManager.Instance.GetModel(ModelConst.OpenGameModel) as OpenGameModel;
|
// model = ModuleManager.Instance.GetModel(ModelConst.OpenGameModel) as OpenGameModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnClose()
|
protected override void OnClose()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnBind()
|
protected override void OnBind()
|
||||||
{
|
{
|
||||||
ui = baseUI as FGUI.ZM_Game_04.com_open;
|
ui = baseUI as FGUI.ZM_Game_04.com_open;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnOpenBefore(object args)
|
protected override void OnOpenBefore(object args)
|
||||||
{
|
{
|
||||||
Debug.Log(JsonConvert.SerializeObject(DataMgr.LevelUnlockList.Value));
|
Debug.Log(JsonConvert.SerializeObject(DataMgr.LevelUnlockList.Value));
|
||||||
DOVirtual.DelayedCall(0.7f, () =>
|
DOVirtual.DelayedCall(0.7f, () =>
|
||||||
{
|
{
|
||||||
GameDispatcher.Instance.Dispatch(GameMsg.reset_game, args);
|
GameDispatcher.Instance.Dispatch(GameMsg.reset_game, args);
|
||||||
});
|
});
|
||||||
InitView();
|
InitView();
|
||||||
|
|
||||||
if (GameHelper.IsGiftSwitch())
|
if (GameHelper.IsGiftSwitch())
|
||||||
{
|
{
|
||||||
DOVirtual.DelayedCall(0.2f, () =>
|
DOVirtual.DelayedCall(0.2f, () =>
|
||||||
{
|
{
|
||||||
Debug.Log($"open 1 game------------------{GameHelper.GetLevel() - 1}");
|
Debug.Log($"open 1 game------------------{GameHelper.GetLevel() - 1}");
|
||||||
|
|
||||||
if (GameHelper.GetLevel() - 1 < ConfigSystem.GetConfig<LevelUnlock>().Count)
|
if (GameHelper.GetLevel() - 1 < ConfigSystem.GetLevelUnlockConfig().Count)
|
||||||
{
|
{
|
||||||
LevelUnlock levelUnlock_ = ConfigSystem.GetConfig<LevelUnlock>()[GameHelper.GetLevel() - 1];
|
LevelUnlock levelUnlock_ = ConfigSystem.GetLevelUnlockConfig()[GameHelper.GetLevel() - 1];
|
||||||
|
|
||||||
Debug.Log($"open 2 game------------------{levelUnlock_.LeveType}");
|
Debug.Log($"open 2 game------------------{levelUnlock_.LeveType}");
|
||||||
if (levelUnlock_.LeveType != 0)
|
if (levelUnlock_.LeveType != 0)
|
||||||
{
|
{
|
||||||
Debug.Log($"open 3 game------------------{DataMgr.LevelUnlockList.Value.Count}");
|
Debug.Log($"open 3 game------------------{DataMgr.LevelUnlockList.Value.Count}");
|
||||||
if (!DataMgr.LevelUnlockList.Value.Contains(GameHelper.GetLevel() - 1))
|
if (!DataMgr.LevelUnlockList.Value.Contains(GameHelper.GetLevel() - 1))
|
||||||
{
|
{
|
||||||
uiCtrlDispatcher.Dispatch(UICtrlMsg.UnlockLevelUI_Open, GameHelper.GetLevel() - 1);
|
uiCtrlDispatcher.Dispatch(UICtrlMsg.UnlockLevelUI_Open, GameHelper.GetLevel() - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ui.t0.Play();
|
ui.t0.Play();
|
||||||
|
|
||||||
if (AudioManager.Instance.IsOpenEffect)
|
if (AudioManager.Instance.IsOpenEffect)
|
||||||
{
|
{
|
||||||
AudioManager.Instance.PlayDynamicEffect(AudioConst.game_open);
|
AudioManager.Instance.PlayDynamicEffect(AudioConst.game_open);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnOpen(object args)
|
protected override void OnOpen(object args)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnHide()
|
protected override void OnHide()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnDisplay(object args)
|
protected override void OnDisplay(object args)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 消息
|
#region 消息
|
||||||
protected override void AddListener()
|
protected override void AddListener()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
protected override void RemoveListener()
|
protected override void RemoveListener()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
private Action closeCallback;
|
private Action closeCallback;
|
||||||
//初始化页面逻辑
|
//初始化页面逻辑
|
||||||
private void InitView()
|
private void InitView()
|
||||||
{
|
{
|
||||||
|
|
||||||
string stage = Language.GetContentParams("need_lv_text", GameHelper.GetLevel());
|
string stage = Language.GetContentParams("need_lv_text", GameHelper.GetLevel());
|
||||||
|
|
||||||
ui.text_level.text = stage;
|
ui.text_level.text = stage;
|
||||||
|
|
||||||
DOVirtual.DelayedCall(1.2f, () => { CtrlCloseUI(); });
|
DOVirtual.DelayedCall(1.2f, () => { CtrlCloseUI(); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4,9 +4,11 @@ using AppsFlyerSDK;
|
|||||||
using FairyGUI;
|
using FairyGUI;
|
||||||
using IgnoreOPS;
|
using IgnoreOPS;
|
||||||
using SGModule.Common.Extensions;
|
using SGModule.Common.Extensions;
|
||||||
|
using SGModule.GooglePay;
|
||||||
using SGModule.Net;
|
using SGModule.Net;
|
||||||
using SGModule.NetKit;
|
using SGModule.NetKit;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using ZrZYFo6bYXYM71YyLSDK;
|
||||||
|
|
||||||
namespace BallKingdomCrush
|
namespace BallKingdomCrush
|
||||||
{
|
{
|
||||||
@@ -291,10 +293,10 @@ namespace BallKingdomCrush
|
|||||||
int startIndex = "secret_albnums".Length;
|
int startIndex = "secret_albnums".Length;
|
||||||
string suffix = type[startIndex..]; // 截取 "gold" 后的所有字符
|
string suffix = type[startIndex..]; // 截取 "gold" 后的所有字符
|
||||||
int suffix_num = int.Parse(suffix);
|
int suffix_num = int.Parse(suffix);
|
||||||
var model = ConfigSystem.GetConfig<SecretAlbums>()[suffix_num];
|
var model = ConfigSystem.GetSecretAlbumsConfig()[suffix_num];
|
||||||
if (model.PayType == (int)UnlockPayType.Pay)
|
if (model.PayType == (int)UnlockPayType.Pay)
|
||||||
{
|
{
|
||||||
purch_number = ConfigSystem.GetConfig<SecretAlbums>()[suffix_num].DiscountPrice.ToString();
|
purch_number = ConfigSystem.GetSecretAlbumsConfig()[suffix_num].DiscountPrice.ToString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PayloadingUI_Close);
|
||||||
@@ -303,20 +305,42 @@ namespace BallKingdomCrush
|
|||||||
{
|
{
|
||||||
var payType = MaxPayManager.isOfficialPay ? 0 : 1;
|
var payType = MaxPayManager.isOfficialPay ? 0 : 1;
|
||||||
// 付费上报BI
|
// 付费上报BI
|
||||||
BIManager.Instance.TrackPurchase(purch_number.As<double>(), "USD", payType.ToString(), type, "paid");
|
// BIManager.Instance.TrackPurchase(purch_number.As<double>(), "USD", payType.ToString(), type, "paid");
|
||||||
|
|
||||||
Debug.Log("付费收益上报AF----------- " + revenue);
|
// Debug.Log("付费收益上报AF----------- " + revenue);
|
||||||
adCallbackInfo.Clear();
|
// adCallbackInfo.Clear();
|
||||||
adCallbackInfo.Add("appsflyer_id", AppsFlyer.getAppsFlyerId());
|
// adCallbackInfo.Add("appsflyer_id", AppsFlyer.getAppsFlyerId());
|
||||||
adCallbackInfo.Add("customer_user_id", GameHelper.GetLoginModel().Uid.ToString());
|
// adCallbackInfo.Add("customer_user_id", GameHelper.GetLoginModel().Uid.ToString());
|
||||||
adCallbackInfo.Add("af_currency", "USD");
|
// adCallbackInfo.Add("af_currency", "USD");
|
||||||
adCallbackInfo.Add("af_revenue", revenue.ToString(CultureInfo.InvariantCulture));
|
// adCallbackInfo.Add("af_revenue", revenue.ToString(CultureInfo.InvariantCulture));
|
||||||
AppsFlyer.sendEvent("af_purchase", adCallbackInfo);
|
// AppsFlyer.sendEvent("af_purchase", adCallbackInfo);
|
||||||
|
|
||||||
FireBaseManger.OnPayRevenueEvent(purch_number.As<double>());
|
// FireBaseManger.OnPayRevenueEvent(purch_number.As<double>());
|
||||||
|
|
||||||
|
// ZrZYFo6bYXYM71YyLSDKCONTROLLER.Instance.Track("af_purchase", new Dictionary<string, string>()
|
||||||
|
// {
|
||||||
|
// {"evt1", "1"},
|
||||||
|
// });
|
||||||
|
|
||||||
TrackKit.SendEvent(AfPurchaseTrack.Event, AfPurchaseTrack.Property.af_revenue,(int)(purch_number.As<decimal>() * 10000));
|
TrackKit.SendEvent(AfPurchaseTrack.Event, AfPurchaseTrack.Property.af_revenue,(int)(purch_number.As<decimal>() * 10000));
|
||||||
|
var payData = new GooglePayData
|
||||||
|
{
|
||||||
|
sku = type,
|
||||||
|
currency = "USD",
|
||||||
|
amount = (int)(purch_number.As<decimal>() * 100),
|
||||||
|
isCompleted = true
|
||||||
|
};
|
||||||
|
|
||||||
|
//上报给服务器,用来做数据分析,之前创建订单接口改的
|
||||||
|
GooglePayNet.GooglePayCreate<GooglePayData>(payData, (response) =>
|
||||||
|
{
|
||||||
|
Debug.Log($"[付费收益] Purchase-----type--{type}----{response.IsSuccess}");
|
||||||
|
|
||||||
|
if (response.IsSuccess)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ namespace BallKingdomCrush
|
|||||||
|
|
||||||
// 强制卸载未使用的资源
|
// 强制卸载未使用的资源
|
||||||
// Resources.UnloadUnusedAssets();
|
// Resources.UnloadUnusedAssets();
|
||||||
MemoryManager.CleanMemoryMonitor();
|
// MemoryManager.CleanMemoryMonitor();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnBind()
|
protected override void OnBind()
|
||||||
@@ -86,7 +86,7 @@ namespace BallKingdomCrush
|
|||||||
var eventName = GameHelper.IsAdModelOfPay() ? ADEventTrack.AD_Event : ADEventTrack.MaxPayEvent;
|
var eventName = GameHelper.IsAdModelOfPay() ? ADEventTrack.AD_Event : ADEventTrack.MaxPayEvent;
|
||||||
TrackKit.SendEvent(eventName, ADEventTrack.Property.secret_albums_show);
|
TrackKit.SendEvent(eventName, ADEventTrack.Property.secret_albums_show);
|
||||||
|
|
||||||
_secretData = ConfigSystem.GetConfig<SecretAlbums>();
|
_secretData = ConfigSystem.GetSecretAlbumsConfig();
|
||||||
InitView();
|
InitView();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace BallKingdomCrush
|
|||||||
loader_list.Clear();
|
loader_list.Clear();
|
||||||
|
|
||||||
// 强制卸载未使用的资源
|
// 强制卸载未使用的资源
|
||||||
Resources.UnloadUnusedAssets();
|
// Resources.UnloadUnusedAssets();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnBind()
|
protected override void OnBind()
|
||||||
|
|||||||