diff --git a/Assets/Scripts/Logic/GameLogic.cs b/Assets/Scripts/Logic/GameLogic.cs index f40c4de3..fc58641c 100644 --- a/Assets/Scripts/Logic/GameLogic.cs +++ b/Assets/Scripts/Logic/GameLogic.cs @@ -73,7 +73,6 @@ public class GameLogic : MonoBehaviour GameManager.Instance.EnemyGroupMgr = mEnemyGroupMgr; GameManager.Instance.CurrentGameCam = mGameCam; - TKGSDKManager.Instance.LogEvent(Const.AdsEvent.LevelEnter, Const.AdsKey.Level, PlayerData.Instance.CurrentLevel.ToString()); int tStageID = ((PlayerData.Instance.CurrentLevel - 1) / 10) % GameConfig.Instance.SceneCount + 1; Instantiate(ResourceManager.Instance.LoadRes(Const.Path.GetStage(tStageID)), mCtnStage); @@ -366,7 +365,7 @@ public class GameLogic : MonoBehaviour Transform tCamTrans = mGameCam.transform; tCamTrans.DOMove(mBattlePos, 1).SetEase(Ease.OutCubic); tCamTrans.DORotate(mBattleRot, 1).SetEase(Ease.OutCubic); - + GameStart(); } diff --git a/Assets/Scripts/Storage/PlayerData.cs b/Assets/Scripts/Storage/PlayerData.cs index 3870367f..e603e2a3 100644 --- a/Assets/Scripts/Storage/PlayerData.cs +++ b/Assets/Scripts/Storage/PlayerData.cs @@ -203,26 +203,20 @@ public class PlayerData : StorageBase if (!GameConfig.Instance.IsDebug) { - TKGSDKManager.Instance.SetUserSourceListener(OnUserSource); + List tFuncs = new List() { Touka.FunctionType.Function_wangz }; + TKGSDKManager.Instance.SetFunctionSwitchListener(tFuncs, OnUserSource); } } - private void OnUserSource(bool pIsNatural, string pSource) + private void OnUserSource(Touka.FunctionType pFuncType, bool pOn) { - mIsMMOUser = !pIsNatural; + mIsMMOUser = pOn; Save(); + Debug.Log("【ToukaGame】回调:func:" + pFuncType + "result:" + pOn); Debug.Log("Usersource is mmo :" + mIsMMOUser); } - //private void OnUserSource(bool pIsNatural, string pSource, string pCampain) - //{ - // mIsMMOUser = !pIsNatural && pCampain.Equals("wangz"); - // Save(); - - // Debug.Log("Usersource is mmo :" + mIsMMOUser); - //} - #region card public bool HasCard(string pCardID) { diff --git a/Assets/TKGSDK/Common/internal/TKGSDKNative.cs b/Assets/TKGSDK/Common/internal/TKGSDKNative.cs index 1bdbe374..f6ad7153 100644 --- a/Assets/TKGSDK/Common/internal/TKGSDKNative.cs +++ b/Assets/TKGSDK/Common/internal/TKGSDKNative.cs @@ -443,13 +443,7 @@ namespace Touka { TKGDebugger.LogDebug("[TKGSDKNative] Review"); #if UNITY_EDITOR -#if AppStore_GB TKGDebugger.LogDebug("[TKGSDKNative] Review cannot be opened in editor, please open it in real machine"); -#else - - TKGDebugger.LogDebug("[TKGSDKNative] 编辑器中无法打开评价页面,请在真机中打开"); - -#endif return; #endif TKGNativeInterface.Instance.Review(); @@ -462,13 +456,7 @@ namespace Touka { TKGDebugger.LogDebug("[TKGSDKNative] OpenPrivacyURL"); #if UNITY_EDITOR -#if AppStore_GB TKGDebugger.LogDebug("[TKGSDKNative] Web page cannot be opened in editor, please open it in real machine"); -#else - - TKGDebugger.LogDebug("[TKGSDKNative] 编辑器中无法打开网页,请在真机中打开"); - -#endif return; #endif TKGNativeInterface.Instance.OpenPrivacyURL(); @@ -481,13 +469,7 @@ namespace Touka { TKGDebugger.LogDebug("[TKGSDKNative] OpenUserTermURL"); #if UNITY_EDITOR -#if AppStore_GB TKGDebugger.LogDebug("[TKGSDKNative] Web page cannot be opened in editor, please open it in real machine"); -#else - - TKGDebugger.LogDebug("[TKGSDKNative] 编辑器中无法打开网页,请在真机中打开"); - -#endif return; #endif TKGNativeInterface.Instance.OpenUserTermURL(); @@ -500,13 +482,7 @@ namespace Touka { TKGDebugger.LogDebug("[TKGSDKNative] OpenPolicyPop"); #if UNITY_EDITOR -#if AppStore_GB TKGDebugger.LogDebug("[TKGSDKNative] Web page cannot be opened in editor, please open it in real machine"); -#else - - TKGDebugger.LogDebug("[TKGSDKNative] 编辑器中无法打开网页,请在真机中打开"); - -#endif return; #endif TKGNativeInterface.Instance.OpenPolicyPop(); @@ -519,13 +495,7 @@ namespace Touka { TKGDebugger.LogDebug("[TKGSDKNative] OpenMoreGame"); #if UNITY_EDITOR -#if AppStore_GB TKGDebugger.LogDebug("[TKGSDKNative] App Store cannot be opened in editor, please open it in real machine"); -#else - - TKGDebugger.LogDebug("[TKGSDKNative] 编辑器中无法打开App Store,请在真机中打开"); - -#endif return; #endif TKGNativeInterface.Instance.OpenMoreGame(); diff --git a/Assets/TKGSDK/Common/internal/iOS/TGiOSAdmanager.cs b/Assets/TKGSDK/Common/internal/iOS/TGiOSAdmanager.cs index cf57c703..93fe0fc7 100644 --- a/Assets/TKGSDK/Common/internal/iOS/TGiOSAdmanager.cs +++ b/Assets/TKGSDK/Common/internal/iOS/TGiOSAdmanager.cs @@ -118,6 +118,12 @@ public class TGiOSAdManager : MonoBehaviour TKG_Share(_shareText); } + // 获取渠道 + public int getChannel() + { + return TKG_GetChannel(); + } + // ads public void RemoveAllAds() @@ -452,6 +458,9 @@ public class TGiOSAdManager : MonoBehaviour [DllImport("__Internal")] private static extern void TKG_Share(string text); + [DllImport("__Internal")] + private static extern int TKG_GetChannel(); + [DllImport("__Internal")] private static extern void TKG_InitSDK(); diff --git a/Assets/TKGSDK/Config/TKGLoadConfig.cs b/Assets/TKGSDK/Config/TKGLoadConfig.cs index 469361a1..f317471e 100644 --- a/Assets/TKGSDK/Config/TKGLoadConfig.cs +++ b/Assets/TKGSDK/Config/TKGLoadConfig.cs @@ -57,13 +57,20 @@ namespace Touka /// private static PlayerPrefPair[] ParseiOSConfigInner() { -#if AppStore_GB - PlayerPrefPair[] configs = TKGLoadPlistConfig.GetToukaConfig(toukaconfigFile,toukaconfigPathGB); + +#if USE_U8 + return null; #else - PlayerPrefPair[] configs = TKGLoadPlistConfig.GetToukaConfig(toukaconfigFile, toukaconfigPathCN); + + #if AppStore_GB + PlayerPrefPair[] configs = TKGLoadPlistConfig.GetToukaConfig(toukaconfigFile, toukaconfigPathGB); + #else + PlayerPrefPair[] configs = TKGLoadPlistConfig.GetToukaConfig(toukaconfigFile, toukaconfigPathCN); + #endif + ParseConfigsInner(configs); + return configs; #endif - ParseConfigsInner(configs); - return configs; + } /// diff --git a/Assets/TKGSDK/Editor/ToukaAdsBuildPostProcessor.cs b/Assets/TKGSDK/Editor/ToukaAdsBuildPostProcessor.cs index c8210aae..e1aa8dea 100644 --- a/Assets/TKGSDK/Editor/ToukaAdsBuildPostProcessor.cs +++ b/Assets/TKGSDK/Editor/ToukaAdsBuildPostProcessor.cs @@ -19,7 +19,10 @@ namespace Touka #if UNITY_IOS ModifyURLTypes(path); ModifyCode(path); +#if !USE_U8 ModifyBundle(path); +#endif + #endif } @@ -35,28 +38,51 @@ namespace Touka plist.root.SetBoolean("GADIsAdManagerApp", true); -#if !AppStore_GB +#if !USE_U8 + + #if !AppStore_GB plist.root.SetString("GADApplicationIdentifier", TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_Admob_AppID, AppChannel.AppStore_CN)); plist.root.SetString("AppId", TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_TOUKA_SDK_APPID, AppChannel.AppStore_CN)); plist.root.SetString("AppKey", TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_TOUKA_SDK_APPKEY, AppChannel.AppStore_CN) ); plist.root.SetString("splashPlacement", TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_TOUKA_SDK_SPLASHID, AppChannel.AppStore_CN)); - -#else + #else plist.root.SetString("GADApplicationIdentifier", TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_Admob_AppID, AppChannel.AppStore_GB)); plist.root.SetString("AppLovinSdkKey", TKGLoadConfig.GetConfigByKey(ConfigKeys.KEY_TOUKA_SDK_APPKEY, AppChannel.AppStore_GB)); - + #endif #endif + plist.root.SetBoolean("ITSAppUsesNonExemptEncryption", false); //NSAppTransportSecurity set yes - PlistElementDict atf = plist.root["NSAppTransportSecurity"].AsDict(); - atf.SetBoolean("NSAllowsArbitraryLoads", true); + string pPath = Path.Combine(_path, "Info.plist"); + if (File.Exists(plistPath)) + { + PlistDocument doc = new PlistDocument(); + doc.ReadFromFile(plistPath); + PlistElementDict rootDict = doc.root.AsDict(); + Debug.Log("yangs" + rootDict["NSAppTransportSecurity"]); + if (rootDict != null) + { + if (rootDict["NSAppTransportSecurity"] != null) + { -#region iOS 14 + PlistElementDict atf = plist.root["NSAppTransportSecurity"].AsDict(); + atf.SetBoolean("NSAllowsArbitraryLoads", true); + } + + doc.WriteToFile(plistPath); + } + } + else + { + + } + + #region iOS 14 //SKAdnetwork追加 PlistElementArray URLWhiteListArr2 = plist.root.CreateArray("SKAdNetworkItems"); @@ -664,8 +690,8 @@ namespace Touka string mainTarget = pbxProject.TargetGuidByName(targetName); #endif pbxProject.AddFileToBuild(mainTarget, pbxProject.AddFile("Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/Core/AnyThinkSDK.bundle", "Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/Core/AnyThinkSDK.bundle", PBXSourceTree.Sdk)); - //pbxProject.AddFileToBuild(mainTarget, pbxProject.AddFile("Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/pangle_China/CSJAdSDK.bundle", "Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/pangle_China/CSJAdSDK.bundle", PBXSourceTree.Sdk)); - pbxProject.AddFileToBuild(mainTarget, pbxProject.AddFile("Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/pangle_China/BUAdSDK.bundle", "Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/pangle_China/BUAdSDK.bundle", PBXSourceTree.Sdk)); + pbxProject.AddFileToBuild(mainTarget, pbxProject.AddFile("Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/pangle_China/CSJAdSDK.bundle", "Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/pangle_China/CSJAdSDK.bundle", PBXSourceTree.Sdk)); + //pbxProject.AddFileToBuild(mainTarget, pbxProject.AddFile("Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/pangle_China/BUAdSDK.bundle", "Frameworks/Plugins/ToukaGames/Plugins/iOS/ToponSDK/pangle_China/BUAdSDK.bundle", PBXSourceTree.Sdk)); pbxProject.WriteToFile(projectPath); #endif diff --git a/Assets/TKGSDK/Editor/ToukaAnalyticsBuildPostProcessor.cs b/Assets/TKGSDK/Editor/ToukaAnalyticsBuildPostProcessor.cs index 91bcf5ea..5b84ede2 100644 --- a/Assets/TKGSDK/Editor/ToukaAnalyticsBuildPostProcessor.cs +++ b/Assets/TKGSDK/Editor/ToukaAnalyticsBuildPostProcessor.cs @@ -16,15 +16,17 @@ public class ToukaAnalyticsBuildPostProcessor if (buildTarget != BuildTarget.iOS) return; #if UNITY_IOS + + #if !USE_U8 + copyConfigFile(path); + CopySplashImg(path); +#endif + SetTeamIdAutoSign(path); ModifyFrameworks(path); ModifyBuildSettings(path); - - ModifyInfoPlist(path); - - //AddLocalization(path); - CopySplashImg(path); + ModifyInfoPlist(path); #endif } @@ -81,9 +83,7 @@ public class ToukaAnalyticsBuildPostProcessor fileGuidSqlite = proj.AddFile("usr/lib/libc++abi.tbd", "Libraries/libc++abi.tbd", PBXSourceTree.Sdk); proj.AddFileToBuild(target, fileGuidSqlite); - // sdk config files - proj.AddFileToBuild(target, proj.AddFile("tkg_config.plist", "tkg_config.plist",PBXSourceTree.Source)); - File.WriteAllText(projPath, proj.WriteToString()); + #if UNITY_2019_3_OR_NEWER string mainTarget = proj.GetUnityMainTargetGuid(); @@ -91,6 +91,12 @@ public class ToukaAnalyticsBuildPostProcessor string targetName = UnityEditor.iOS.Xcode.PBXProject.GetUnityTargetName(); string mainTarget = proj.TargetGuidByName(targetName); #endif + +#if !USE_U8 +// sdk config files + proj.AddFileToBuild(target, proj.AddFile("tkg_config.plist", "tkg_config.plist",PBXSourceTree.Source)); + File.WriteAllText(projPath, proj.WriteToString()); + proj.AddFileToBuild(mainTarget, proj.AddFile("tkg_config.plist", "tkg_config.plist", PBXSourceTree.Source)); proj.WriteToFile(projPath); @@ -108,7 +114,7 @@ public class ToukaAnalyticsBuildPostProcessor proj.WriteToFile(projPath); #endif - +#endif #endif } @@ -150,8 +156,8 @@ public class ToukaAnalyticsBuildPostProcessor proj.SetBuildProperty(target, "ENABLE_BITCODE", "NO"); proj.SetBuildProperty(target, "GCC_C_LANGUAGE_STANDARD", "gnu99"); proj.SetBuildProperty(target, "GCC_ENABLE_OBJC_EXCEPTIONS","YES"); - proj.SetBuildProperty(target, "EXCLUDED_ARCHS", "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8 EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))"); proj.SetBuildProperty(target, "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES", "NO"); + proj.SetBuildProperty(target, "EXCLUDED_ARCHS", "EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_simulator__NATIVE_ARCH_64_BIT_x86_64=arm64 arm64e armv7 armv7s armv6 armv8 EXCLUDED_ARCHS=$(inherited) $(EXCLUDED_ARCHS__EFFECTIVE_PLATFORM_SUFFIX_$(EFFECTIVE_PLATFORM_SUFFIX)__NATIVE_ARCH_64_BIT_$(NATIVE_ARCH_64_BIT))"); File.WriteAllText(projPath, proj.WriteToString()); #endif } @@ -173,7 +179,7 @@ public class ToukaAnalyticsBuildPostProcessor var plistPath = Path.Combine(_path, "Info.plist"); var plist = new PlistDocument(); plist.ReadFromFile(plistPath); -#if !AppStore_GB +#if !AppStore_GB && !USE_U8 plist.root.SetString("NSLocationAlwaysUsageDescription", "为了更好的体验游戏"); plist.root.SetString("NSCameraUsageDescription", "为了更好的体验游戏"); plist.root.SetString("NSLocationWhenInUseUsageDescription", "为了更好的体验游戏"); diff --git a/Assets/TKGSDK/Editor/ToukaEditor.cs b/Assets/TKGSDK/Editor/ToukaEditor.cs index ee700f9e..ffeea7be 100644 --- a/Assets/TKGSDK/Editor/ToukaEditor.cs +++ b/Assets/TKGSDK/Editor/ToukaEditor.cs @@ -26,7 +26,7 @@ namespace Touka [MenuItem("ToukaGames/Settings For IOS CN", priority=1001)] public static void SetIOSCNTOPONSeting() { -#if UNITY_IOS +#if UNITY_IOS && !USE_U8 SetAPPSetting(AppChannel.AppStore_CN); #endif } @@ -42,7 +42,7 @@ namespace Touka [MenuItem("ToukaGames/Settings For IOS GB", priority = 10001)] public static void SetIOSUSSeting() { -#if UNITY_IOS +#if UNITY_IOS && !USE_U8 SetAPPSetting(AppChannel.AppStore_GB); #endif } diff --git a/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterface.cs b/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterface.cs index 4038dde4..1b320707 100644 --- a/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterface.cs +++ b/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterface.cs @@ -11,7 +11,7 @@ namespace Touka { private static TKGNativeInterface _instance; - private string UnitySDKVersion = "2.2.6"; + private string UnitySDKVersion = "2.2.7"; public static TKGNativeInterface Instance { diff --git a/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterfaceAndroid.cs b/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterfaceAndroid.cs index 8d3debd7..226c9671 100644 --- a/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterfaceAndroid.cs +++ b/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterfaceAndroid.cs @@ -225,7 +225,7 @@ namespace Touka float tHeight = Mathf.Abs(tBottomRight.y - tTopLeft.y); // x , y , width , height // ((tTopLeft.x, Screen.height - tTopLeft.y, tWidth, tHeight) - SDKCall("showNative", pAdPos, tTopLeft.x, Screen.height - tTopLeft.y, tWidth, tHeight, pAdPos); + SDKCall("showNative", pAdPos, tTopLeft.x, Screen.height - tTopLeft.y, tWidth, tHeight); #endif } diff --git a/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterfaceIOS.cs b/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterfaceIOS.cs index 86a8767d..317e2ad6 100644 --- a/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterfaceIOS.cs +++ b/Assets/TKGSDK/NativeSDK/Scripts/SDK/TKGNativeInterfaceIOS.cs @@ -26,11 +26,7 @@ namespace Touka /// public override string GetChannel() { -#if !AppStore_GB - return "AppStore_CN"; -#else - return "AppStore_GB"; -#endif + return TGiOSAdManager.Instance.getChannel().ToString(); } /// diff --git a/Assets/TKGSDK/Splash/CN/LaunchScreen-iPhonePortrait.png b/Assets/TKGSDK/Splash/CN/LaunchScreen-iPhonePortrait.png index 29a2ea93..8d483c9e 100644 Binary files a/Assets/TKGSDK/Splash/CN/LaunchScreen-iPhonePortrait.png and b/Assets/TKGSDK/Splash/CN/LaunchScreen-iPhonePortrait.png differ diff --git a/Assets/ThirdPlugins/Easy Save 3/Resources/ES3/ES3Defaults.asset b/Assets/ThirdPlugins/Easy Save 3/Resources/ES3/ES3Defaults.asset index f26c42eb..51752f68 100644 --- a/Assets/ThirdPlugins/Easy Save 3/Resources/ES3/ES3Defaults.asset +++ b/Assets/ThirdPlugins/Easy Save 3/Resources/ES3/ES3Defaults.asset @@ -29,12 +29,12 @@ MonoBehaviour: referenceMode: 2 serializationDepthLimit: 64 assemblyNames: - - StompyRobot.SRDebugger - Assembly-CSharp - StompyRobot.SRF + - StompyRobot.SRDebugger - Purchasing.Common - - StompyRobot.SRDebugger.Editor - StompyRobot.SRF.Editor + - StompyRobot.SRDebugger.Editor showAdvancedSettings: 0 addMgrToSceneAutomatically: 0 autoUpdateReferences: 1