diff --git a/ArrowBeatTap-Gp.sln.DotSettings.user b/ArrowBeatTap-Gp.sln.DotSettings.user index d5a02d7..5e4e497 100644 --- a/ArrowBeatTap-Gp.sln.DotSettings.user +++ b/ArrowBeatTap-Gp.sln.DotSettings.user @@ -12,5 +12,6 @@ ForceIncluded ForceIncluded ForceIncluded + ForceIncluded ForceIncluded ForceIncluded \ No newline at end of file diff --git a/Assets/ChillConnect/Define/Model/Config/Game/CommonModel.cs b/Assets/ChillConnect/Define/Model/Config/Game/CommonModel.cs index 212373e..4502771 100644 --- a/Assets/ChillConnect/Define/Model/Config/Game/CommonModel.cs +++ b/Assets/ChillConnect/Define/Model/Config/Game/CommonModel.cs @@ -89,6 +89,8 @@ namespace IgnoreOPS public int ProcessingTime; public int[] WVOffset; + + public string X_Redeemcode; public CommonModel(string key) : base(key) diff --git a/Assets/ChillConnect/FGUI/package/Arrow_game/com_arrow_game.cs b/Assets/ChillConnect/FGUI/package/Arrow_game/com_arrow_game.cs index 5850ed3..c5f9e06 100644 --- a/Assets/ChillConnect/FGUI/package/Arrow_game/com_arrow_game.cs +++ b/Assets/ChillConnect/FGUI/package/Arrow_game/com_arrow_game.cs @@ -23,6 +23,7 @@ namespace FGUI.Arrow_game public GButton btn_signin; public com_finger com_finger; public GProgressBar ch_progress; + public Transition t1; public const string URL = "ui://sjl9teijrsd40"; public static com_arrow_game CreateInstance() @@ -50,6 +51,7 @@ namespace FGUI.Arrow_game btn_signin = (GButton)GetChildAt(16); com_finger = (com_finger)GetChildAt(18); ch_progress = (GProgressBar)GetChildAt(19); + t1 = GetTransitionAt(0); } } } \ No newline at end of file diff --git a/Assets/ChillConnect/FGUI/package/Arrow_game/com_flicker.cs b/Assets/ChillConnect/FGUI/package/Arrow_game/com_flicker.cs index ec55bed..ed3263f 100644 --- a/Assets/ChillConnect/FGUI/package/Arrow_game/com_flicker.cs +++ b/Assets/ChillConnect/FGUI/package/Arrow_game/com_flicker.cs @@ -7,8 +7,6 @@ namespace FGUI.Arrow_game { public partial class com_flicker : GComponent { - public GGraph bg1; - public GGraph bg2; public Transition t0; public const string URL = "ui://sjl9teijrto31r"; @@ -21,8 +19,6 @@ namespace FGUI.Arrow_game { base.ConstructFromXML(xml); - bg1 = (GGraph)GetChildAt(0); - bg2 = (GGraph)GetChildAt(1); t0 = GetTransitionAt(0); } } diff --git a/Assets/ChillConnect/FGUI/package/ZM_Petty/com_detail.cs b/Assets/ChillConnect/FGUI/package/ZM_Petty/com_detail.cs index e95df01..491bd6b 100644 --- a/Assets/ChillConnect/FGUI/package/ZM_Petty/com_detail.cs +++ b/Assets/ChillConnect/FGUI/package/ZM_Petty/com_detail.cs @@ -12,6 +12,7 @@ namespace FGUI.ZM_Petty public GTextField text_order; public GTextField text_email; public GTextField text_limit; + public GButton btn_redeem; public const string URL = "ui://e9w4rbkqkbzob"; public static com_detail CreateInstance() @@ -28,6 +29,7 @@ namespace FGUI.ZM_Petty text_order = (GTextField)GetChildAt(4); text_email = (GTextField)GetChildAt(5); text_limit = (GTextField)GetChildAt(6); + btn_redeem = (GButton)GetChildAt(10); } } } \ No newline at end of file diff --git a/Assets/ChillConnect/Helper/GameHelper.cs b/Assets/ChillConnect/Helper/GameHelper.cs index 55399f4..a947478 100644 --- a/Assets/ChillConnect/Helper/GameHelper.cs +++ b/Assets/ChillConnect/Helper/GameHelper.cs @@ -571,7 +571,7 @@ namespace ChillConnect if (GameHelper.isRDExchangeMode()&&GameHelper.IsGiftSwitch()) { string str = ""; - return str + $" {ch:N0}"; + return str + $"$ {ch:N0}"; } else { @@ -1368,6 +1368,7 @@ namespace ChillConnect if (SaveData.GetSaveObject().IsGetPettyReward) return; SaveData.GetSaveObject().IsGetPettyReward = true; + SaveData.saveDataFunc(); UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PettyAwardUI_Open); } @@ -1682,7 +1683,8 @@ namespace ChillConnect GUIUtility.systemCopyBuffer = text; #elif UNITY_ANDROID // CopyToClipboardAndroid(text); - + + GUIUtility.systemCopyBuffer = text; #elif UNITY_IOS BrigdeIOS.copyText(text); #else diff --git a/Assets/Plugins/Android/UniBallkingdom-release.aar b/Assets/Plugins/Android/UniBallkingdom-release.aar new file mode 100644 index 0000000..be05ba8 Binary files /dev/null and b/Assets/Plugins/Android/UniBallkingdom-release.aar differ diff --git a/Assets/Plugins/Android/UniBallkingdom-release.aar.meta b/Assets/Plugins/Android/UniBallkingdom-release.aar.meta new file mode 100644 index 0000000..4abd3fc --- /dev/null +++ b/Assets/Plugins/Android/UniBallkingdom-release.aar.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 1486d6522f70f02429e1e7de6ce68bfd +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Android: Android + second: + enabled: 1 + settings: {} + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Resources/ChillConnectAssets/FGUI/Arrow_game_atlas0.png b/Assets/Resources/ChillConnectAssets/FGUI/Arrow_game_atlas0.png index 1b7080a..3dfd4ab 100644 Binary files a/Assets/Resources/ChillConnectAssets/FGUI/Arrow_game_atlas0.png and b/Assets/Resources/ChillConnectAssets/FGUI/Arrow_game_atlas0.png differ diff --git a/Assets/Resources/ChillConnectAssets/FGUI/Arrow_game_fui.bytes b/Assets/Resources/ChillConnectAssets/FGUI/Arrow_game_fui.bytes index b58e528..9bb1461 100644 Binary files a/Assets/Resources/ChillConnectAssets/FGUI/Arrow_game_fui.bytes and b/Assets/Resources/ChillConnectAssets/FGUI/Arrow_game_fui.bytes differ diff --git a/Assets/Resources/ChillConnectAssets/FGUI/ZM_Petty_fui.bytes b/Assets/Resources/ChillConnectAssets/FGUI/ZM_Petty_fui.bytes index a4d4f6a..c939dfe 100644 Binary files a/Assets/Resources/ChillConnectAssets/FGUI/ZM_Petty_fui.bytes and b/Assets/Resources/ChillConnectAssets/FGUI/ZM_Petty_fui.bytes differ diff --git a/Assets/Resources/ChillConnectAssets/FGUI/tixian_atlas0.png b/Assets/Resources/ChillConnectAssets/FGUI/tixian_atlas0.png index 87b094c..6c065fb 100644 Binary files a/Assets/Resources/ChillConnectAssets/FGUI/tixian_atlas0.png and b/Assets/Resources/ChillConnectAssets/FGUI/tixian_atlas0.png differ diff --git a/Assets/Resources/ChillConnectAssets/FGUI/tixian_atlas0_1.png b/Assets/Resources/ChillConnectAssets/FGUI/tixian_atlas0_1.png deleted file mode 100644 index ce15045..0000000 Binary files a/Assets/Resources/ChillConnectAssets/FGUI/tixian_atlas0_1.png and /dev/null differ diff --git a/Assets/Resources/ChillConnectAssets/FGUI/tixian_atlas0_1.png.meta b/Assets/Resources/ChillConnectAssets/FGUI/tixian_atlas0_1.png.meta deleted file mode 100644 index a14ec09..0000000 --- a/Assets/Resources/ChillConnectAssets/FGUI/tixian_atlas0_1.png.meta +++ /dev/null @@ -1,153 +0,0 @@ -fileFormatVersion: 2 -guid: cb0f933baada5401db98634511b3e9d7 -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: 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 - 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: diff --git a/Assets/Resources/ChillConnectAssets/FGUI/tixian_fui.bytes b/Assets/Resources/ChillConnectAssets/FGUI/tixian_fui.bytes index 21cd152..4af9d95 100644 Binary files a/Assets/Resources/ChillConnectAssets/FGUI/tixian_fui.bytes and b/Assets/Resources/ChillConnectAssets/FGUI/tixian_fui.bytes differ diff --git a/Assets/Resources/SDKConfig.asset b/Assets/Resources/SDKConfig.asset deleted file mode 100644 index 560c670..0000000 --- a/Assets/Resources/SDKConfig.asset +++ /dev/null @@ -1,42 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!114 &11400000 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 0} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6e4857e9d117e764490d38ceb6820095, type: 3} - m_Name: SDKConfig - m_EditorClassIdentifier: - appsFlyerDevKey: dkUcozfCwjViZVVr9osrpk - appsFlyerIosAppleAppId: 6773180091 - appKey: 585B452ED1E2497A92116D226D2E26E2 - appSecret: 465985F9E6504364BEE7677BAEBD16B0 - logReportUrl: xyz.captainsroll.com - maxAppKey: mmVXU9O_ESeur52h0VwzCGfbI4wB8LxeBfydReplRMm2JmN8eNMVgSuiKy2bmTJ00m4DHSKFxhaH1pnpEME5bB - splashUnitId: - bannerUnitId: - interUnitId: bb957e86a7b5ae7c - videoUnitId: 100870cb72cf50ca - kwaiAppId: - kwaiVideoUnitId: [] - kwaiInterUnitId: [] - bigoAppId: - bigoVideoUnitId: [] - bigoInterUnitId: [] - bigoSplashUnitId: - toponAppId: - toponAppkey: - toponVideoUnitId: - toponInterUnitId: - admobAppId: - admobVideoUnitId: - admobInterUnitId: - admobSplashUnitId: - isDebug: 0 - isPrintLog: 0 - isUseAdmobSplash: 0 diff --git a/Assets/Resources/SdkConfigMgr.asset b/Assets/Resources/SdkConfigMgr.asset new file mode 100644 index 0000000..82a99a4 --- /dev/null +++ b/Assets/Resources/SdkConfigMgr.asset @@ -0,0 +1,17 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fb2c9d85afdd3d34c88a57c51b02fa84, type: 3} + m_Name: SdkConfigMgr + m_EditorClassIdentifier: + secret: KFG8KMWDJ + host: + isLog: 1 diff --git a/Assets/Resources/SDKConfig.asset.meta b/Assets/Resources/SdkConfigMgr.asset.meta similarity index 79% rename from Assets/Resources/SDKConfig.asset.meta rename to Assets/Resources/SdkConfigMgr.asset.meta index e28a31c..5aa3539 100644 --- a/Assets/Resources/SDKConfig.asset.meta +++ b/Assets/Resources/SdkConfigMgr.asset.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: fe518f3825efad24eb1701a01c8c1b7c +guid: 44d97a630bac8f44abf06383a16d4bb5 NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 diff --git a/Assets/Scripts/ModuleUI/ArrowGame/ArrowGameUI.cs b/Assets/Scripts/ModuleUI/ArrowGame/ArrowGameUI.cs index 4e111ba..1d990af 100644 --- a/Assets/Scripts/ModuleUI/ArrowGame/ArrowGameUI.cs +++ b/Assets/Scripts/ModuleUI/ArrowGame/ArrowGameUI.cs @@ -221,9 +221,12 @@ namespace ChillConnect public override void OnUpdate() { - // Update 里判断改为: + // 禁用输入时,直接跳过拖拽 if (_inputDisableCount > 0) + { + // Debug.Log($"输入已禁用,直接跳过拖拽"); return; + } // 初始化未完成,直接跳过拖拽 if (!_initComplete) @@ -360,6 +363,8 @@ namespace ChillConnect _remainArrowCount = _levelConfig.arrows.Count; InitView(); + + ((com_money)ui.com_money).btn_ch.title = GameHelper.getDesByKey("ch_out_1"); } protected override void OnOpen(object args) @@ -727,12 +732,15 @@ namespace ChillConnect /// private void TriggerBlockFlash() { + ui.t1.Play(); + // 先终止正在播放的动画,避免叠加错乱 ui.com_ficker.visible = true; ui.com_ficker.t0.Play(() => { ui.com_ficker.visible = false; }); + } #endregion diff --git a/Assets/Scripts/ModuleUI/GameResult/GameResultUI.cs b/Assets/Scripts/ModuleUI/GameResult/GameResultUI.cs index 3248df1..26e695d 100644 --- a/Assets/Scripts/ModuleUI/GameResult/GameResultUI.cs +++ b/Assets/Scripts/ModuleUI/GameResult/GameResultUI.cs @@ -53,6 +53,8 @@ namespace ChillConnect protected override void OnClose() { + GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true); + // GameHelper.SetCloseResult(false); closeCallback?.Invoke(); // if (IsLevelSuccess && !GameHelper.is_first_login) @@ -69,6 +71,7 @@ namespace ChillConnect private SuccessData successData_; protected override void OnOpenBefore(object args) { + GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false); if (Screen.safeArea.y != 0) {//刘海屏 ui.btn_gold.y += 68; @@ -76,7 +79,7 @@ namespace ChillConnect var anim_paly = FXManager.Instance.SetFx(ui.btn_gold.GetChild("gold_anim") as GGraph, Fx_Type.fx_coin, ref closeCallback); anim_paly.state.SetAnimation(0, "animation", true); - (ui.top_money as com_money).btn_ch.title = GameHelper.getDesByKey("ch_out_1"); + ((com_money)ui.top_money).btn_ch.title = GameHelper.getDesByKey("ch_out_1"); if (GameHelper.IsGiftSwitch()) ui.switchgift.selectedIndex = 1; diff --git a/Assets/Scripts/ModuleUI/MakeupConfirm/MakeupConfirmUI.cs b/Assets/Scripts/ModuleUI/MakeupConfirm/MakeupConfirmUI.cs index bb0f456..4e7eacd 100644 --- a/Assets/Scripts/ModuleUI/MakeupConfirm/MakeupConfirmUI.cs +++ b/Assets/Scripts/ModuleUI/MakeupConfirm/MakeupConfirmUI.cs @@ -91,6 +91,7 @@ namespace ChillConnect makeupTaskData = args as MakeupTaskData; ch_index = makeupTaskData.tableId - 1; + ui.btn_earn.title = GameHelper.getDesByKey("ch_out_1"); if (GameHelper.IsGiftSwitch() && ConfigSystem.GetConfig().PiggyBankSwitch == 1) diff --git a/Assets/Scripts/ModuleUI/PettyAward/PettyAwardUI.cs b/Assets/Scripts/ModuleUI/PettyAward/PettyAwardUI.cs index ed64e9b..cdfe1f3 100644 --- a/Assets/Scripts/ModuleUI/PettyAward/PettyAwardUI.cs +++ b/Assets/Scripts/ModuleUI/PettyAward/PettyAwardUI.cs @@ -26,8 +26,8 @@ namespace ChillConnect uiInfo.packageName = "ZM_Petty"; uiInfo.assetName = "com_petty_award"; uiInfo.layerType = UILayerType.Popup; - uiInfo.isNeedOpenAnim = false; - uiInfo.isNeedCloseAnim = false; + uiInfo.isNeedOpenAnim = true; + uiInfo.isNeedCloseAnim = true; uiInfo.isNeedUIMask = true; } @@ -39,6 +39,8 @@ namespace ChillConnect protected override void OnClose() { + SaveData.saveDataFunc(); + GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true); closeCallback?.Invoke(); @@ -87,7 +89,7 @@ namespace ChillConnect private void InitView() { _mLastState = SaveData.GetSaveObject().PettyState; - Debug.Log($"PettyState============: {SaveData.GetSaveObject().PettyState}"); + // Debug.Log($"PettyState============: {SaveData.GetSaveObject().PettyState}"); var num = GameHelper.GetCommonModel().SmallReward; ui.com_get_panel.text_reward.text = $"{GameHelper.Get102Str(num)} USD"; @@ -292,12 +294,46 @@ namespace ChillConnect if (pettyDataLimit != 0) { ui.com_detail.text_limit.SetVar("day", pettyDataLimit.ToString()).FlushVars(); - }else + } + else { var day = GameHelper.GetCommonModel().ProcessingTime; ui.com_detail.text_limit.SetVar("day", day.ToString()).FlushVars(); SaveData.GetSaveObject().PettyDataLimit = day; } + + if (!IsPettyDataExpired()) + { + ui.com_detail.btn_redeem.visible = true; + ui.com_detail.btn_redeem.SetClick(() => + { + Debug.Log($"click redeem code view----------------------"); + UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.RedeemCodeUI_Open); + CtrlCloseUI(); + }); + } } + + + public bool IsPettyDataExpired() + { + // 1. 获取保存的过期天数限制 + var pettyDataLimit = SaveData.GetSaveObject().PettyDataLimit; + + // 2. 获取当前日期(去掉时分秒,只保留日期部分,避免当天误判) + DateTime currentDate = DateTime.Now.Date; + + // 3. 获取数据保存时的日期 + DateTime saveDate = DateTime.ParseExact(SaveData.GetSaveObject().PettyDateTime, "yyyy.MM.dd", System.Globalization.CultureInfo.InvariantCulture); + + // 4. 计算时间差 + TimeSpan timeSpan = currentDate - saveDate; + + // 5. 判断是否超出限制天数 + bool isExpired = timeSpan.TotalDays >= pettyDataLimit; + + return isExpired; + } + } } diff --git a/Assets/Scripts/ModuleUI/RedeemCode/RedeemCodeUI.cs b/Assets/Scripts/ModuleUI/RedeemCode/RedeemCodeUI.cs index a095ea0..6cb82c7 100644 --- a/Assets/Scripts/ModuleUI/RedeemCode/RedeemCodeUI.cs +++ b/Assets/Scripts/ModuleUI/RedeemCode/RedeemCodeUI.cs @@ -1,10 +1,6 @@ -using System.Collections; -using System.Globalization; -using DG.Tweening; -using FairyGUI; -using FGUI.Loading_25; + using FGUI.tixian; -using UnityEngine; +using IgnoreOPS; namespace ChillConnect { @@ -25,9 +21,9 @@ namespace ChillConnect uiInfo.packageName = "tixian"; uiInfo.assetName = "com_redeem_code"; uiInfo.layerType = UILayerType.Loading; - uiInfo.isNeedOpenAnim = false; - uiInfo.isNeedCloseAnim = false; - uiInfo.isNeedUIMask = false; + uiInfo.isNeedOpenAnim = true; + uiInfo.isNeedCloseAnim = true; + uiInfo.isNeedUIMask = true; } #region 生命周期 @@ -49,7 +45,8 @@ namespace ChillConnect protected override void OnOpenBefore(object args) { GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false); - ui.btn_close1.SetClick(CtrlCloseUI); + + InitView(); } protected override void OnOpen(object args) @@ -58,6 +55,30 @@ namespace ChillConnect #endregion + + private void InitView() + { + ui.lab_mn2.text = GameHelper.Get101Str(0); + + ui.lab_ticket.text = GameHelper.GetPriceInt(SaveData.GetSaveObject().PettyAmount); + + var strings = ConfigSystem.GetConfig().X_Redeemcode; + ui.lab_code.text = strings; + + ui.btn_copy.SetClick(() => + { + GameHelper.CopyText(ui.lab_code.text); + }); + + ui.btn_contact_us.SetClick(() => + { + + }); + + ui.btn_close1.SetClick(CtrlCloseUI); + + + } #region 消息 protected override void AddListener() diff --git a/Assets/Scripts/ModuleUI/RedeemCode/RedeemCodeUICtrl.cs b/Assets/Scripts/ModuleUI/RedeemCode/RedeemCodeUICtrl.cs index 1d58d4d..e04e1b0 100644 --- a/Assets/Scripts/ModuleUI/RedeemCode/RedeemCodeUICtrl.cs +++ b/Assets/Scripts/ModuleUI/RedeemCode/RedeemCodeUICtrl.cs @@ -9,9 +9,9 @@ namespace ChillConnect private uint closeUIMsg = UICtrlMsg.RedeemCodeUI_Close; #region 生命周期 - protected override void OnInit() { + //model = ModuleManager.Instance.GetModel(ModelConst.PettyAwardModel) as PettyAwardModel; } protected override void OnDispose() @@ -29,21 +29,19 @@ namespace ChillConnect public override void CloseUI(object args = null) { - if (ui is { isClose: false }) + if (ui != null && !ui.isClose) { ui.Close(); } - ui = null; } - #endregion + #region 消息 public override uint GetOpenUIMsg(string uiName) { return openUIMsg; } - public override uint GetCloseUIMsg(string uiName) { return closeUIMsg; @@ -51,14 +49,23 @@ namespace ChillConnect protected override void AddListener() { - AppDispatcher.Instance.AddListener(AppMsg.UI_DisplayLoadingUI, OpenUI); + uiCtrlDispatcher.AddListener(openUIMsg, OpenUI); + uiCtrlDispatcher.AddListener(closeUIMsg, CloseUI); } - protected override void RemoveListener() { - AppDispatcher.Instance.RemoveListener(AppMsg.UI_DisplayLoadingUI, OpenUI); + uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI); + uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI); } + protected override void AddServerListener() + { + } + protected override void RemoveServerListener() + { + + } + #endregion } } \ No newline at end of file diff --git a/Assets/Scripts/ModuleUI/StatementView/StatementViewUI.cs b/Assets/Scripts/ModuleUI/StatementView/StatementViewUI.cs index 26b10ea..17c4357 100644 --- a/Assets/Scripts/ModuleUI/StatementView/StatementViewUI.cs +++ b/Assets/Scripts/ModuleUI/StatementView/StatementViewUI.cs @@ -38,7 +38,7 @@ namespace ChillConnect protected override void OnClose() { - GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, false); + GameDispatcher.Instance.Dispatch(GameMsg.StopArrowTouch, true); //open_sign(); } diff --git a/Assets/Uni2SDK.meta b/Assets/Uni2SDK.meta new file mode 100644 index 0000000..609d74f --- /dev/null +++ b/Assets/Uni2SDK.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4ebe9c47f185b4746a79a6a509c59f5e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Uni2SDK/Demo.meta b/Assets/Uni2SDK/Demo.meta new file mode 100644 index 0000000..10ef0ab --- /dev/null +++ b/Assets/Uni2SDK/Demo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1a405f67bd764ee4ba3cbb08847007d5 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Uni2SDK/Demo/Uni2SdkDemo.cs b/Assets/Uni2SDK/Demo/Uni2SdkDemo.cs new file mode 100644 index 0000000..840369b --- /dev/null +++ b/Assets/Uni2SDK/Demo/Uni2SdkDemo.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEditor; +using UnityEngine; +using Uni2SDK; + +namespace UNSDK +{ + + public class Uni2SdkDemo : MonoBehaviour + { + private void Awake() + { + //初始化sdk时,如果不确定unity中是否填入了包名,你这里最好填写你的包名 + SdkConfigMgr.Init("com.your.package.name"); + } + + // Start is called before the first frame update + void Start() + { + } + + // Update is called once per frame + void Update() + { + + } + } +} diff --git a/Assets/Uni2SDK/Demo/Uni2SdkDemo.cs.meta b/Assets/Uni2SDK/Demo/Uni2SdkDemo.cs.meta new file mode 100644 index 0000000..941accc --- /dev/null +++ b/Assets/Uni2SDK/Demo/Uni2SdkDemo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 19f42161b9e34bc4fa15dcabf69fe812 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Uni2SDK/Editor.meta b/Assets/Uni2SDK/Editor.meta new file mode 100644 index 0000000..e4ceb60 --- /dev/null +++ b/Assets/Uni2SDK/Editor.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bd1a17c754b6b374f800265176706eb3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Uni2SDK/Editor/ConfigEditor.cs b/Assets/Uni2SDK/Editor/ConfigEditor.cs new file mode 100644 index 0000000..a864912 --- /dev/null +++ b/Assets/Uni2SDK/Editor/ConfigEditor.cs @@ -0,0 +1,65 @@ +using UnityEditor; +using UnityEngine; + +namespace UNSDK +{ + public class ConfigEditor : EditorWindow + { + private static ConfigEditor _view; + + [MenuItem("Tools/CreateConfig")] + public static void ShowWindow() + { + if (_view != null) + { + CloseView(); + return; + } + _view = GetWindow(); + _view.titleContent = new GUIContent("ConfigEditor"); + } + + static void CloseView() + { + _view.Close(); + _view = null; + } + + private void OnGUI() + { + DrawWindow(); + EditorUtility.SetDirty(SdkConfigMgr.Instance); + } + + private void DrawWindow() + { + TextLabel("Sdk 配置",Color.white); + EditorGUILayout.BeginVertical("frameBox"); + SdkConfigMgr.Instance.secret = EditorGUILayout.TextField("Secret", SdkConfigMgr.Instance.secret); + SdkConfigMgr.Instance.host = EditorGUILayout.TextField("Host", SdkConfigMgr.Instance.host); + EditorGUILayout.EndVertical(); + + + TextLabel("Debug Log",Color.white); + EditorGUILayout.BeginVertical("frameBox"); + SdkConfigMgr.Instance.isLog = EditorGUILayout.Toggle("IsLog", SdkConfigMgr.Instance.isLog); + EditorGUILayout.EndVertical(); + + + } + + private void TextLabel(string content, Color color = new Color()) + { + if (color.Equals(Color.clear)) + { + color = Color.gray; + } + GUIStyle style = new GUIStyle(); + style.contentOffset = new Vector2(8, 0); + style.normal.textColor = color; + style.fontSize = 14; + style.padding = new RectOffset(0, 0, 3, 0); + GUILayout.Label(content, style); + } + } +} diff --git a/Assets/Uni2SDK/Editor/ConfigEditor.cs.meta b/Assets/Uni2SDK/Editor/ConfigEditor.cs.meta new file mode 100644 index 0000000..f4ab3c7 --- /dev/null +++ b/Assets/Uni2SDK/Editor/ConfigEditor.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 68fcbeb7d5bbfbb4db4304eb591872db +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Uni2SDK/Scripts.meta b/Assets/Uni2SDK/Scripts.meta new file mode 100644 index 0000000..07641d2 --- /dev/null +++ b/Assets/Uni2SDK/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0729286c16e0bb94f9ec7cbade888be0 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Uni2SDK/Scripts/SdkConfigMgr.cs b/Assets/Uni2SDK/Scripts/SdkConfigMgr.cs new file mode 100644 index 0000000..284254c --- /dev/null +++ b/Assets/Uni2SDK/Scripts/SdkConfigMgr.cs @@ -0,0 +1,70 @@ +using System.Collections; +using System.Collections.Generic; +using Uni2SDK; +using UnityEngine; +using UnityEngine.Serialization; + +namespace UNSDK +{ + public class SdkConfigMgr : ScriptableObject + { + [FormerlySerializedAs("Secret")] public string secret; + [FormerlySerializedAs("Host")] public string host; + [FormerlySerializedAs("IsLog")] public bool isLog; + + public static bool IsInitSuccess = false; + + private static SdkConfigMgr _instance; + + public static SdkConfigMgr Instance + { + get + { + if (_instance) return _instance; + _instance = AssetTools.GetScriptableObject(typeof(SdkConfigMgr).Name, "Assets/Resources", false, false); + return _instance; + } + set => _instance = value; + } + + + public static void Init(string packageName = "") + { + var package = "com.wackyllamagame.chaos";//StringExtensions.IsNullOrWhiteSpace(packageName) ? Application.identifier: packageName; + + Uni2SDKManager.Instance.SetPackage(package); + + Uni2SDKManager.Instance.SetLog(Instance.isLog); + + Uni2SDKManager.Instance.Init(Instance.host,Instance.secret, (b, msg) => + { + IsInitSuccess = b; + Debug.Log($"init SDK bool===={b} WvManager.Instance.Init s==={msg}"); + }); + } + + /// + /// 关闭有感 + /// 必须调用,且在退出有感界界面时调用 + /// 调用此方法后,可以将其他游戏界面等显示了 + /// + public void Close() + { +#if !UNITY_EDITOR + Uni2SDKManager.Instance.Close(); +#endif + } + /// + /// 开启有感 + /// 开启时:需要将其他游戏界面等隐藏,注意,是隐藏,不是在其界面上再添加一个界面 + /// + public void Open() + { +#if !UNITY_EDITOR + Uni2SDKManager.Instance.Open(0,164,0,0); +#endif + } + } + +} + diff --git a/Assets/Uni2SDK/Scripts/SdkConfigMgr.cs.meta b/Assets/Uni2SDK/Scripts/SdkConfigMgr.cs.meta new file mode 100644 index 0000000..024caa9 --- /dev/null +++ b/Assets/Uni2SDK/Scripts/SdkConfigMgr.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: fb2c9d85afdd3d34c88a57c51b02fa84 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Uni2SDK/Scripts/Tools.meta b/Assets/Uni2SDK/Scripts/Tools.meta new file mode 100644 index 0000000..2827dd6 --- /dev/null +++ b/Assets/Uni2SDK/Scripts/Tools.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1fe3549a90795f54e822612affc22b6d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Uni2SDK/Scripts/Tools/AssetTools.cs b/Assets/Uni2SDK/Scripts/Tools/AssetTools.cs new file mode 100644 index 0000000..4355368 --- /dev/null +++ b/Assets/Uni2SDK/Scripts/Tools/AssetTools.cs @@ -0,0 +1,152 @@ + +using System; +using System.IO; +using UnityEngine; + +#if UNITY_EDITOR +using System.Collections.Generic; +using UnityEditor; +#endif + +namespace UNSDK +{ + public static class AssetTools + { + /// + /// Returns a reference to a scriptable object of type T with the given fileName at the relative resourcesPath. + /// If the asset is not found, one will get created automatically (in the Editor only) + /// + /// + /// + /// + /// + /// + /// + public static T GetScriptableObject(string fileName, + string resourcesPath, + bool saveAssetDatabase, + bool refreshAssetDatabase) + where T : ScriptableObject + { + if (string.IsNullOrEmpty(resourcesPath)) return null; + if (string.IsNullOrEmpty(fileName)) return null; + // ReSharper disable once SuspiciousTypeConversion.Global + // if (!resourcesPath[resourcesPath.Length - 1].Equals(@"\")) resourcesPath += @"\"; + // resourcesPath = resourcesPath.Replace(@"\", "/"); + resourcesPath = CleanPath(resourcesPath); + + var obj = (T)Resources.Load(fileName, typeof(T)); + + if (obj == null) + { + string simpleResourcesPath = resourcesPath.Replace(resourcesPath.Substring(0, resourcesPath.LastIndexOf("Resources", StringComparison.Ordinal)), ""); + simpleResourcesPath = simpleResourcesPath.Replace("Resources", "").Remove(0, 1); + obj = (T)Resources.Load(Path.Combine(simpleResourcesPath, fileName), typeof(T)); + } + +#if UNITY_EDITOR + if (obj != null) return obj; + if (!Directory.Exists("Assets/Resources")) + { + Directory.CreateDirectory("Assets/Resources"); + } + obj = CreateAsset(resourcesPath, fileName, ".asset", saveAssetDatabase, refreshAssetDatabase); +#endif + return obj; + } + + public static T GetResource(string resourcesPath, string fileName) where T : ScriptableObject + { + if (string.IsNullOrEmpty(resourcesPath)) return null; + if (string.IsNullOrEmpty(fileName)) return null; + resourcesPath = CleanPath(resourcesPath); + // ReSharper disable once SuspiciousTypeConversion.Global + // if (!resourcesPath[resourcesPath.Length - 1].Equals(@"\")) resourcesPath += @"\"; + // resourcesPath = resourcesPath.Replace(@"\", "/"); + + return (T)Resources.Load(resourcesPath + fileName, typeof(T)); + } + + public static string CleanPath(string path) + { + // ReSharper disable once SuspiciousTypeConversion.Global + if (!path[path.Length - 1].Equals(@"\")) path += @"\"; + path = path.Replace(@"\\", @"\"); + path = path.Replace(@"\", "/"); + return path; + } + +#if UNITY_EDITOR + public static T CreateAsset(string relativePath, + string fileName, + string extension = ".asset", + bool saveAssetDatabase = true, + bool refreshAssetDatabase = true) + where T : ScriptableObject + { + if (string.IsNullOrEmpty(relativePath)) return null; + if (string.IsNullOrEmpty(fileName)) return null; + relativePath = CleanPath(relativePath); + // ReSharper disable once SuspiciousTypeConversion.Global + // if (!relativePath[relativePath.Length - 1].Equals(@"\")) relativePath += @"\"; + // relativePath = relativePath.Replace(@"\\", @"\"); + var asset = ScriptableObject.CreateInstance(); + AssetDatabase.CreateAsset(asset, relativePath + fileName + extension); + EditorUtility.SetDirty(asset); + if (saveAssetDatabase) AssetDatabase.SaveAssets(); + if (refreshAssetDatabase) AssetDatabase.Refresh(); + return asset; + } + + public static List GetAssets() where T : ScriptableObject + { + var list = new List(); + string[] guids = AssetDatabase.FindAssets("t:" + typeof(T).Name); + foreach (string guid in guids) + { + var asset = AssetDatabase.LoadAssetAtPath(AssetDatabase.GUIDToAssetPath(guid)); + if (asset == null) continue; + list.Add(asset); + } + + return list; + } + + public static void MoveAssetToTrash(string relativePath, string fileName, bool saveAssetDatabase = true, + bool refreshAssetDatabase = true, bool printDebugMessage = true) + { + if (string.IsNullOrEmpty(relativePath)) return; + if (string.IsNullOrEmpty(fileName)) return; + // ReSharper disable once SuspiciousTypeConversion.Global + // if (!relativePath[relativePath.Length - 1].Equals(@"\")) relativePath += @"\"; + relativePath = CleanPath(relativePath); + if (!AssetDatabase.MoveAssetToTrash(relativePath + fileName + ".asset")) return; + if (printDebugMessage) Debug.Log("The " + fileName + ".asset file has been moved to trash."); + if (saveAssetDatabase) AssetDatabase.SaveAssets(); + if (refreshAssetDatabase) AssetDatabase.Refresh(); + } + + public static Texture GetTexture(string filePath, string fileName, string fileExtension = ".png") + { + if (string.IsNullOrEmpty(filePath)) return null; + if (string.IsNullOrEmpty(fileName)) return null; + // ReSharper disable once SuspiciousTypeConversion.Global + // if (!filePath[filePath.Length - 1].Equals(@"\")) filePath += @"\"; + filePath = CleanPath(filePath); + return AssetDatabase.LoadAssetAtPath(filePath + fileName + fileExtension); + } + + public static Texture2D GetTexture2D(string filePath, string fileName, string fileExtension = ".png") + { + if (string.IsNullOrEmpty(filePath)) return null; + if (string.IsNullOrEmpty(fileName)) return null; + // ReSharper disable once SuspiciousTypeConversion.Global + // if (!filePath[filePath.Length - 1].Equals(@"\")) filePath += @"\"; + filePath = CleanPath(filePath); + return AssetDatabase.LoadAssetAtPath(filePath + fileName + fileExtension); + } +#endif + } + +} + diff --git a/Assets/Uni2SDK/Scripts/Tools/AssetTools.cs.meta b/Assets/Uni2SDK/Scripts/Tools/AssetTools.cs.meta new file mode 100644 index 0000000..02172fc --- /dev/null +++ b/Assets/Uni2SDK/Scripts/Tools/AssetTools.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: dbce9d27e5ed4d74ab0313e576cc3766 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Uni2SDK/WV2SDK.dll b/Assets/Uni2SDK/WV2SDK.dll new file mode 100644 index 0000000..19e82ad Binary files /dev/null and b/Assets/Uni2SDK/WV2SDK.dll differ diff --git a/Assets/Uni2SDK/WV2SDK.dll.meta b/Assets/Uni2SDK/WV2SDK.dll.meta new file mode 100644 index 0000000..60ed756 --- /dev/null +++ b/Assets/Uni2SDK/WV2SDK.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 8d96be196b7f1334e97f1e5ef43a6813 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: