lzx 3 months ago
parent
commit
a015bd9413

+ 7 - 7
Assets/Plugins/Android/AndroidManifest.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.unity3d.player" xmlns:tools="http://schemas.android.com/tools">
   <application android:name="com.youloft.core.YApplication" android:fullBackupContent="@xml/backup_rules" tools:replace="android:fullBackupContent">
-    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@style/UnityThemeSelector">
+    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:theme="@style/TuanjieThemeSelector">
       <intent-filter>
         <action android:name="android.intent.action.MAIN" />
         <category android:name="android.intent.category.LAUNCHER" />
@@ -13,17 +13,17 @@
         <action android:name="android.intent.action.VIEW" />
         <category android:name="android.intent.category.DEFAULT" />
         <category android:name="android.intent.category.BROWSABLE" />
-        <data android:scheme="fbyou id" />
+        <data android:scheme="fb123" />
       </intent-filter>
     </activity>
-    <provider android:authorities="com.facebook.app.FacebookContentProvideryou id" android:name="com.facebook.FacebookContentProvider" android:exported="true" />
+    <provider android:authorities="com.facebook.app.FacebookContentProvider123" android:name="com.facebook.FacebookContentProvider" android:exported="true" />
     <provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.provider" android:exported="false" android:grantUriPermissions="true">
       <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths" />
     </provider>
-    <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\u003谷歌游戏id" />
-    <meta-data android:name="com.facebook.sdk.ClientToken" android:value="you facebook token" />
-    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fbyou id" />
+    <meta-data android:name="com.facebook.sdk.ClientToken" android:value="123" />
+    <meta-data android:name="com.google.android.gms.games.APP_ID" android:value="\u003123" />
+    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="fb123" />
     <meta-data android:name="applovin.sdk.key" android:value="3A74IfT6NFU_AdrIDfHfgDUXOTq1_vyFDwcakL_Me-NtsxCz_rFucqXb2R_D4hH2S6OKcI36tREbu23MfoOrlH" />
-    <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="you id" />
+    <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="123" />
   </application>
 </manifest>

+ 1 - 1
Assets/Plugins/Android/AndroidManifest.xml.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: a8a1397b3fd5b4ab885ac7bc2f75b6e5
+guid: XnJOtCmkVClO+w+L1tELhFTa1FWQcQtOGDVNJqObVke62iPmV/9dXnc=
 TextScriptImporter:
   externalObjects: {}
   userData: 

+ 0 - 16
Assets/Plugins/Android/LauncherManifest.xml

@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest
-    xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.unity3d.player"
-    xmlns:tools="http://schemas.android.com/tools"
-    android:installLocation="preferExternal">
-    <supports-screens
-        android:smallScreens="true"
-        android:normalScreens="true"
-        android:largeScreens="true"
-        android:xlargeScreens="true"
-        android:anyDensity="true"/>
-
-    <application android:label="@string/app_name"
-                 android:icon="@mipmap/app_icon"/>
-</manifest>

+ 0 - 7
Assets/Plugins/Android/LauncherManifest.xml.meta

@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: ded72b1f39e6c4b0da38d9b513d5b59f
-TextScriptImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 5 - 27
Assets/Plugins/Android/baseProjectTemplate.gradle

@@ -1,37 +1,15 @@
 plugins {
-    // If you are changing the Android Gradle Plugin version, make sure it is compatible with the Gradle version preinstalled with Unity
-    // See which Gradle version is preinstalled with Unity here https://docs.unity3d.com/Manual/android-gradle-overview.html
+    // If you are changing the Android Gradle Plugin version, make sure it is compatible with the Gradle version preinstalled with Tuanjie
+    // See which Gradle version is preinstalled with Tuanjie here https://docs.unity.cn/cn/2022.3/Manual/android-gradle-overview.html
     // See official Gradle and Android Gradle Plugin compatibility table here https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
-    // To specify a custom Gradle version in Unity, go do "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)" and specify a path to a custom Gradle version
-    id 'com.android.application' version '7.1.2' apply false
-    id 'com.android.library' version '7.1.2' apply false
+    // To specify a custom Gradle version in Tuanjie, go do "Preferences > External Tools", uncheck "Gradle Installed with Tuanjie (recommended)" and specify a path to a custom Gradle version
+    id 'com.android.application' version '7.4.2' apply false
+    id 'com.android.library' version '7.4.2' apply false
     id 'com.google.gms.google-services' version  '4.3.15'
     id 'com.google.firebase.crashlytics' version  '2.9.5'
     **BUILD_SCRIPT_DEPS**
 }
 
-
-
-repositories {
-    google()
-    jcenter()
-    maven {
-        url 'https://artifact.bytedance.com/repository/pangle'
-    }
-    maven {
-        url "https://maven.google.com"
-    }
-    maven {
-        url "https://sdk.tapjoy.com/"
-    }
-    maven {
-        url 'https://android-sdk.is.com/'
-    }
-    mavenLocal()
-    mavenCentral()
-}
-
-
 task clean(type: Delete) {
     delete rootProject.buildDir
 }

+ 1 - 1
Assets/Plugins/Android/baseProjectTemplate.gradle.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 19e481781a4164f358ed2b57989e4895
+guid: DnNKsSKsVHO196o76Da0zFmsQj3JY7W2/1F0GXfuO+10gIEIUEqEC9w=
 DefaultImporter:
   externalObjects: {}
   userData: 

+ 0 - 1
Assets/Plugins/Android/build.gradle

@@ -1 +0,0 @@
-// Top-level build file where you can add configuration options common to all sub-projects/modules.

+ 0 - 7
Assets/Plugins/Android/build.gradle.meta

@@ -1,7 +0,0 @@
-fileFormatVersion: 2
-guid: 55adfeaf263344072aeedffb3c9319bf
-DefaultImporter:
-  externalObjects: {}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 3 - 3
Assets/Plugins/Android/gradleTemplate.properties

@@ -1,6 +1,6 @@
 org.gradle.jvmargs=-Xmx**JVM_HEAP_SIZE**M
 org.gradle.parallel=true
-unityStreamingAssets=**STREAMING_ASSETS**
-android.useAndroidX=true
+tuanjieStreamingAssets=**STREAMING_ASSETS**
+**ADDITIONAL_PROPERTIES**
 android.enableJetifier=true
-**ADDITIONAL_PROPERTIES**
+android.useAndroidX=true

+ 1 - 1
Assets/Plugins/Android/gradleTemplate.properties.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 47b0b9973c4834a64a14a3e6bc0798d8
+guid: C31NtXikWnxDB3980C2dfigCooxU+l8LS6/pm78A1WsLtWxa/UG9VF8=
 DefaultImporter:
   externalObjects: {}
   userData: 

+ 23 - 13
Assets/Plugins/Android/launcherTemplate.gradle

@@ -2,11 +2,17 @@ apply plugin: 'com.android.application'
 apply plugin: 'com.google.gms.google-services'
 apply plugin: 'com.google.firebase.crashlytics'
 
+afterEvaluate {
+    generateReleaseBuildConfig.enabled = false
+    generateDebugBuildConfig.enabled =false
+}
+
 dependencies {
-    implementation project(':unityLibrary')
-    }
+    implementation project(':tuanjieLibrary')
+}
 
 android {
+    namespace "**NAMESPACE**"
     ndkPath "**NDKPATH**"
 
     compileSdkVersion **APIVERSION**
@@ -18,7 +24,6 @@ android {
     }
 
     defaultConfig {
-        multiDexEnabled true //添加此配置,是为了当代码行数超过64k的时候设置的
         minSdkVersion **MINSDKVERSION**
         targetSdkVersion **TARGETSDKVERSION**
         applicationId '**APPLICATIONID**'
@@ -27,10 +32,11 @@ android {
         }
         versionCode **VERSIONCODE**
         versionName '**VERSIONNAME**'
+        multiDexEnabled true
     }
 
     aaptOptions {
-        noCompress = **BUILTIN_NOCOMPRESS** + unityStreamingAssets.tokenize(', ')
+        noCompress = **BUILTIN_NOCOMPRESS** + tuanjieStreamingAssets.tokenize(', ')
         ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
     }**SIGN**
 
@@ -61,13 +67,17 @@ android {
             enableSplit = true
         }
     }
-        task copyJsonFile {
-    def unityProjectPath = $/file:///**DIR_UNITYPROJECT**/$.replace("\\", "/")
-    copy {
-        from(unityProjectPath + '/Assets/PottingMobileSDK/')
-        into('./')
-        include("google-services.json")
-    }
-}
-preBuild.dependsOn copyJsonFile
+    
+ task copyJsonFile {
+
+     copy {
+         delete("C:/TuanJiePorject/XY001/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/google-services.json")
+         from('C:/TuanJiePorject/XY001/Assets/PottingMobileSDK/')
+         into("C:/TuanJiePorject/XY001/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/")
+         include("google-services.json")
+         println "Copy google-services.json completed.--->> IL2CPP"
+     }
+ }
+ preBuild.dependsOn copyJsonFile  
+ 
 }**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP**

+ 1 - 1
Assets/Plugins/Android/launcherTemplate.gradle.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 7de599810887f4c9992a2f7b55d89970
+guid: CC5KsCOkW3oZpECVG7KGnMKpkkTnO6mSp346R7agxCcQMogSqrvvEWc=
 DefaultImporter:
   externalObjects: {}
   userData: 

+ 88 - 6
Assets/Plugins/Android/mainTemplate.gradle

@@ -3,16 +3,97 @@ apply plugin: 'com.android.library'
 
 dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
+    //内购
+        //implementation 'com.android.billingclient:billing:7.0.0'
 
-    // 添加你的其他依赖项
+
+        def lifecycle_version = "2.0.0"
+        api "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
+        api "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
+        annotationProcessor "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"
+        //google
+        implementation 'com.google.android.gms:play-services-base:17.6.0'
+        implementation 'com.google.android.gms:play-services-auth:20.2.0'
+        implementation "com.google.android.gms:play-services-games-v2:+"
+
+        configurations.all {
+            resolutionStrategy {
+                force 'com.google.android.gms:play-services-tasks:18.0.2'
+            }
+        }
+
+
+
+        implementation "androidx.core:core:1.1.0"
+        implementation "androidx.localbroadcastmanager:localbroadcastmanager:1.0.0"
+
+        //应用内评论
+        implementation 'com.google.android.play:review:2.0.1'
+
+        //gosn
+        implementation 'com.google.code.gson:gson:2.8.6'
+
+        implementation 'com.facebook.android:facebook-core:16.1.3'
+        implementation 'com.facebook.android:facebook-login:16.1.3'
+        implementation 'com.facebook.android:facebook-share:16.1.3'
+        implementation 'com.facebook.android:facebook-gamingservices:16.1.3'
+
+
+
+        implementation 'androidx.legacy:legacy-support-v4:1.0.0'
+        implementation 'androidx.annotation:annotation:1.1.0'
+
+
+        implementation 'androidx.appcompat:appcompat:1.1.0'
+
+
+        //FireBase
+        implementation platform('com.google.firebase:firebase-bom:32.1.1')
+        implementation 'com.google.firebase:firebase-analytics'
+        implementation 'com.google.firebase:firebase-config'
+        implementation 'com.google.firebase:firebase-crashlytics'
+
+
+
+         //appsflyer
+       implementation 'com.appsflyer:af-android-sdk:6.12.1'
+       implementation 'com.android.installreferrer:installreferrer:2.2'
+       implementation 'com.appsflyer:adrevenue:6.9.0'
+
+        //okhttp
+        implementation("com.squareup.okhttp3:okhttp:4.9.2")
+
+        implementation("com.squareup.okhttp3:logging-interceptor:4.9.2")
+
+
+        implementation 'com.alibaba:fastjson:1.2.80'
+
+
+
+        //广告
+    implementation 'com.google.android.gms:play-services-ads:22.6.0'
+
+
+    implementation 'com.google.ads.mediation:facebook:6.16.0.0'
+    implementation 'com.google.ads.mediation:applovin:12.1.0.1'
+    implementation 'com.google.ads.mediation:ironsource:7.7.0.1'
+    implementation ('com.google.ads.mediation:tapjoy:13.0.1.0') {
+        exclude group: 'com.google.android.gms', module: 'services-ads-identifier'
+    }
+
+    implementation 'com.unity3d.ads:unity-ads:4.9.2'
+
+    implementation 'com.google.ads.mediation:unity:4.9.2.0'
+    implementation 'com.google.ads.mediation:vungle:6.12.1.1'
+    implementation 'com.google.ads.mediation:pangle:5.7.0.3.0'
+    implementation("com.google.android.ump:user-messaging-platform:2.2.0") 
 **DEPS**}
 
 android {
     namespace "com.unity3d.player"
     ndkPath "**NDKPATH**"
-
     compileSdkVersion **APIVERSION**
-    buildToolsVersion '30.0.3'
+    buildToolsVersion '**BUILDTOOLS**'
 
     compileOptions {
         sourceCompatibility JavaVersion.VERSION_11
@@ -27,7 +108,7 @@ android {
         }
         versionCode **VERSIONCODE**
         versionName '**VERSIONNAME**'
-        consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD**
+        consumerProguardFiles 'proguard-tuanjie.txt'**USER_PROGUARD**
     }
 
     lintOptions {
@@ -35,11 +116,12 @@ android {
     }
 
     aaptOptions {
-//         noCompress = ['.unity3d', '.ress', '.resource', '.obb'] + tuanjieStreamingAssets
-        noCompress '.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**
+        noCompress = **BUILTIN_NOCOMPRESS** + tuanjieStreamingAssets.tokenize(', ')
         ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
     }**PACKAGING_OPTIONS**
 }
+
+
 **IL_CPP_BUILD_SETUP**
 **SOURCE_BUILD_SETUP**
 **EXTERNAL_SOURCES**

+ 15 - 15
Assets/Plugins/Android/settingsTemplate.gradle

@@ -7,7 +7,7 @@ pluginManagement {
     }
 }
 
-include ':launcher', ':unityLibrary'
+include ':launcher', ':tuanjieLibrary'
 **INCLUDES**
 
 dependencyResolutionManagement {
@@ -16,21 +16,21 @@ dependencyResolutionManagement {
         **ARTIFACTORYREPOSITORY**
         google()
         mavenCentral()
-            maven {
-        url 'https://artifact.bytedance.com/repository/pangle'
-    }
-    maven {
-        url "https://maven.google.com"
-    }
-    maven {
-        url "https://sdk.tapjoy.com/"
-    }
-    maven {
-        url 'https://android-sdk.is.com/'
-    }
-    mavenLocal()
+        maven {
+            url 'https://artifact.bytedance.com/repository/pangle'
+        }
+        maven {
+            url "https://maven.google.com"
+        }
+        maven {
+            url "https://sdk.tapjoy.com/"
+        }
+        maven {
+            url 'https://android-sdk.is.com/'
+        }
+        mavenLocal()
         flatDir {
-            dirs "${project(':unityLibrary').projectDir}/libs"
+            dirs "${project(':tuanjieLibrary').projectDir}/libs"
         }
     }
 }

+ 1 - 1
Assets/Plugins/Android/settingsTemplate.gradle.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: 6f30b30f18cd64ed183b9d25d28bfd2f
+guid: CSwctXiuUy38Q6Nxr79S1yuhGfLfpmZJf79VMMh1sNnRzbqZaQ7JeDg=
 DefaultImporter:
   externalObjects: {}
   userData: 

+ 11 - 11
Assets/PottingMobileSDK/Resources/AdManagerSettings.asset

@@ -1,5 +1,5 @@
 %YAML 1.1
-%TAG !u! tag:unity3d.com,2011:
+%TAG !u! tag:yousandi.cn,2023:
 --- !u!114 &11400000
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -24,22 +24,22 @@ MonoBehaviour:
   AndroidRewardedInterstitialID: []
   RepeatTime: 120
   iOSAdmobId: 
-  AppleID: you id
+  AppleID: 123
   iOSUmengAppid: 
   iOSPangleAppID: 
   iOSFacebookID: iosTest
   iOSFacebookDisplayname: ios
-  iOSFacebookClientToken: you facebook token
-  iOSGameId: you id
-  iOSGameSecret: you secret
-  AndroidAdmobId: you id
+  iOSFacebookClientToken: 123
+  iOSGameId: 123
+  iOSGameSecret: 123
+  AndroidAdmobId: 123
   AndroidUmengAppid: 
   AndroidPangleAppID: 
-  AndroidFacebookID: you id
-  AndroidFacebookClientToken: you facebook token
+  AndroidFacebookID: 123
+  AndroidFacebookClientToken: 123
   AndroidFacebookDisplayname: Android
-  AndroidGameId: you id
-  AndroidGameSecret: you secret
-  GoogleGamesAppID: "\u8C37\u6B4C\u6E38\u620Fid"
+  AndroidGameId: 123
+  AndroidGameSecret: 123
+  GoogleGamesAppID: 123
   umengChannel: GooglePlay
   isChcek: 0

+ 8 - 26
Assets/PottingMobileSDK/google-services.json

@@ -1,44 +1,26 @@
 {
   "project_info": {
-    "project_number": "200315252870",
-    "firebase_url": "https://unity-test-707a2.firebaseio.com",
-    "project_id": "unity-test-707a2",
-    "storage_bucket": "unity-test-707a2.appspot.com"
+    "project_number": "197380154534",
+    "project_id": "xy001-99d9d",
+    "storage_bucket": "xy001-99d9d.firebasestorage.app"
   },
   "client": [
     {
       "client_info": {
-        "mobilesdk_app_id": "1:200315252870:android:0daea028e62391c95fe107",
+        "mobilesdk_app_id": "1:197380154534:android:55bd6ef3e9e12a54998067",
         "android_client_info": {
-          "package_name": "com.potting.test"
+          "package_name": "com.fort23.XY001"
         }
       },
-      "oauth_client": [
-        {
-          "client_id": "200315252870-h002gp2c2plpveuhvmo7sv5h4jmb5mv5.apps.googleusercontent.com",
-          "client_type": 3
-        }
-      ],
+      "oauth_client": [],
       "api_key": [
         {
-          "current_key": "AIzaSyBFqbgK93oxjNQota3pqd5HmTwH6EwU_3Y"
+          "current_key": "AIzaSyDTRozuAhTGotLRnF1U2FPqX3r4KgvkE6s"
         }
       ],
       "services": {
         "appinvite_service": {
-          "other_platform_oauth_client": [
-            {
-              "client_id": "200315252870-h002gp2c2plpveuhvmo7sv5h4jmb5mv5.apps.googleusercontent.com",
-              "client_type": 3
-            },
-            {
-              "client_id": "200315252870-qv79re5kgcbh6j18tk7g7segi1qo7tt4.apps.googleusercontent.com",
-              "client_type": 2,
-              "ios_info": {
-                "bundle_id": "çç"
-              }
-            }
-          ]
+          "other_platform_oauth_client": []
         }
       }
     }

+ 1 - 1
Assets/PottingMobileSDK/google-services.json.meta

@@ -1,5 +1,5 @@
 fileFormatVersion: 2
-guid: e94456ae1f0914542a9da3511e590550
+guid: WnMbsS+rAi4JNSkBnQbAZz6rIbhZgpnrCeFxVKbmW7BFfAZz/LrCExI=
 TextScriptImporter:
   externalObjects: {}
   userData: 

+ 38 - 1
Assets/Scripts/Core/DownloadFile/WXDownload.cs

@@ -1,16 +1,20 @@
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
+using UnityEngine.Networking;
 using Utility;
+#if UNITY_WEBGL || UNITY_EDITOR  
 using WeChatWASM;
+#endif
 
 public class WXDownload : Singleton<WXDownload>
 {
     public void DownLoad(string url, string fileName, System.Action<bool> finish)
     {
+#if UNITY_WEBGL || UNITY_EDITOR        
         DownloadFileOption fileOption = new DownloadFileOption();
         fileOption.url = url;
-        fileOption.filePath = WX.PluginCachePath + "/" + fileName;
+        fileOption.filePath = GetPluginCachePath() + "/" + fileName;
         fileOption.fail = delegate(GeneralCallbackResult result)
         {
             Debug.LogError(url + "下载失败" + result.errMsg);
@@ -22,9 +26,42 @@ public class WXDownload : Singleton<WXDownload>
             // Debug.Log(url + "下载成功");
         };
         WX.DownloadFile(fileOption);
+#elif UNITY_ANDROID
+        UnityWebRequest unityWebRequest = UnityWebRequest.Get(url);
+        unityWebRequest.downloadHandler = new DownloadHandlerBuffer();
+        var unityWebRequestAsyncOperation  =  unityWebRequest.SendWebRequest();
+        unityWebRequestAsyncOperation.completed += operation =>
+        {
+        
+            if (unityWebRequest.result == UnityWebRequest.Result.Success)
+            {
+                finish?.Invoke(true);
+            }
+            else
+            {
+                Debug.LogError(url + "下载失败" + unityWebRequest.result);
+                finish?.Invoke(false);
+            }
+         
+        };
+#endif
     }
     public string GetCachePath(string url)
     { 
+#if UNITY_WEBGL || UNITY_EDITOR       
         return WX.GetCachePath(url);
+#elif UNITY_ANDROID
+        return url;
+#endif
+        
+    }
+
+    public string GetPluginCachePath()
+    {
+#if UNITY_WEBGL || UNITY_EDITOR    
+        return WX.PluginCachePath;
+#elif UNITY_ANDROID
+    return Application.persistentDataPath;
+#endif
     }
 }

+ 54 - 3
Assets/Scripts/GameUI/SDK/YouLoftSDK.cs

@@ -1,14 +1,65 @@
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
+using Utility;
 
-public class YouLoftSDK : MonoBehaviour
+
+public class PottingMobileSDK : Singleton<PottingMobileSDK>
 {
     public void Init()
     {
 #if UNITY_ANDROID|| UNITY_IOS
-          PottingMobile.InitializeSdk();
+        PottingMobile.InitializeSdk();
+        PottingMobile.withLogDebug(true);
+        PottingMobileManger.Instance.MOnRewardedVideoLoadedEvent += MOnRewardedVideoLoadedEvent;
+        PottingMobileManger.Instance.MOnRewardedVideoFailedEvent += MOnRewardedVideoFailedEvent;
+        PottingMobileManger.Instance.MOnRewardedVideoShownEvent += MOnRewardedVideoShownEvent;
+        PottingMobileManger.Instance.MOnRewardedVideoReceivedRewardEvent += MOnRewardedVideoReceivedRewardEvent;
+        PottingMobileManger.Instance.MOnRewardedVideoClosedEvent += MOnRewardedVideoClosedEvent;
+#endif
+    }
+
+
+
+    public void ShowRewardedVideo()
+    {
+#if UNITY_ANDROID|| UNITY_IOS
+        if (PottingMobile._HasRewardedVideo())
+        {
+            PottingMobile._ShowRewardedVideoAd();
+        }
 #endif
-      
+    }
+    
+    
+    private void MOnRewardedVideoClosedEvent(string obj)
+    {
+        //广告关闭
+         Debug.Log($"OnRewardedVideoReceivedRewardEvent({obj})");
+    }
+
+    private void MOnRewardedVideoReceivedRewardEvent(string arg1, string arg2, float arg3)
+    {
+        //广告奖励发放
+        Debug.Log($"OnRewardedVideoReceivedRewardEvent({arg1}, {arg2}, {arg3})");
+    }
+
+
+    private void MOnRewardedVideoShownEvent(string obj)
+    {
+        //广告被显示
+        Debug.Log($"OnRewardedVideoShownEvent({obj})");
+    }
+
+    private void MOnRewardedVideoFailedEvent(string arg1, string errorCode)
+    {
+        //广告加载失败
+        Debug.Log($"OnRewardedVideoFailedEvent({arg1}, {errorCode})");
+    }
+
+    private void MOnRewardedVideoLoadedEvent(string obj)
+    {
+        //广告加载成功
+        Debug.Log($"OnRewardedVideoLoadedEvent({obj})");
     }
 }

+ 2 - 2
Assets/Scripts/GameUI/UI/UpdateAsset/GameUpdateAsset.cs

@@ -1,6 +1,6 @@
 using UnityEngine;
 using Utility;
-using WeChatWASM;
+// using WeChatWASM;
 
 namespace Fort23.Mono.UpdateAsset
 {
@@ -17,7 +17,7 @@ namespace Fort23.Mono.UpdateAsset
         private void LoadMD5()
         {
             string md5 = urlRoot + "MD5.txt";
-            string loadMd5 = WX.PluginCachePath + "Bundle/MD5.txt";
+            string loadMd5 = WXDownload.Instance.GetPluginCachePath() + "Bundle/MD5.txt";
             string str = WXDownload.Instance.GetCachePath(loadMd5);
             if (!string.IsNullOrEmpty(str))
             {