zh 7 ماه پیش
والد
کامیت
8fff1cd1c7
53فایلهای تغییر یافته به همراه3077 افزوده شده و 2 حذف شده
  1. 12 0
      assets/scripts/AnyThinkAds.meta
  2. 263 0
      assets/scripts/AnyThinkAds/ATBannerTSSDK.ts
  3. 9 0
      assets/scripts/AnyThinkAds/ATBannerTSSDK.ts.meta
  4. 180 0
      assets/scripts/AnyThinkAds/ATIntersitialAutoTSSDK.ts
  5. 9 0
      assets/scripts/AnyThinkAds/ATIntersitialAutoTSSDK.ts.meta
  6. 208 0
      assets/scripts/AnyThinkAds/ATIntersitialTSSDK.ts
  7. 9 0
      assets/scripts/AnyThinkAds/ATIntersitialTSSDK.ts.meta
  8. 200 0
      assets/scripts/AnyThinkAds/ATJSSDK.ts
  9. 9 0
      assets/scripts/AnyThinkAds/ATJSSDK.ts.meta
  10. 275 0
      assets/scripts/AnyThinkAds/ATNativeTSSDK.ts
  11. 9 0
      assets/scripts/AnyThinkAds/ATNativeTSSDK.ts.meta
  12. 214 0
      assets/scripts/AnyThinkAds/ATRewardedAutoVideoTSSDK.ts
  13. 9 0
      assets/scripts/AnyThinkAds/ATRewardedAutoVideoTSSDK.ts.meta
  14. 253 0
      assets/scripts/AnyThinkAds/ATRewardedVideoTSSDK.ts
  15. 9 0
      assets/scripts/AnyThinkAds/ATRewardedVideoTSSDK.ts.meta
  16. 12 0
      assets/scripts/AnyThinkAds/Android.meta
  17. 60 0
      assets/scripts/AnyThinkAds/Android/ATAndroidBannerTS.ts
  18. 9 0
      assets/scripts/AnyThinkAds/Android/ATAndroidBannerTS.ts.meta
  19. 50 0
      assets/scripts/AnyThinkAds/Android/ATAndroidIntersitialAutoTS.ts
  20. 9 0
      assets/scripts/AnyThinkAds/Android/ATAndroidIntersitialAutoTS.ts.meta
  21. 39 0
      assets/scripts/AnyThinkAds/Android/ATAndroidIntersitialTS.ts
  22. 9 0
      assets/scripts/AnyThinkAds/Android/ATAndroidIntersitialTS.ts.meta
  23. 57 0
      assets/scripts/AnyThinkAds/Android/ATAndroidJS.ts
  24. 9 0
      assets/scripts/AnyThinkAds/Android/ATAndroidJS.ts.meta
  25. 45 0
      assets/scripts/AnyThinkAds/Android/ATAndroidNativeTS.ts
  26. 9 0
      assets/scripts/AnyThinkAds/Android/ATAndroidNativeTS.ts.meta
  27. 50 0
      assets/scripts/AnyThinkAds/Android/ATAndroidRewardedVideoAutoTS.ts
  28. 9 0
      assets/scripts/AnyThinkAds/Android/ATAndroidRewardedVideoAutoTS.ts.meta
  29. 39 0
      assets/scripts/AnyThinkAds/Android/ATAndroidRewardedVideoTS.ts
  30. 9 0
      assets/scripts/AnyThinkAds/Android/ATAndroidRewardedVideoTS.ts.meta
  31. 12 0
      assets/scripts/AnyThinkAds/iOS.meta
  32. 59 0
      assets/scripts/AnyThinkAds/iOS/ATiOSBannerTS.ts
  33. 9 0
      assets/scripts/AnyThinkAds/iOS/ATiOSBannerTS.ts.meta
  34. 52 0
      assets/scripts/AnyThinkAds/iOS/ATiOSIntersitiaAutolTS.ts
  35. 9 0
      assets/scripts/AnyThinkAds/iOS/ATiOSIntersitiaAutolTS.ts.meta
  36. 45 0
      assets/scripts/AnyThinkAds/iOS/ATiOSIntersitialTS.ts
  37. 9 0
      assets/scripts/AnyThinkAds/iOS/ATiOSIntersitialTS.ts.meta
  38. 61 0
      assets/scripts/AnyThinkAds/iOS/ATiOSJS.ts
  39. 9 0
      assets/scripts/AnyThinkAds/iOS/ATiOSJS.ts.meta
  40. 45 0
      assets/scripts/AnyThinkAds/iOS/ATiOSNativeTS.ts
  41. 9 0
      assets/scripts/AnyThinkAds/iOS/ATiOSNativeTS.ts.meta
  42. 53 0
      assets/scripts/AnyThinkAds/iOS/ATiOSRewardedAutoVideoTS.ts
  43. 9 0
      assets/scripts/AnyThinkAds/iOS/ATiOSRewardedAutoVideoTS.ts.meta
  44. 45 0
      assets/scripts/AnyThinkAds/iOS/ATiOSRewardedVideoTS.ts
  45. 9 0
      assets/scripts/AnyThinkAds/iOS/ATiOSRewardedVideoTS.ts.meta
  46. 4 0
      assets/scripts/game/data/localText.ts
  47. 1 1
      assets/scripts/game/data/localText_en.ts
  48. 1 0
      assets/scripts/game/view/GameContiueLayer.ts
  49. 217 1
      assets/scripts/game/view/LevelLayer.ts
  50. 255 0
      assets/scripts/utils/ATAndroidJS2.ts
  51. 9 0
      assets/scripts/utils/ATAndroidJS2.ts.meta
  52. 63 0
      assets/scripts/utils/GlobalManager.ts
  53. 9 0
      assets/scripts/utils/GlobalManager.ts.meta

+ 12 - 0
assets/scripts/AnyThinkAds.meta

@@ -0,0 +1,12 @@
+{
+  "ver": "1.1.0",
+  "importer": "directory",
+  "imported": true,
+  "uuid": "21eb68e3-2158-4f0b-be37-fa129c537efd",
+  "files": [],
+  "subMetas": {},
+  "userData": {
+    "compressionType": {},
+    "isRemoteBundle": {}
+  }
+}

+ 263 - 0
assets/scripts/AnyThinkAds/ATBannerTSSDK.ts

@@ -0,0 +1,263 @@
+import {ATAndroidBannerTS} from "./Android/ATAndroidBannerTS";
+import {ATiOSBannerJS} from "./iOS/ATiOSBannerTS";
+import {ATJSSDK} from "./ATJSSDK";
+
+var initPlatformBridge = function () {
+    if (cc.sys.os === cc.sys.OS.IOS) {
+        return ATiOSBannerJS;
+    } else if (cc.sys.os === cc.sys.OS.ANDROID) {
+        return ATAndroidBannerTS;
+    }
+};
+
+var platformBridge = initPlatformBridge();
+
+
+
+export const ATBannerSDK = {
+    kATBannerAdLoadingExtraBannerAdSizeStruct: "banner_ad_size_struct",
+	kATBannerAdShowingPositionTop : "top",
+    kATBannerAdShowingPositionBottom : "bottom",
+	
+	kATBannerAdInlineAdaptiveWidth : "inline_adaptive_width",
+	kATBannerAdInlineAdaptiveOrientation : "inline_adaptive_orientation",
+	kATBannerAdInlineAdaptiveOrientationCurrent : 0,
+	kATBannerAdInlineAdaptiveOrientationPortrait : 1,
+	kATBannerAdInlineAdaptiveOrientationLandscape : 2,
+
+	kATBannerAdAdaptiveWidth : "adaptive_width",
+	kATBannerAdAdaptiveOrientation : "adaptive_orientation",
+	kATBannerAdAdaptiveOrientationCurrent : 0,
+	kATBannerAdAdaptiveOrientationPortrait : 1,
+	kATBannerAdAdaptiveOrientationLandscape : 2,
+
+
+    ATBannerListener : {
+        developerCallback : null,
+
+        onBannerAdLoaded : function (placementId) {
+            if(this.developerCallback != null && this.developerCallback.onBannerAdLoaded != null && undefined != this.developerCallback.onBannerAdLoaded) {
+                this.developerCallback.onBannerAdLoaded(placementId);
+            }
+        },
+
+        onBannerAdLoadFail : function(placementId, errorInfo) {
+          if(this.developerCallback != null && this.developerCallback.onBannerAdLoadFail != null && undefined != this.developerCallback.onBannerAdLoadFail) {
+                this.developerCallback.onBannerAdLoadFail(placementId, errorInfo);
+            }
+        },
+
+        onBannerAdShow : function(placementId, callbackInfo) {
+           if(this.developerCallback != null && this.developerCallback.onBannerAdShow != null && undefined != this.developerCallback.onBannerAdShow) {
+                this.developerCallback.onBannerAdShow(placementId, callbackInfo);
+            }
+        },
+
+        onBannerAdClick : function(placementId, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onBannerAdClick != null && undefined != this.developerCallback.onBannerAdClick) {
+                this.developerCallback.onBannerAdClick(placementId, callbackInfo);
+            }
+        },
+
+        onBannerAdAutoRefresh : function(placementId, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onBannerAdAutoRefresh != null && undefined != this.developerCallback.onBannerAdAutoRefresh) {
+                this.developerCallback.onBannerAdAutoRefresh(placementId, callbackInfo);
+            }
+        },
+
+        onBannerAdAutoRefreshFail : function(placementId, errorInfo) {
+            if(this.developerCallback != null && this.developerCallback.onBannerAdAutoRefreshFail != null && undefined != this.developerCallback.onBannerAdAutoRefreshFail) {
+                this.developerCallback.onBannerAdAutoRefreshFail(placementId, errorInfo);
+            }
+        },
+
+        onBannerAdCloseButtonTapped : function(placementId, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onBannerAdCloseButtonTapped != null && undefined != this.developerCallback.onBannerAdCloseButtonTapped) {
+                this.developerCallback.onBannerAdCloseButtonTapped(placementId, callbackInfo);
+            }
+        },
+        //added v5.8.10
+        onAdSourceBiddingAttempt : function(placementId, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onAdSourceBiddingAttempt != null && undefined != this.developerCallback.onAdSourceBiddingAttempt) {
+                this.developerCallback.onAdSourceBiddingAttempt(placementId, callbackInfo);
+            }
+        },
+        onAdSourceBiddingFilled : function(placementId, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onAdSourceBiddingFilled != null && undefined != this.developerCallback.onAdSourceBiddingFilled) {
+                this.developerCallback.onAdSourceBiddingFilled(placementId, callbackInfo);
+            }
+        },
+        onAdSourceBiddingFail: function (placementId, errorInfo, callbackInfo)  {
+            if(this.developerCallback != null && this.developerCallback.onAdSourceBiddingFail != null && undefined != this.developerCallback.onAdSourceBiddingFail) {
+                this.developerCallback.onAdSourceBiddingFail(placementId, errorInfo, callbackInfo);
+            }
+        },
+        onAdSourceAttemp: function (placementId, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onAdSourceAttemp != null && undefined != this.developerCallback.onAdSourceAttemp) {
+                this.developerCallback.onAdSourceAttemp(placementId, callbackInfo);
+            }
+        },
+        onAdSourceLoadFilled : function(placementId, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onAdSourceLoadFilled != null && undefined != this.developerCallback.onAdSourceLoadFilled) {
+                this.developerCallback.onAdSourceLoadFilled(placementId, callbackInfo);
+            }
+        },
+        onAdSourceLoadFail : function(placementId, errorInfo, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onAdSourceLoadFail != null && undefined != this.developerCallback.onAdSourceLoadFail) {
+                this.developerCallback.onAdSourceLoadFail(placementId, errorInfo, callbackInfo);
+            }
+        }
+        
+    },
+    
+    loadBanner : function(placementId, settings={}) {
+
+        if (undefined != platformBridge && platformBridge != null) {
+			
+			if (settings.hasOwnProperty(ATBannerSDK.kATBannerAdLoadingExtraBannerAdSizeStruct)) {
+				var loadAdSize = settings[ATBannerSDK.kATBannerAdLoadingExtraBannerAdSizeStruct];
+				settings["width"] = loadAdSize["width"];
+				settings["height"] = loadAdSize["height"];
+			}
+			
+            platformBridge.loadBanner(placementId, JSON.stringify(settings));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+    
+    setAdListener : function(listener) {
+        var eventJSON = {};
+        eventJSON[LoadedCallbackKey]= "ATBannerSDK.ATBannerListener.onBannerAdLoaded",
+        eventJSON[LoadFailCallbackKey]=  "ATBannerSDK.ATBannerListener.onBannerAdLoadFail",
+        eventJSON[CloseCallbackKey]=  "ATBannerSDK.ATBannerListener.onBannerAdCloseButtonTapped",
+        eventJSON[ClickCallbackKey]=  "ATBannerSDK.ATBannerListener.onBannerAdClick",
+        eventJSON[ShowCallbackKey]=  "ATBannerSDK.ATBannerListener.onBannerAdShow",
+        eventJSON[RefreshCallbackKey]=  "ATBannerSDK.ATBannerListener.onBannerAdAutoRefresh",
+        eventJSON[RefreshFailCallbackKey]=  "ATBannerSDK.ATBannerListener.onBannerAdAutoRefreshFail",
+        //added v5.8.10
+        eventJSON[BiddingAttempt]= "ATBannerSDK.ATBannerListener.onAdSourceBiddingAttempt",
+        eventJSON[BiddingFilled]= "ATBannerSDK.ATBannerListener.onAdSourceBiddingFilled",
+        eventJSON[BiddingFail]= "ATBannerSDK.ATBannerListener.onAdSourceBiddingFail",
+        eventJSON[Attemp]= "ATBannerSDK.ATBannerListener.onAdSourceAttemp",
+        eventJSON[LoadFilled]= "ATBannerSDK.ATBannerListener.onAdSourceLoadFilled",
+        eventJSON[LoadFail]= "ATBannerSDK.ATBannerListener.onAdSourceLoadFail"
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.setAdListener(JSON.stringify(eventJSON));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+
+        this.ATBannerListener.developerCallback = listener;
+    },
+
+    hasAdReady : function(placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.hasAdReady(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+        return false;
+    },
+
+    checkAdStatus : function(placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.checkAdStatus(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+        return "";
+    },
+
+    showAdInPosition : function(placementId, position) {
+        if (undefined != platformBridge && platformBridge != null) {
+           platformBridge.showAdInPosition(placementId, position);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    showAdInPositionAndScenario : function(placementId, position, scenario) {
+        if (undefined != platformBridge && platformBridge != null) {
+           platformBridge.showAdInPosition(placementId, position, scenario);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    showAdInRectangle : function(placementId, showAdRect) {
+        if (undefined != platformBridge && platformBridge != null) {
+           platformBridge.showAdInRectangle(placementId, JSON.stringify(showAdRect));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    showAdInRectangleAndScenario : function(placementId, showAdRect, scenario) {
+        if (undefined != platformBridge && platformBridge != null) {
+           platformBridge.showAdInRectangle(placementId, JSON.stringify(showAdRect), scenario);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    removeAd : function(placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+           platformBridge.removeAd(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    reShowAd : function(placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+           platformBridge.reShowAd(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    hideAd : function(placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+           platformBridge.hideAd(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    createLoadAdSize : function(width, height) {
+    	var loadAdSize = {};
+    	loadAdSize["width"] = width;
+    	loadAdSize["height"] = height;
+    	return loadAdSize;
+    },
+
+    createShowAdRect : function(x, y, width, height) {
+    	var adRect = {};
+    	adRect["x"] = x;
+    	adRect["y"] = y;
+    	adRect["width"] = width;
+    	adRect["height"] = height;
+    	return adRect;
+    }
+
+  
+};
+
+const LoadedCallbackKey = "BannerLoaded";
+const LoadFailCallbackKey = "BannerLoadFail";
+const CloseCallbackKey = "BannerCloseButtonTapped";
+const ClickCallbackKey = "BannerClick";
+const ShowCallbackKey = "BannerShow";
+const RefreshCallbackKey = "BannerRefresh";
+const RefreshFailCallbackKey = "BannerRefreshFail";
+
+const BiddingAttempt = "BannerBiddingAttempt";
+const BiddingFilled = "BannerBiddingFilled";
+const BiddingFail = "BannerBiddingFail";
+const Attemp = "BannerAttemp";
+const LoadFilled = "BannerLoadFilled";
+const LoadFail = "BannerLoadFail";
+
+window["ATBannerSDK"] = ATBannerSDK;

+ 9 - 0
assets/scripts/AnyThinkAds/ATBannerTSSDK.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "204345cd-c076-4a12-b307-861e30974d46",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 180 - 0
assets/scripts/AnyThinkAds/ATIntersitialAutoTSSDK.ts

@@ -0,0 +1,180 @@
+import {ATAndroidInterstitialAutoAdTS} from "./Android/ATAndroidIntersitialAutoTS";
+import {ATiOSInterstitialAutoAdTS} from "./iOS/ATiOSIntersitiaAutolTS";
+import {ATJSSDK} from "./ATJSSDK";
+
+var initPlatformBridge = function () {
+    if (cc.sys.os === cc.sys.OS.IOS) {
+        return ATiOSInterstitialAutoAdTS;
+    } else if (cc.sys.os === cc.sys.OS.ANDROID) {
+        return ATAndroidInterstitialAutoAdTS;
+    }
+};
+
+var platformBridge = initPlatformBridge();
+
+
+export const ATInterstitialAutoAdSDK = {
+    
+    UseInterstitialAsInterstitial: "UseInterstitialAsInterstitial",
+    UseRewardedVideoAsInterstitial:"UseRewardedVideoAsInterstitial",
+    ATInterstitialListener: {
+        developerCallback: null,
+
+        onInterstitialAdLoaded : function (placementId) {
+            if(this.developerCallback != null && this.developerCallback.onInterstitialAdLoaded != null && undefined != this.developerCallback.onInterstitialAdLoaded) {
+                this.developerCallback.onInterstitialAdLoaded(placementId);
+            }
+        },
+
+        onInterstitialAdLoadFail : function(placementId, errorInfo) {
+          if(this.developerCallback != null && this.developerCallback.onInterstitialAdLoadFail != null && undefined != this.developerCallback.onInterstitialAdLoadFail) {
+                this.developerCallback.onInterstitialAdLoadFail(placementId, errorInfo);
+            }
+        },
+
+        onInterstitialAdShow : function(placementId, callbackInfo) {
+           if(this.developerCallback != null && this.developerCallback.onInterstitialAdShow != null && undefined != this.developerCallback.onInterstitialAdShow) {
+                this.developerCallback.onInterstitialAdShow(placementId, callbackInfo);
+            }
+        },
+
+        onInterstitialAdStartPlayingVideo : function(placementId, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onInterstitialAdStartPlayingVideo != null && undefined != this.developerCallback.onInterstitialAdStartPlayingVideo) {
+                this.developerCallback.onInterstitialAdStartPlayingVideo(placementId, callbackInfo);
+            }
+        },
+
+        onInterstitialAdEndPlayingVideo : function(placementId, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onInterstitialAdEndPlayingVideo != null && undefined != this.developerCallback.onInterstitialAdEndPlayingVideo) {
+                this.developerCallback.onInterstitialAdEndPlayingVideo(placementId, callbackInfo);
+            }
+        },
+
+        onInterstitialAdFailedToPlayVideo : function(placementId, errorInfo) {
+            if(this.developerCallback != null && this.developerCallback.onInterstitialAdFailedToPlayVideo != null && undefined != this.developerCallback.onInterstitialAdFailedToPlayVideo) {
+                this.developerCallback.onInterstitialAdFailedToPlayVideo(placementId, errorInfo);
+            }
+        },
+
+        onInterstitialAdFailedToShow : function(placementId, errorInfo, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onInterstitialAdFailedToShow != null && undefined != this.developerCallback.onInterstitialAdFailedToShow) {
+                this.developerCallback.onInterstitialAdFailedToShow(placementId, errorInfo, callbackInfo);
+            }
+        },
+
+        onInterstitialAdClose : function(placementId, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onInterstitialAdClose != null && undefined != this.developerCallback.onInterstitialAdClose) {
+                this.developerCallback.onInterstitialAdClose(placementId, callbackInfo);
+            }
+        },
+
+        onInterstitialAdClick : function(placementId, callbackInfo) {
+            if(this.developerCallback != null && this.developerCallback.onInterstitialAdClick != null && undefined != this.developerCallback.onInterstitialAdClick) {
+                this.developerCallback.onInterstitialAdClick(placementId, callbackInfo);
+            }
+        }
+    },
+
+    setAdExtraData: function (placementId, settings = {}) {
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.setAdExtraData(placementId, JSON.stringify(settings));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    addPlacementIds : function (placementIds){
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.addPlacementIds(JSON.stringify(placementIds));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    removePlacementId : function (placementIds){
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.removePlacementId(JSON.stringify(placementIds));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+    
+    setAdListener: function (listener) {
+        var eventJSON = {};
+        eventJSON[LoadedCallbackKey]="ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdLoaded",
+        eventJSON[LoadFailCallbackKey]= "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdLoadFail",
+        eventJSON[PlayStartCallbackKey]= "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdStartPlayingVideo",
+        eventJSON[PlayEndCallbackKey]= "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdEndPlayingVideo",
+        eventJSON[PlayFailCallbackKey]= "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdFailedToPlayVideo",
+        eventJSON[CloseCallbackKey]= "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdClose",
+        eventJSON[ClickCallbackKey]= "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdClick",
+        eventJSON[ShowCallbackKey]= "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdShow"
+        eventJSON[ShowFailCallbackKey]= "ATInterstitialAutoAdSDK.ATInterstitialListener.onInterstitialAdFailedToShow"
+        
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.setAdListener(JSON.stringify(eventJSON));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+
+        this.ATInterstitialListener.developerCallback = listener;
+    },
+
+    hasAdReady: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.hasAdReady(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+        return false;
+    },
+
+    checkAdStatus: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.checkAdStatus(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+        return "";
+    },
+
+    showAd: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.showAd(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    showAdInScenario: function (placementId, scenario = "") {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.showAdInScenario(placementId, scenario);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    entryAdScenario: function (placementId, scenario = "") {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.entryAdScenario(placementId, scenario);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    }
+
+};
+
+const LoadedCallbackKey = "InterstitialAutoAdLoaded";
+const LoadFailCallbackKey = "InterstitialAutoAdLoadFail";
+const PlayStartCallbackKey = "InterstitialAutoAdPlayStart";
+const PlayEndCallbackKey = "InterstitialAutoAdPlayEnd";
+const PlayFailCallbackKey = "InterstitialAutoAdPlayFail";
+const CloseCallbackKey = "InterstitialAutoAdClose";
+const ClickCallbackKey = "InterstitialAutoAdClick";
+const ShowCallbackKey = "InterstitialAutoAdAdShow";
+const ShowFailCallbackKey = "InterstitialAutoAdShowFail";
+
+window["ATInterstitialAutoAdSDK"] = ATInterstitialAutoAdSDK;

+ 9 - 0
assets/scripts/AnyThinkAds/ATIntersitialAutoTSSDK.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "938e1ccd-9382-4443-8eb0-bf316fa35efe",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 208 - 0
assets/scripts/AnyThinkAds/ATIntersitialTSSDK.ts

@@ -0,0 +1,208 @@
+import {ATAndroidInterstitialJS} from "./Android/ATAndroidIntersitialTS";
+import {ATiOSInterstitialJS} from "./iOS/ATiOSIntersitialTS";
+import {ATJSSDK} from "./ATJSSDK";
+
+var initPlatformBridge = function () {
+    if (cc.sys.os === cc.sys.OS.IOS) {
+        return ATiOSInterstitialJS;
+    } else if (cc.sys.os === cc.sys.OS.ANDROID) {
+        return ATAndroidInterstitialJS;
+    }
+};
+
+var platformBridge = initPlatformBridge();
+
+
+export const ATInterstitialSDK = {
+
+    UseInterstitialAsInterstitial: "UseInterstitialAsInterstitial",
+
+    ATInterstitialListener: {
+        developerCallback: null,
+        onInterstitialAdLoaded: function (placementId) {
+            if (this.developerCallback != null && this.developerCallback.onInterstitialAdLoaded != null && undefined != this.developerCallback.onInterstitialAdLoaded) {
+                this.developerCallback.onInterstitialAdLoaded(placementId);
+            }
+        },
+
+        onInterstitialAdLoadFail: function (placementId, errorInfo) {
+            if (this.developerCallback != null && this.developerCallback.onInterstitialAdLoadFail != null && undefined != this.developerCallback.onInterstitialAdLoadFail) {
+                this.developerCallback.onInterstitialAdLoadFail(placementId, errorInfo);
+            }
+        },
+
+        onInterstitialAdShow: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onInterstitialAdShow != null && undefined != this.developerCallback.onInterstitialAdShow) {
+                this.developerCallback.onInterstitialAdShow(placementId, callbackInfo);
+            }
+        },
+
+        onInterstitialAdStartPlayingVideo: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onInterstitialAdStartPlayingVideo != null && undefined != this.developerCallback.onInterstitialAdStartPlayingVideo) {
+                this.developerCallback.onInterstitialAdStartPlayingVideo(placementId, callbackInfo);
+            }
+        },
+
+        onInterstitialAdEndPlayingVideo: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onInterstitialAdEndPlayingVideo != null && undefined != this.developerCallback.onInterstitialAdEndPlayingVideo) {
+                this.developerCallback.onInterstitialAdEndPlayingVideo(placementId, callbackInfo);
+            }
+        },
+
+        onInterstitialAdFailedToPlayVideo: function (placementId, errorInfo) {
+            if (this.developerCallback != null && this.developerCallback.onInterstitialAdFailedToPlayVideo != null && undefined != this.developerCallback.onInterstitialAdFailedToPlayVideo) {
+                this.developerCallback.onInterstitialAdFailedToPlayVideo(placementId, errorInfo);
+            }
+        },
+
+        onInterstitialAdFailedToShow: function (placementId, errorInfo, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onInterstitialAdFailedToShow != null && undefined != this.developerCallback.onInterstitialAdFailedToShow) {
+                this.developerCallback.onInterstitialAdFailedToShow(placementId, errorInfo, callbackInfo);
+            }
+        },
+
+        onInterstitialAdClose: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onInterstitialAdClose != null && undefined != this.developerCallback.onInterstitialAdClose) {
+                this.developerCallback.onInterstitialAdClose(placementId, callbackInfo);
+            }
+        },
+
+        onInterstitialAdClick: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onInterstitialAdClick != null && undefined != this.developerCallback.onInterstitialAdClick) {
+                this.developerCallback.onInterstitialAdClick(placementId, callbackInfo);
+            }
+        },
+        //added v5.8.10
+        onAdSourceBiddingAttempt: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingAttempt != null && undefined != this.developerCallback.onAdSourceBiddingAttempt) {
+                this.developerCallback.onAdSourceBiddingAttempt(placementId, callbackInfo);
+            }
+        },
+        onAdSourceBiddingFilled: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFilled != null && undefined != this.developerCallback.onAdSourceBiddingFilled) {
+                this.developerCallback.onAdSourceBiddingFilled(placementId, callbackInfo);
+            }
+        },
+        onAdSourceBiddingFail: function (placementId, errorInfo, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFail != null && undefined != this.developerCallback.onAdSourceBiddingFail) {
+                this.developerCallback.onAdSourceBiddingFail(placementId, errorInfo, callbackInfo);
+            }
+        },
+        onAdSourceAttemp: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onAdSourceAttemp != null && undefined != this.developerCallback.onAdSourceAttemp) {
+                this.developerCallback.onAdSourceAttemp(placementId, callbackInfo);
+            }
+        },
+        onAdSourceLoadFilled: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFilled != null && undefined != this.developerCallback.onAdSourceLoadFilled) {
+                this.developerCallback.onAdSourceLoadFilled(placementId, callbackInfo);
+            }
+        },
+        onAdSourceLoadFail: function (placementId, errorInfo, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFail != null && undefined != this.developerCallback.onAdSourceLoadFail) {
+                this.developerCallback.onAdSourceLoadFail(placementId, errorInfo, callbackInfo);
+            }
+        }
+
+    },
+
+    loadInterstitial: function (placementId, settings = {}) {
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.loadInterstitial(placementId, JSON.stringify(settings));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+   
+    setAdListener: function (listener) {
+        var eventJSON = {};
+        eventJSON[LoadedCallbackKey] = " ATInterstitialSDK.ATInterstitialListener.onInterstitialAdLoaded",
+            eventJSON[LoadFailCallbackKey] = " ATInterstitialSDK.ATInterstitialListener.onInterstitialAdLoadFail",
+            eventJSON[PlayStartCallbackKey] = " ATInterstitialSDK.ATInterstitialListener.onInterstitialAdStartPlayingVideo",
+            eventJSON[PlayEndCallbackKey] = " ATInterstitialSDK.ATInterstitialListener.onInterstitialAdEndPlayingVideo",
+            eventJSON[PlayFailCallbackKey] = " ATInterstitialSDK.ATInterstitialListener.onInterstitialAdFailedToPlayVideo",
+            eventJSON[CloseCallbackKey] = " ATInterstitialSDK.ATInterstitialListener.onInterstitialAdClose",
+            eventJSON[ClickCallbackKey] = " ATInterstitialSDK.ATInterstitialListener.onInterstitialAdClick",
+            eventJSON[ShowCallbackKey] = " ATInterstitialSDK.ATInterstitialListener.onInterstitialAdShow",
+            eventJSON[ShowFailCallbackKey] = " ATInterstitialSDK.ATInterstitialListener.onInterstitialAdFailedToShow",
+            //added v5.8.10
+            eventJSON[BiddingAttempt] = " ATInterstitialSDK.ATInterstitialListener.onAdSourceBiddingAttempt",
+            eventJSON[BiddingFilled] = " ATInterstitialSDK.ATInterstitialListener.onAdSourceBiddingFilled",
+            eventJSON[BiddingFail] = " ATInterstitialSDK.ATInterstitialListener.onAdSourceBiddingFail",
+            eventJSON[Attemp] = " ATInterstitialSDK.ATInterstitialListener.onAdSourceAttemp",
+            eventJSON[LoadFilled] = " ATInterstitialSDK.ATInterstitialListener.onAdSourceLoadFilled",
+            eventJSON[LoadFail] = " ATInterstitialSDK.ATInterstitialListener.onAdSourceLoadFail"
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.setAdListener(JSON.stringify(eventJSON));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+
+        this.ATInterstitialListener.developerCallback = listener;
+    },
+
+    hasAdReady: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.hasAdReady(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+        return false;
+    },
+
+    checkAdStatus: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.checkAdStatus(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+        return "";
+    },
+
+    showAd: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.showAd(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    showAdInScenario: function (placementId, scenario = "") {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.showAdInScenario(placementId, scenario);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    entryAdScenario: function (placementId, scenario = "") {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.entryAdScenario(placementId, scenario);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    }
+
+
+};
+
+const LoadedCallbackKey = "InterstitialLoaded";
+const LoadFailCallbackKey = "InterstitialLoadFail";
+const PlayStartCallbackKey = "InterstitialPlayStart";
+const PlayEndCallbackKey = "InterstitialPlayEnd";
+const PlayFailCallbackKey = "InterstitialPlayFail";
+const CloseCallbackKey = "InterstitialClose";
+const ClickCallbackKey = "InterstitialClick";
+const ShowCallbackKey = "InterstitialAdShow";
+const ShowFailCallbackKey = "InterstitialAdShowFail";
+
+const BiddingAttempt = "InterstitialBiddingAttempt";
+const BiddingFilled = "InterstitialBiddingFilled";
+const BiddingFail = "InterstitialBiddingFail";
+const Attemp = "InterstitialAttemp";
+const LoadFilled = "InterstitialLoadFilled";
+const LoadFail = "InterstitialLoadFail";
+
+window["ATInterstitialSDK"] = ATInterstitialSDK;

+ 9 - 0
assets/scripts/AnyThinkAds/ATIntersitialTSSDK.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "c670337b-6527-47ca-9b99-45d8ccacc2ec",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 200 - 0
assets/scripts/AnyThinkAds/ATJSSDK.ts

@@ -0,0 +1,200 @@
+
+import {ATAndroidJS} from "./Android/ATAndroidJS"
+import {ATiOSJS} from "./iOS/ATiOSJS";
+
+import { _decorator, Component, Node, sys ,log } from 'cc';
+const { ccclass, property } = _decorator;
+
+var isDebugLog = false;
+
+var initPlatformBridge = function() {  
+    if (sys.os === sys.OS.IOS) {      
+        console.log("initSDK 3");     
+        return ATiOSJS;
+    } else if (sys.os === sys.OS.ANDROID) {
+        console.log("initSDK 4");     
+        return ATAndroidJS;
+    }
+};
+
+var platformBridge = initPlatformBridge();
+
+export const ATJSSDK = {
+
+    kATUserLocationUnknown : 0,
+    kATUserLocationInEU : 1,
+    kATUserLocationOutOfEU : 2,
+
+
+    PERSONALIZED : 0,
+    NONPERSONALIZED :1,
+    UNKNOWN : 2,
+    
+    
+    //for android and ios
+    OS_VERSION_NAME : "os_vn",
+    OS_VERSION_CODE : "os_vc",
+    APP_PACKAGE_NAME : "package_name",
+    APP_VERSION_NAME : "app_vn",
+    APP_VERSION_CODE : "app_vc",
+
+    BRAND : "brand",
+    MODEL : "model",
+    DEVICE_SCREEN_SIZE : "screen",
+    MNC : "mnc",
+    MCC : "mcc",
+
+    LANGUAGE : "language",
+    TIMEZONE : "timezone",
+    USER_AGENT : "ua",
+    ORIENTATION : "orient",
+    NETWORK_TYPE : "network_type",
+
+    //for android
+    INSTALLER : "it_src",
+    ANDROID_ID : "android_id",
+    GAID : "gaid",
+    MAC : "mac",
+    IMEI : "imei",
+    OAID : "oaid",
+    
+    //for ios
+    IDFA : "idfa",
+    IDFV : "idfv",
+
+    ATSDKListener : {
+        userLocationCallback : null,
+
+        getUserLocationCallback : function(userLocation) {
+            if(undefined != this.userLocationCallback && this.userLocationCallback != null ){
+                this.userLocationCallback(userLocation);
+            }
+        }
+    },
+    
+    initSDK : function(appId, appKey) {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.initSDK(appId, appKey);
+        } else {
+            log("You must run on Android or iOS.");
+        }
+    },
+
+    initCustomMap : function(customMap) {
+        if (undefined != platformBridge && platformBridge != null) {
+            if(undefined != customMap && customMap != null) {
+                platformBridge.initCustomMap(JSON.stringify(customMap));
+            }
+        } else {
+            log("You must run on Android or iOS.");
+        }
+    },
+
+    setPlacementCustomMap : function(placmentId, customMap) {
+        if (undefined != platformBridge && platformBridge != null) {
+            if(undefined != customMap && customMap != null) {
+                 platformBridge.setPlacementCustomMap(placmentId, JSON.stringify(customMap));
+            }
+        } else {
+            log("You must run on Android or iOS.");
+        }
+    },
+
+    setGDPRLevel : function(level) {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.setGDPRLevel(level);
+        } else {
+            log("You must run on Android or iOS.");
+        }
+    },
+
+    getGDPRLevel : function() {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.getGDPRLevel();
+        } else {
+            log("You must run on Android or iOS.");
+        }
+        return this.UNKNOWN;
+    },
+
+    getUserLocation : function(userLocationCallback) {
+        this.ATSDKListener.userLocationCallback = userLocationCallback;
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.getUserLocation(GetUserLocationJsCallback);
+        } else {
+            log("You must run on Android or iOS.");
+        }
+    },
+
+    showGDPRAuth : function () {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.showGDPRAuth();
+        } else {
+            log("You must run on Android or iOS.");
+        }
+    },
+
+    setLogDebug : function (debug) {
+        isDebugLog = debug;
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.setLogDebug(debug);
+        } else {
+            log("You must run on Android or iOS.");
+        }
+    },
+
+    printLog : function(msg) {
+        if (undefined != msg && null != msg && isDebugLog && platformBridge != null ) {
+            if (undefined != platformBridge && platformBridge != null) {
+                platformBridge.printJsLog(msg); 
+            } else {
+                log("You must run on Android or iOS.");
+            }
+                
+        }
+    },
+
+    printLogWithParams : function(tag, methodName, placementId, callbackInfo, errorInfo) {
+        this.printLog(tag + "::" + methodName + "()" + "\nplacementId=" + placementId + "\ncallbackInfo=" + callbackInfo + "\nerrorInfo=" + errorInfo);
+    },
+
+    deniedUploadDeviceInfo : function (deniedInfo) {
+        if (undefined != platformBridge && platformBridge != null) {
+			
+			if (deniedInfo != null) {
+				var length = deniedInfo.length;
+				var deniedInfoString = "";
+				for (var i = 0; i < length; i++) {
+					var info = deniedInfo[i];
+					if (i == 0) {
+						deniedInfoString = info;
+					} else {
+						deniedInfoString = deniedInfoString + "," + info;
+					}
+				}
+				
+				log("test__" + deniedInfoString)
+				
+				platformBridge.deniedUploadDeviceInfo(deniedInfoString);
+			}
+			
+        } else {
+            log("You must run on Android or iOS.");
+        }
+    },
+
+    showDebuggerUI : function (debugKey) {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.showDebuggerUI(debugKey);
+        }
+    }
+  
+};
+
+const GetUserLocationJsCallback = " ATJSSDK.ATSDKListener.getUserLocationCallback";
+
+const VersionCode = 'v1.1.0';
+
+window["ATJSSDK"] = ATJSSDK;
+export default ATJSSDK;
+

+ 9 - 0
assets/scripts/AnyThinkAds/ATJSSDK.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "0dd695d9-8781-40cb-9201-9f6c052ae7fb",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 275 - 0
assets/scripts/AnyThinkAds/ATNativeTSSDK.ts

@@ -0,0 +1,275 @@
+
+import { Component } from "cc";
+import {ATiOSNativeTS} from "./iOS/ATiOSNativeTS"
+import {ATAndroidNativeTS} from "./Android/ATAndroidNativeTS"
+var initPlatformBridge = function () {
+    if (cc.sys.os === cc.sys.OS.IOS) {
+        return ATiOSNativeTS;
+    } else if (cc.sys.os === cc.sys.OS.ANDROID) {
+        return ATAndroidNativeTS;
+    }
+};
+
+var platformBridge = initPlatformBridge();
+
+
+export const ATNativeTSSDK =  {
+    ATNativeListener: {
+        developerCallback: null,
+        onNativeAdLoaded: function (placementId) {
+            if (this.developerCallback != null && this.developerCallback.onNativeAdLoaded != null && undefined != this.developerCallback.onNativeAdLoaded) {
+                this.developerCallback.onNativeAdLoaded(placementId);
+            }
+        },
+
+        onNativeAdLoadFail: function (placementId, errorInfo) {
+            if (this.developerCallback != null && this.developerCallback.onNativeAdLoadFail != null && undefined != this.developerCallback.onNativeAdLoadFail) {
+                this.developerCallback.onNativeAdLoadFail(placementId, errorInfo);
+            }
+        },
+
+        onNativeAdShow: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onNativeAdShow != null && undefined != this.developerCallback.onNativeAdShow) {
+                this.developerCallback.onNativeAdShow(placementId, callbackInfo);
+            }
+        },
+
+        onNativeAdClick: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onNativeAdClick != null && undefined != this.developerCallback.onNativeAdClick) {
+                this.developerCallback.onNativeAdClick(placementId, callbackInfo);
+            }
+        },
+
+        onNativeAdVideoStart: function (placementId) {
+            if (this.developerCallback != null && this.developerCallback.onNativeAdVideoStart != null && undefined != this.developerCallback.onNativeAdVideoStart) {
+                this.developerCallback.onNativeAdVideoStart(placementId,);
+            }
+        },
+
+        onNativeAdVideoEnd: function (placementId) {
+            if (this.developerCallback != null && this.developerCallback.onNativeAdVideoEnd != null && undefined != this.developerCallback.onNativeAdVideoEnd) {
+                this.developerCallback.onNativeAdVideoEnd(placementId);
+            }
+        },
+
+        onNativeAdCloseButtonTapped: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onNativeAdCloseButtonTapped != null && undefined != this.developerCallback.onNativeAdCloseButtonTapped) {
+                this.developerCallback.onNativeAdCloseButtonTapped(placementId, callbackInfo);
+            }
+        },
+        //added v5.8.10
+        onAdSourceBiddingAttempt: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingAttempt != null && undefined != this.developerCallback.onAdSourceBiddingAttempt) {
+                this.developerCallback.onAdSourceBiddingAttempt(placementId, callbackInfo);
+            }
+        },
+        onAdSourceBiddingFilled: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFilled != null && undefined != this.developerCallback.onAdSourceBiddingFilled) {
+                this.developerCallback.onAdSourceBiddingFilled(placementId, callbackInfo);
+            }
+        },
+        onAdSourceBiddingFail: function (placementId, errorInfo, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFail != null && undefined != this.developerCallback.onAdSourceBiddingFail) {
+                this.developerCallback.onAdSourceBiddingFail(placementId, errorInfo, callbackInfo);
+            }
+        },
+        onAdSourceAttemp: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onAdSourceAttemp != null && undefined != this.developerCallback.onAdSourceAttemp) {
+                this.developerCallback.onAdSourceAttemp(placementId, callbackInfo);
+            }
+        },
+        onAdSourceLoadFilled: function (placementId, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFilled != null && undefined != this.developerCallback.onAdSourceLoadFilled) {
+                this.developerCallback.onAdSourceLoadFilled(placementId, callbackInfo);
+            }
+        },
+        onAdSourceLoadFail: function (placementId, errorInfo, callbackInfo) {
+            if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFail != null && undefined != this.developerCallback.onAdSourceLoadFail) {
+                this.developerCallback.onAdSourceLoadFail(placementId, errorInfo, callbackInfo);
+            }
+        }
+
+    },
+
+    loadNative: function (placementId, settings = {}) {
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.loadNative(placementId, JSON.stringify(settings));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },    
+
+    setAdListener: function (listener) {
+        var eventJSON = {};
+        eventJSON[LoadedCallbackKey] = "ATNativeTSSDK.ATNativeListener.onNativeAdLoaded",
+            eventJSON[LoadFailCallbackKey] = "ATNativeTSSDK.ATNativeListener.onNativeAdLoadFail",
+            eventJSON[CloseCallbackKey] = "ATNativeTSSDK.ATNativeListener.onNativeAdCloseButtonTapped",
+            eventJSON[ClickCallbackKey] = "ATNativeTSSDK.ATNativeListener.onNativeAdClick",
+            eventJSON[ShowCallbackKey] = "ATNativeTSSDK.ATNativeListener.onNativeAdShow",
+            eventJSON[VideoStartKey] = "ATNativeTSSDK.ATNativeListener.onNativeAdVideoStart",
+            eventJSON[VideoEndKey] = "ATNativeTSSDK.ATNativeListener.onNativeAdVideoEnd",
+            //added v5.8.10
+            eventJSON[BiddingAttempt] = "ATNativeTSSDK.ATNativeListener.onAdSourceBiddingAttempt",
+            eventJSON[BiddingFilled] = "ATNativeTSSDK.ATNativeListener.onAdSourceBiddingFilled",
+            eventJSON[BiddingFail] = "ATNativeTSSDK.ATNativeListener.onAdSourceBiddingFail",
+            eventJSON[Attemp] = "ATNativeTSSDK.ATNativeListener.onAdSourceAttemp",
+            eventJSON[LoadFilled] = "ATNativeTSSDK.ATNativeListener.onAdSourceLoadFilled",
+            eventJSON[LoadFail] = "ATNativeTSSDK.ATNativeListener.onAdSourceLoadFail"
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.setAdListener(JSON.stringify(eventJSON));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+
+        this.ATNativeListener.developerCallback = listener;
+    },
+
+    hasAdReady: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.hasAdReady(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+        return false;
+    },
+
+    checkAdStatus: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.checkAdStatus(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+        return "";
+    },
+
+    showAd: function (placementId, adViewProperty) {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.showAd(placementId, JSON.stringify(adViewProperty.getAdViewProperty()));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    showAdInScenario: function (placementId, adViewProperty, scenario = "") {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.showAdInScenario(placementId, JSON.stringify(adViewProperty.getAdViewProperty()), scenario);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    entryAdScenario: function (placementId, scenario = "") {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.entryAdScenario(placementId, scenario);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    removeAd: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.removeAd(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    createLoadAdSize: function (width, height) {
+        var loadAdSize = {};
+        loadAdSize["width"] = width;
+        loadAdSize["height"] = height;
+        return loadAdSize;
+    },
+
+};
+
+export class  AdViewProperty extends Component {
+
+   parent = null
+    appIcon = null
+    mainImage = null
+    title = null
+    desc = null
+    adLogo = null
+    cta = null
+    rating = null
+    dislike = null
+    elements = null
+
+    createItemViewProperty (x, y, width, height, backgroundColor, textColor, textSize, isCustomClick = false) {
+        var itemProperty = {};
+        itemProperty["x"] = x;
+        itemProperty["y"] = y;
+        itemProperty["width"] = width;
+        itemProperty["height"] = height;
+        itemProperty["backgroundColor"] = backgroundColor;
+        itemProperty["textColor"] = textColor;
+        itemProperty["textSize"] = textSize;
+        itemProperty["isCustomClick"] = isCustomClick;
+
+        return itemProperty;
+    }
+
+    getAdViewProperty() {
+        var nativeViewProperty = {};
+
+        if (this.parent != null) {
+            nativeViewProperty["parent"] = this.parent;
+        }
+
+        if (this.appIcon != null) {
+            nativeViewProperty["icon"] = this.appIcon;
+        }
+
+        if (this.mainImage != null) {
+            nativeViewProperty["mainImage"] = this.mainImage;
+        }
+
+        if (this.title != null) {
+            nativeViewProperty["title"] = this.title;
+        }
+
+        if (this.desc != null) {
+            nativeViewProperty["desc"] = this.desc;
+        }
+
+        if (this.adLogo != null) {
+            nativeViewProperty["adLogo"] = this.adLogo;
+        }
+
+        if (this.cta != null) {
+            nativeViewProperty["cta"] = this.cta;
+        }
+
+        if (this.rating != null) {
+            nativeViewProperty["rating"] = this.rating;
+        }
+
+        if (this.dislike != null) {
+            nativeViewProperty["dislike"] = this.dislike;
+        }
+
+        if (this.elements != null) {
+            nativeViewProperty["elements"] = this.elements
+        }
+
+        return nativeViewProperty;
+    }
+}
+
+const LoadedCallbackKey = "NativeLoaded";
+const LoadFailCallbackKey = "NativeLoadFail";
+const CloseCallbackKey = "NativeCloseButtonTapped";
+const ClickCallbackKey = "NativeClick";
+const ShowCallbackKey = "NativeShow";
+const VideoStartKey = "NativeVideoStart";
+const VideoEndKey = "NativeVideoEnd";
+const BiddingAttempt = "NativeBiddingAttempt";
+const BiddingFilled = "NativeBiddingFilled";
+const BiddingFail = "NativeBiddingFail";
+const Attemp = "NativeAttemp";
+const LoadFilled = "NativeLoadFilled";
+const LoadFail = "NativeLoadFail";
+window["ATNativeTSSDK"] = ATNativeTSSDK;

+ 9 - 0
assets/scripts/AnyThinkAds/ATNativeTSSDK.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "9b447c33-4d16-4674-b90a-b2e89dd6d968",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 214 - 0
assets/scripts/AnyThinkAds/ATRewardedAutoVideoTSSDK.ts

@@ -0,0 +1,214 @@
+import {ATAndroidRewardedVideoAutoAdTS} from "./Android/ATAndroidRewardedVideoAutoTS";
+import {ATiOSRewardedVideoAutoAdJS} from "./iOS/ATiOSRewardedAutoVideoTS";
+import {ATJSSDK} from "./ATJSSDK";
+
+var initPlatformBridge = function () {
+    if (cc.sys.os === cc.sys.OS.IOS) {
+        return ATiOSRewardedVideoAutoAdJS;
+    } else if (cc.sys.os === cc.sys.OS.ANDROID) {
+        return ATAndroidRewardedVideoAutoAdTS;
+    }
+};
+
+var platformBridge = initPlatformBridge();
+export const ATRewardedVideoAutoAdSDK = {
+    userIdKey: "userID",
+    userDataKey: "media_ext",
+
+    ATRewardedVideoListener: {
+        developerCallback: null,
+
+        onRewardedVideoAdLoaded: function (placementId) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdLoaded(" + placementId + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdLoaded != null && undefined != this.developerCallback.onRewardedVideoAdLoaded) {
+                this.developerCallback.onRewardedVideoAdLoaded(placementId);
+            }
+        },
+        onRewardedVideoAdFailed: function (placementId, errorInfo) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdFailed(" + placementId + ", " + errorInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdFailed != null && undefined != this.developerCallback.onRewardedVideoAdFailed) {
+                this.developerCallback.onRewardedVideoAdFailed(placementId, errorInfo);
+            }
+        },
+        onRewardedVideoAdPlayStart: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdPlayStart(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayStart != null && undefined != this.developerCallback.onRewardedVideoAdPlayStart) {
+                this.developerCallback.onRewardedVideoAdPlayStart(placementId, callbackInfo);
+            }
+        },
+        onRewardedVideoAdPlayEnd: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdPlayEnd(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayEnd != null && undefined != this.developerCallback.onRewardedVideoAdPlayEnd) {
+                this.developerCallback.onRewardedVideoAdPlayEnd(placementId, callbackInfo);
+            }
+        },
+        onRewardedVideoAdPlayFailed: function (placementId, errorInfo, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdPlayFailed(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayFailed != null && undefined != this.developerCallback.onRewardedVideoAdPlayFailed) {
+                this.developerCallback.onRewardedVideoAdPlayFailed(placementId, errorInfo, callbackInfo);
+            }
+        },
+        onRewardedVideoAdClosed: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdClosed(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdClosed != null && undefined != this.developerCallback.onRewardedVideoAdClosed) {
+                this.developerCallback.onRewardedVideoAdClosed(placementId, callbackInfo);
+            }
+        },
+        onRewardedVideoAdPlayClicked: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdPlayClicked(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayClicked != null && undefined != this.developerCallback.onRewardedVideoAdPlayClicked) {
+                this.developerCallback.onRewardedVideoAdPlayClicked(placementId, callbackInfo);
+            }
+        },
+        onReward: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onReward(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onReward != null && undefined != this.developerCallback.onReward) {
+                this.developerCallback.onReward(placementId, callbackInfo);
+            }
+        },
+        onRewardedVideoAdAgainPlayStart: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayStart(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayStart != null && undefined != this.developerCallback.onRewardedVideoAdAgainPlayStart) {
+                this.developerCallback.onRewardedVideoAdAgainPlayStart(placementId, callbackInfo);
+            }
+        },
+        onRewardedVideoAdAgainPlayEnd: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayEnd(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayEnd != null && undefined != this.developerCallback.onRewardedVideoAdAgainPlayEnd) {
+                this.developerCallback.onRewardedVideoAdAgainPlayEnd(placementId, callbackInfo);
+            }
+        },
+        onRewardedVideoAdAgainPlayFailed: function (placementId, errorInfo, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayFailed(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayFailed != null && undefined != this.developerCallback.onRewardedVideoAdAgainPlayFailed) {
+                this.developerCallback.onRewardedVideoAdAgainPlayFailed(placementId, errorInfo, callbackInfo);
+            }
+        },
+        onRewardedVideoAdAgainPlayClicked: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayClicked(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayClicked != null && undefined != this.developerCallback.onRewardedVideoAdAgainPlayClicked) {
+                this.developerCallback.onRewardedVideoAdAgainPlayClicked(placementId, callbackInfo);
+            }
+        },
+        onAgainReward: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onAgainReward(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onAgainReward != null && undefined != this.developerCallback.onAgainReward) {
+                this.developerCallback.onAgainReward(placementId, callbackInfo);
+            }
+        }
+    },
+
+    setAdExtraData: function (placementId, settings = {}) {
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.setAdExtraData(placementId, JSON.stringify(settings));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    addPlacementIds : function (placementIds){
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.addPlacementIds(JSON.stringify(placementIds));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    removePlacementId : function (placementIds){
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.removePlacementId(JSON.stringify(placementIds));
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+    
+    setAdListener: function (listener) {
+        var eventJSON = {};
+        eventJSON[LoadedCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdLoaded",
+        eventJSON[LoadFailCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdFailed",
+        eventJSON[PlayStartCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdPlayStart",
+        eventJSON[PlayEndCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdPlayEnd",
+        eventJSON[PlayFailCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdPlayFailed",
+        eventJSON[CloseCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdClosed",
+        eventJSON[ClickCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdPlayClicked",
+        eventJSON[RewardCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onReward",
+        //playAgain listener
+        eventJSON[AgainPlayStartCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayStart",
+        eventJSON[AgainPlayEndCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayEnd",
+        eventJSON[AgainPlayFailCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayFailed",
+        eventJSON[AgainClickCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayClicked",
+        eventJSON[AgainRewardCallbackKey] = "ATRewardedVideoAutoAdSDK.ATRewardedVideoListener.onAgainReward"
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.setAdListener(JSON.stringify(eventJSON));
+            platformBridge.set
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+
+        this.ATRewardedVideoListener.developerCallback = listener;
+    },
+
+    hasAdReady: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.hasAdReady(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+        return false;
+    },
+
+    checkAdStatus: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.checkAdStatus(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+        return "";
+    },
+
+    showAd: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.showAd(placementId);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    showAdInScenario: function (placementId, scenario = "") {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.showAdInScenario(placementId, scenario);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    },
+
+    entryAdScenario: function (placementId, scenario = "") {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.entryAdScenario(placementId, scenario);
+        } else {
+            cc.log("You must run on Android or iOS.");
+        }
+    }
+
+};
+
+const LoadedCallbackKey = "RewardedVideoAutoAdLoaded";
+const LoadFailCallbackKey = "RewardedVideoAutoAdLoadFail";
+const PlayStartCallbackKey = "RewardedVideoAutoAdPlayStart";
+const PlayEndCallbackKey = "RewardedVideoAutoAdPlayEnd";
+const PlayFailCallbackKey = "RewardedVideoAutoAdPlayFail";
+const CloseCallbackKey = "RewardedVideoAutoAdClose";
+const ClickCallbackKey = "RewardedVideoAutoAdClick";
+const RewardCallbackKey = "RewardedVideoAutoAdReward";
+
+const AgainPlayStartCallbackKey = "RewardedVideoAutoAdAgainPlayStart";
+const AgainPlayEndCallbackKey = "RewardedVideoAutoAdAgainPlayEnd";
+const AgainPlayFailCallbackKey = "RewardedVideoAutoAdAgainPlayFail";
+const AgainClickCallbackKey = "RewardedVideoAutoAdAgainClick";
+const AgainRewardCallbackKey = "RewardedVideoAutoAdAgainReward";
+
+window["ATRewardedVideoAutoAdSDK"] = ATRewardedVideoAutoAdSDK;

+ 9 - 0
assets/scripts/AnyThinkAds/ATRewardedAutoVideoTSSDK.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "53ffe099-712b-47fd-bac2-129c23350c83",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 253 - 0
assets/scripts/AnyThinkAds/ATRewardedVideoTSSDK.ts

@@ -0,0 +1,253 @@
+import {ATAndroidRewardedVideoJS} from "./Android/ATAndroidRewardedVideoTS";
+import {ATiOSRewardedVideoTS} from "./iOS/ATiOSRewardedVideoTS";
+import {ATJSSDK} from "./ATJSSDK";
+import { _decorator, Component, Node, sys ,log } from 'cc';
+
+var initPlatformBridge = function () {
+    if (sys.os === sys.OS.IOS) {
+        return ATiOSRewardedVideoTS;
+    } else if (sys.os === sys.OS.ANDROID) {
+        return ATAndroidRewardedVideoJS;
+    }
+};
+
+var platformBridge = initPlatformBridge();
+
+
+export const ATRewardedVideoSDK =  {
+    userIdKey: "userID",
+    userDataKey: "media_ext",
+
+    ATRewardedVideoListener: {
+        developerCallback: null,
+
+        onRewardedVideoAdLoaded: function (placementId) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdLoaded(" + placementId + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdLoaded != null && undefined != this.developerCallback.onRewardedVideoAdLoaded) {
+                this.developerCallback.onRewardedVideoAdLoaded(placementId);
+            }
+        },
+        onRewardedVideoAdFailed: function (placementId, errorInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdFailed(" + placementId + ", " + errorInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdFailed != null && undefined != this.developerCallback.onRewardedVideoAdFailed) {
+                this.developerCallback.onRewardedVideoAdFailed(placementId, errorInfo);
+            }
+        },
+        onRewardedVideoAdPlayStart: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayStart(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayStart != null && undefined != this.developerCallback.onRewardedVideoAdPlayStart) {
+                this.developerCallback.onRewardedVideoAdPlayStart(placementId, callbackInfo);
+            }
+        },
+        onRewardedVideoAdPlayEnd: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayEnd(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayEnd != null && undefined != this.developerCallback.onRewardedVideoAdPlayEnd) {
+                this.developerCallback.onRewardedVideoAdPlayEnd(placementId, callbackInfo);
+            }
+        },
+        onRewardedVideoAdPlayFailed: function (placementId, errorInfo, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayFailed(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayFailed != null && undefined != this.developerCallback.onRewardedVideoAdPlayFailed) {
+                this.developerCallback.onRewardedVideoAdPlayFailed(placementId, errorInfo, callbackInfo);
+            }
+        },
+        onRewardedVideoAdClosed: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdClosed(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdClosed != null && undefined != this.developerCallback.onRewardedVideoAdClosed) {
+                this.developerCallback.onRewardedVideoAdClosed(placementId, callbackInfo);
+            }
+        },
+        onRewardedVideoAdPlayClicked: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayClicked(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdPlayClicked != null && undefined != this.developerCallback.onRewardedVideoAdPlayClicked) {
+                this.developerCallback.onRewardedVideoAdPlayClicked(placementId, callbackInfo);
+            }
+        },
+        onReward: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onReward(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onReward != null && undefined != this.developerCallback.onReward) {
+                this.developerCallback.onReward(placementId, callbackInfo);
+            }
+        },
+        //added v5.8.10
+        onAdSourceBiddingAttempt: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceBiddingAttempt(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingAttempt != null && undefined != this.developerCallback.onAdSourceBiddingAttempt) {
+                this.developerCallback.onAdSourceBiddingAttempt(placementId, callbackInfo);
+            }
+        },
+        onAdSourceBiddingFilled: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceBiddingFilled(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFilled != null && undefined != this.developerCallback.onAdSourceBiddingFilled) {
+                this.developerCallback.onAdSourceBiddingFilled(placementId, callbackInfo);
+            }
+        },
+        onAdSourceBiddingFail: function (placementId, errorInfo, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceBiddingFail(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onAdSourceBiddingFail != null && undefined != this.developerCallback.onAdSourceBiddingFail) {
+                this.developerCallback.onAdSourceBiddingFail(placementId, errorInfo, callbackInfo);
+            }
+        },
+        onAdSourceAttemp: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceAttemp(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onAdSourceAttemp != null && undefined != this.developerCallback.onAdSourceAttemp) {
+                this.developerCallback.onAdSourceAttemp(placementId, callbackInfo);
+            }
+        },
+        onAdSourceLoadFilled: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceLoadFilled(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFilled != null && undefined != this.developerCallback.onAdSourceLoadFilled) {
+                this.developerCallback.onAdSourceLoadFilled(placementId, callbackInfo);
+            }
+        },
+        onAdSourceLoadFail: function (placementId, errorInfo, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceLoadFail(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onAdSourceLoadFail != null && undefined != this.developerCallback.onAdSourceLoadFail) {
+                this.developerCallback.onAdSourceLoadFail(placementId, errorInfo, callbackInfo);
+            }
+        },
+        onRewardedVideoAdAgainPlayStart: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayStart(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayStart != null && undefined != this.developerCallback.onRewardedVideoAdAgainPlayStart) {
+                this.developerCallback.onRewardedVideoAdAgainPlayStart(placementId, callbackInfo);
+            }
+        },
+        onRewardedVideoAdAgainPlayEnd: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayEnd(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayEnd != null && undefined != this.developerCallback.onRewardedVideoAdAgainPlayEnd) {
+                this.developerCallback.onRewardedVideoAdAgainPlayEnd(placementId, callbackInfo);
+            }
+        },
+        onRewardedVideoAdAgainPlayFailed: function (placementId, errorInfo, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayFailed(" + placementId + ", " + errorInfo + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayFailed != null && undefined != this.developerCallback.onRewardedVideoAdAgainPlayFailed) {
+                this.developerCallback.onRewardedVideoAdAgainPlayFailed(placementId, errorInfo, callbackInfo);
+            }
+        },
+        onRewardedVideoAdAgainPlayClicked: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayClicked(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onRewardedVideoAdAgainPlayClicked != null && undefined != this.developerCallback.onRewardedVideoAdAgainPlayClicked) {
+                this.developerCallback.onRewardedVideoAdAgainPlayClicked(placementId, callbackInfo);
+            }
+        },
+        onAgainReward: function (placementId, callbackInfo) {
+            ATJSSDK.printLog("ATRewardedVideoSDK.ATRewardedVideoListener.onAgainReward(" + placementId + ", " + callbackInfo + ")");
+            if (this.developerCallback != null && this.developerCallback.onAgainReward != null && undefined != this.developerCallback.onAgainReward) {
+                this.developerCallback.onAgainReward(placementId, callbackInfo);
+            }
+        }
+    },
+
+    loadRewardedVideo: function (placementId, settings = {}) {
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.loadRewardedVideo(placementId, JSON.stringify(settings));
+        } else {
+            log("You must run on Android or iOS.");
+        }
+    },
+
+    setAdListener: function (listener) {
+        var eventJSON = {};
+        eventJSON[LoadedCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdLoaded",
+            eventJSON[LoadFailCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdFailed",
+            eventJSON[PlayStartCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayStart",
+            eventJSON[PlayEndCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayEnd",
+            eventJSON[PlayFailCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayFailed",
+            eventJSON[CloseCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdClosed",
+            eventJSON[ClickCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdPlayClicked",
+            eventJSON[RewardCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onReward",
+            //added v5.8.10
+            eventJSON[BiddingAttempt] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceBiddingAttempt",
+            eventJSON[BiddingFilled] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceBiddingFilled",
+            eventJSON[BiddingFail] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceBiddingFail",
+            eventJSON[Attemp] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceAttemp",
+            eventJSON[LoadFilled] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceLoadFilled",
+            eventJSON[LoadFail] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAdSourceLoadFail",
+            //added v5.8.10 playAgain listener
+            eventJSON[AgainPlayStartCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayStart",
+            eventJSON[AgainPlayEndCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayEnd",
+            eventJSON[AgainPlayFailCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayFailed",
+            eventJSON[AgainClickCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onRewardedVideoAdAgainPlayClicked",
+            eventJSON[AgainRewardCallbackKey] = "ATRewardedVideoSDK.ATRewardedVideoListener.onAgainReward"
+
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.setAdListener(JSON.stringify(eventJSON));
+        } else {
+            log("You must run on Android or iOS.");
+        }
+
+        this.ATRewardedVideoListener.developerCallback = listener;
+    },
+
+    hasAdReady: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.hasAdReady(placementId);
+        } else {
+            log("You must run on Android or iOS.");
+        }
+        return false;
+    },
+
+    checkAdStatus: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            return platformBridge.checkAdStatus(placementId);
+        } else {
+            log("You must run on Android or iOS.");
+        }
+        return "";
+    },
+
+    showAd: function (placementId) {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.showAd(placementId);
+        } else {
+            log("You must run on Android or iOS.");
+        }
+    },
+
+    showAdInScenario: function (placementId, scenario = "") {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.showAdInScenario(placementId, scenario);
+        } else {
+            log("You must run on Android or iOS.");
+        }
+    },
+
+    entryAdScenario: function (placementId, scenario = "") {
+        if (undefined != platformBridge && platformBridge != null) {
+            platformBridge.entryAdScenario(placementId, scenario);
+        } else {
+            log("You must run on Android or iOS.");
+        }
+    },
+    testMethod : function(){
+        log("testing You must run on Android or iOS.");
+    }
+
+};
+
+const LoadedCallbackKey = "RewardedVideoLoaded";
+const LoadFailCallbackKey = "RewardedVideoLoadFail";
+const PlayStartCallbackKey = "RewardedVideoPlayStart";
+const PlayEndCallbackKey = "RewardedVideoPlayEnd";
+const PlayFailCallbackKey = "RewardedVideoPlayFail";
+const CloseCallbackKey = "RewardedVideoClose";
+const ClickCallbackKey = "RewardedVideoClick";
+const RewardCallbackKey = "RewardedVideoReward";
+
+const BiddingAttempt = "RewardedVideoBiddingAttempt";
+const BiddingFilled = "RewardedVideoBiddingFilled";
+const BiddingFail = "RewardedVideoBiddingFail";
+const Attemp = "RewardedVideoAttemp";
+const LoadFilled = "RewardedVideoLoadFilled";
+const LoadFail = "RewardedVideoLoadFail";
+
+const AgainPlayStartCallbackKey = "RewardedVideoAgainPlayStart";
+const AgainPlayEndCallbackKey = "RewardedVideoAgainPlayEnd";
+const AgainPlayFailCallbackKey = "RewardedVideoAgainPlayFail";
+const AgainClickCallbackKey = "RewardedVideoAgainClick";
+const AgainRewardCallbackKey = "RewardedVideoAgainReward";
+
+window["ATRewardedVideoSDK"] = ATRewardedVideoSDK;
+export default ATRewardedVideoSDK;

+ 9 - 0
assets/scripts/AnyThinkAds/ATRewardedVideoTSSDK.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "fbf571d2-00bf-4b20-a9d7-8c9702edb466",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 12 - 0
assets/scripts/AnyThinkAds/Android.meta

@@ -0,0 +1,12 @@
+{
+  "ver": "1.1.0",
+  "importer": "directory",
+  "imported": true,
+  "uuid": "1865500f-59d7-4a94-a080-70dae0ea3108",
+  "files": [],
+  "subMetas": {},
+  "userData": {
+    "compressionType": {},
+    "isRemoteBundle": {}
+  }
+}

+ 60 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidBannerTS.ts

@@ -0,0 +1,60 @@
+var classJavaName = "com/anythink/cocosjs/ATBannerJSBridge";
+export const ATAndroidBannerTS = {
+  
+    loadBanner : function (placementId, settings) {
+        cc.log("Android-loadBanner:" + settings);
+		jsb.reflection.callStaticMethod(classJavaName, "load", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, settings);
+    },
+
+    setAdListener : function (listener) {
+        cc.log("Android-setAdListener");
+		jsb.reflection.callStaticMethod(classJavaName, "setAdListener", "(Ljava/lang/String;)V", listener);
+    },
+
+    hasAdReady : function (placementId) {
+         cc.log("Android-hasAdReady");
+        return jsb.reflection.callStaticMethod(classJavaName, "isAdReady", "(Ljava/lang/String;)Z", placementId);;
+    },
+
+    checkAdStatus : function(placementId) {
+        cc.log("Android-checkAdStatus:" + placementId);
+        return jsb.reflection.callStaticMethod(classJavaName, "checkAdStatus", "(Ljava/lang/String;)Ljava/lang/String;", placementId);
+    },
+
+    showAdInPosition : function(placementId, position) {
+        cc.log("Android-showAdInPosistion");
+		jsb.reflection.callStaticMethod(classJavaName, "showWithPosition", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", placementId, position, "");
+    },
+
+    showAdInPositionAndScenario : function(placementId, position, scenario) {
+        cc.log("Android-showAdInPositionAndScenario");
+        jsb.reflection.callStaticMethod(classJavaName, "showWithPosition", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", placementId, position, scenario);
+    },
+
+    showAdInRectangle : function(placementId, showAdRect) {
+        cc.log("Android-showAdInRectangle");
+		jsb.reflection.callStaticMethod(classJavaName, "showWithRect", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", placementId, showAdRect, "");
+    },
+
+    showAdInRectangleAndScenario : function(placementId, showAdRect, scenario) {
+        cc.log("Android-showAdInRectangleAndScenario");
+        jsb.reflection.callStaticMethod(classJavaName, "showWithRect", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", placementId, showAdRect, scenario);
+    },
+    
+    removeAd : function(placementId) {
+         cc.log("Android-removeAd");
+		 jsb.reflection.callStaticMethod(classJavaName, "remove", "(Ljava/lang/String;)V", placementId);
+    },
+
+    reShowAd : function(placementId) {
+        cc.log("Android-reShowAd");
+		jsb.reflection.callStaticMethod(classJavaName, "reshow", "(Ljava/lang/String;)V", placementId);
+    },
+
+    hideAd : function(placementId) {
+         cc.log("Android-hideAd");
+		 jsb.reflection.callStaticMethod(classJavaName, "hide", "(Ljava/lang/String;)V", placementId);
+    }
+  
+};
+

+ 9 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidBannerTS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "7a4bc509-52b3-4357-859a-144d5ebdaf4f",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 50 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidIntersitialAutoTS.ts

@@ -0,0 +1,50 @@
+var classJavaName = "com/anythink/cocosjs/ATInterstitialAutoAdJSBridge";
+export const ATAndroidInterstitialAutoAdTS =  {
+  
+    setAdListener : function (listener) {
+        cc.log("Android-setAdListener");
+		jsb.reflection.callStaticMethod(classJavaName, "setAdListener", "(Ljava/lang/String;)V", listener);
+    },
+
+    addPlacementIds : function (placementIds) {
+        cc.log("Android-addPlacementIds");
+		jsb.reflection.callStaticMethod(classJavaName, "addPlacementIds", "(Ljava/lang/String;)V", placementIds);
+    },
+
+    removePlacementId : function (placementId) {
+        cc.log("Android-removePlacementId");
+		jsb.reflection.callStaticMethod(classJavaName, "removePlacementId", "(Ljava/lang/String;)V", placementId);
+    },
+
+    setAdExtraData : function (placementId, settings) {
+        cc.log("Android-setAdExtraData");
+		jsb.reflection.callStaticMethod(classJavaName, "setAdExtraData", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, settings);
+    },
+    
+    hasAdReady : function (placementId) {
+        cc.log("Android-hasAdReady");
+        return jsb.reflection.callStaticMethod(classJavaName, "isAdReady", "(Ljava/lang/String;)Z", placementId);
+    },
+
+    checkAdStatus : function(placementId) {
+        cc.log("Android-checkAdStatus:" + placementId);
+        return jsb.reflection.callStaticMethod(classJavaName, "checkAdStatus", "(Ljava/lang/String;)Ljava/lang/String;", placementId);
+    },
+
+    showAd : function(placementId) {
+        cc.log("Android-ivautoad_showAd:" + placementId);
+		jsb.reflection.callStaticMethod(classJavaName, "show", "(Ljava/lang/String;)V", placementId);
+    },
+
+    showAdInScenario : function(placementId, scenario) {
+        cc.log("Android-ivautoad_showAdInScenario:" + placementId + "---" + scenario);
+		jsb.reflection.callStaticMethod(classJavaName, "show", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, scenario);
+    },
+
+    entryAdScenario : function(placementId, scenario) {
+         cc.log("Android-entryAdScenario:" + placementId + "---" + scenario);
+		 jsb.reflection.callStaticMethod(classJavaName, "entryAdScenario", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, scenario);
+    }
+  
+};
+

+ 9 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidIntersitialAutoTS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "60335b40-2959-47ea-ad6a-e340d87b040a",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 39 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidIntersitialTS.ts

@@ -0,0 +1,39 @@
+var classJavaName = "com/anythink/cocosjs/ATInterstitialJSBridge";
+export const ATAndroidInterstitialJS = {
+	
+	loadInterstitial : function (placementId, settings) {
+        cc.log("Android-loadInterstitial");
+		jsb.reflection.callStaticMethod(classJavaName, "load", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, settings);
+    },
+
+    setAdListener : function (listener) {
+        cc.log("Android-setAdListener");
+		jsb.reflection.callStaticMethod(classJavaName, "setAdListener", "(Ljava/lang/String;)V", listener);
+    },
+
+    hasAdReady : function (placementId) {
+         cc.log("Android-hasAdReady");
+        return jsb.reflection.callStaticMethod(classJavaName, "isAdReady", "(Ljava/lang/String;)Z", placementId);
+    },
+
+    checkAdStatus : function(placementId) {
+        cc.log("Android-checkAdStatus:" + placementId);
+        return jsb.reflection.callStaticMethod(classJavaName, "checkAdStatus", "(Ljava/lang/String;)Ljava/lang/String;", placementId);
+    },
+
+    showAd : function(placementId) {
+        cc.log("Android-showAd:" + placementId);
+		jsb.reflection.callStaticMethod(classJavaName, "show", "(Ljava/lang/String;)V", placementId);
+    },
+
+    showAdInScenario : function(placementId, scenario) {
+         cc.log("Android-showAdInScenario:" + placementId + "---" + scenario);
+		 jsb.reflection.callStaticMethod(classJavaName, "show", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, scenario);
+    },
+
+    entryAdScenario : function(placementId, scenario) {
+         cc.log("Android-entryAdScenario:" + placementId + "---" + scenario);
+		 jsb.reflection.callStaticMethod(classJavaName, "entryAdScenario", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, scenario);
+    }
+
+};

+ 9 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidIntersitialTS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "8e692f0a-d161-4399-8b7e-bb5606b06aab",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 57 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidJS.ts

@@ -0,0 +1,57 @@
+var classJavaName = "com/anythink/cocosjs/ATJSBridge";
+export const ATAndroidJS = {
+    printJsLog : function(msg) {
+        if (undefined != msg && msg != null) {
+            jsb.reflection.callStaticMethod("android/util/Log", "i", "(Ljava/lang/String;Ljava/lang/String;)I", "AT-Cocos-JS", msg);
+        }
+    },
+
+    initSDK : function(appid, appkey) {
+        jsb.reflection.callStaticMethod(classJavaName, "initSDK", "(Ljava/lang/String;Ljava/lang/String;)V", appid, appkey);
+    },
+
+    initCustomMap : function(customMap) {      
+        jsb.reflection.callStaticMethod(classJavaName, "initCustomMap", "(Ljava/lang/String;)V", customMap);
+    },
+
+    setPlacementCustomMap : function(placmentId, customMap) {
+        jsb.reflection.callStaticMethod(classJavaName, "setPlacementCustomMap", "(Ljava/lang/String;Ljava/lang/String;)V", placmentId, customMap);
+    },
+
+    setGDPRLevel : function(level) {
+        jsb.reflection.callStaticMethod(classJavaName, "setGDPRLevel", "(I)V", level);
+    },
+
+    getGDPRLevel : function() {
+        return jsb.reflection.callStaticMethod(classJavaName, "getGDPRLevel", "()I");
+    },
+
+    getUserLocation : function(callbackMethod) {
+        jsb.reflection.callStaticMethod(classJavaName, "getUserLocation", "(Ljava/lang/String;)V", callbackMethod);
+    },
+
+    showGDPRAuth : function () {
+        jsb.reflection.callStaticMethod(classJavaName, "showGDPRAuth", "()V");
+    },
+
+    setLogDebug : function (debug) {
+        jsb.reflection.callStaticMethod(classJavaName, "setLogDebug", "(Z)V", debug);
+    },
+
+    deniedUploadDeviceInfo : function (deniedInfo) {
+        jsb.reflection.callStaticMethod(classJavaName, "deniedUploadDeviceInfo", "(Ljava/lang/String;)V", deniedInfo);
+    },
+
+    showDebuggerUI : function (debugKey) {
+        try {
+            jsb.reflection.callStaticMethod(classJavaName, "showDebuggerUI", "(Ljava/lang/String;)V", debugKey);
+        } catch (error) {
+            if (error instanceof Error) {
+                console.error(error.message);
+            } else {
+                console.error('unknown error', error);
+            }
+        }
+    }
+  
+};

+ 9 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidJS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "eb980e09-45cf-40be-b07b-c0bdcc001b2d",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 45 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidNativeTS.ts

@@ -0,0 +1,45 @@
+var classJavaName = "com/anythink/cocosjs/ATNativeJSBridge";
+export const ATAndroidNativeTS = {
+  
+    loadNative : function (placementId, settings) {
+        cc.log("Android-loadNative");
+		jsb.reflection.callStaticMethod(classJavaName, "load", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, settings);
+    },
+
+    setAdListener : function (listener) {
+        cc.log("Android-setAdListener");
+		jsb.reflection.callStaticMethod(classJavaName, "setAdListener", "(Ljava/lang/String;)V", listener);
+    },
+
+    hasAdReady : function (placementId) {
+         cc.log("Android-hasAdReady");
+        return jsb.reflection.callStaticMethod(classJavaName, "isAdReady", "(Ljava/lang/String;)Z", placementId);;
+    },
+
+    checkAdStatus : function(placementId) {
+        cc.log("Android-checkAdStatus:" + placementId);
+        return jsb.reflection.callStaticMethod(classJavaName, "checkAdStatus", "(Ljava/lang/String;)Ljava/lang/String;", placementId);
+    },
+
+    showAd : function(placementId, adViewProperty) {
+        cc.log("Android-showAd");
+		jsb.reflection.callStaticMethod(classJavaName, "show", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", placementId, adViewProperty, "");
+    },
+
+    showAdInScenario : function(placementId, adViewProperty, scenario) {
+        cc.log("Android-showAdInScenario");
+        jsb.reflection.callStaticMethod(classJavaName, "show", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", placementId, adViewProperty, scenario);
+    },
+
+    removeAd : function(placementId) {
+         cc.log("Android-removeAd");
+		 jsb.reflection.callStaticMethod(classJavaName, "remove", "(Ljava/lang/String;)V", placementId);
+    },
+
+    entryAdScenario : function(placementId, scenario) {
+         cc.log("Android-entryAdScenario:" + placementId + "---" + scenario);
+		 jsb.reflection.callStaticMethod(classJavaName, "entryAdScenario", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, scenario);
+    }
+  
+};
+

+ 9 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidNativeTS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "0302dcc9-da71-4ffd-800e-061e018cb9d8",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 50 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidRewardedVideoAutoTS.ts

@@ -0,0 +1,50 @@
+var classJavaName = "com/anythink/cocosjs/ATRewardedVideoAutoAdJSBridge";
+export const ATAndroidRewardedVideoAutoAdTS = {
+  
+    setAdListener : function (listener) {
+        cc.log("Android-setAdListener");
+		jsb.reflection.callStaticMethod(classJavaName, "setAdListener", "(Ljava/lang/String;)V", listener);
+    },
+
+    addPlacementIds : function (placementIds) {
+        cc.log("Android-addPlacementIds");
+		jsb.reflection.callStaticMethod(classJavaName, "addPlacementIds", "(Ljava/lang/String;)V", placementIds);
+    },
+
+    removePlacementId : function (placementId) {
+        cc.log("Android-removePlacementId");
+		jsb.reflection.callStaticMethod(classJavaName, "removePlacementId", "(Ljava/lang/String;)V", placementId);
+    },
+
+    setAdExtraData : function (placementId, settings) {
+        cc.log("Android-setAdExtraData");
+		jsb.reflection.callStaticMethod(classJavaName, "setAdExtraData", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, settings);
+    },
+
+    hasAdReady : function (placementId) {
+        cc.log("Android-hasAdReady");
+        return jsb.reflection.callStaticMethod(classJavaName, "isAdReady", "(Ljava/lang/String;)Z", placementId);
+    },
+
+    checkAdStatus : function(placementId) {
+        cc.log("Android-checkAdStatus:" + placementId);
+        return jsb.reflection.callStaticMethod(classJavaName, "checkAdStatus", "(Ljava/lang/String;)Ljava/lang/String;", placementId);
+    },
+
+    showAd : function(placementId) {
+        cc.log("Android-rvautoad_showAd:" + placementId);
+		jsb.reflection.callStaticMethod(classJavaName, "show", "(Ljava/lang/String;)V", placementId);
+    },
+
+    showAdInScenario : function(placementId, scenario) {
+        cc.log("Android-rvautoad_showAdInScenario:" + placementId + "---" + scenario);
+		jsb.reflection.callStaticMethod(classJavaName, "show", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, scenario);
+    },
+
+    entryAdScenario : function(placementId, scenario) {
+         cc.log("Android-entryAdScenario:" + placementId + "---" + scenario);
+		 jsb.reflection.callStaticMethod(classJavaName, "entryAdScenario", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, scenario);
+    }
+  
+};
+

+ 9 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidRewardedVideoAutoTS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "ac3b8f3e-3722-4633-be56-1028b46e88a9",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 39 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidRewardedVideoTS.ts

@@ -0,0 +1,39 @@
+var classJavaName = "com/anythink/cocosjs/ATRewardedVideoJSBridge";
+export const ATAndroidRewardedVideoJS = {
+  
+    loadRewardedVideo : function (placementId, settings) {
+        cc.log("Android-loadRewardedVideo");
+		jsb.reflection.callStaticMethod(classJavaName, "load", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, settings);
+    },
+
+    setAdListener : function (listener) {
+        cc.log("Android-setAdListener");
+		jsb.reflection.callStaticMethod(classJavaName, "setAdListener", "(Ljava/lang/String;)V", listener);
+    },
+
+    hasAdReady : function (placementId) {
+        cc.log("Android-hasAdReady");
+        return jsb.reflection.callStaticMethod(classJavaName, "isAdReady", "(Ljava/lang/String;)Z", placementId);
+    },
+
+    checkAdStatus : function(placementId) {
+        cc.log("Android-checkAdStatus:" + placementId);
+        return jsb.reflection.callStaticMethod(classJavaName, "checkAdStatus", "(Ljava/lang/String;)Ljava/lang/String;", placementId);
+    },
+
+    showAd : function(placementId) {
+        cc.log("Android-rv_showAd:" + placementId);
+		jsb.reflection.callStaticMethod(classJavaName, "show", "(Ljava/lang/String;)V", placementId);
+    },
+
+    showAdInScenario : function(placementId, scenario) {
+        cc.log("Android-rv_showAdInScenario:" + placementId + "---" + scenario);
+		jsb.reflection.callStaticMethod(classJavaName, "show", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, scenario);
+    },
+
+    entryAdScenario : function(placementId, scenario) {
+         cc.log("Android-entryAdScenario:" + placementId + "---" + scenario);
+		 jsb.reflection.callStaticMethod(classJavaName, "entryAdScenario", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, scenario);
+    }
+  
+};

+ 9 - 0
assets/scripts/AnyThinkAds/Android/ATAndroidRewardedVideoTS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "2cae312a-75f9-4fc5-a9ec-8682db98410b",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 12 - 0
assets/scripts/AnyThinkAds/iOS.meta

@@ -0,0 +1,12 @@
+{
+  "ver": "1.1.0",
+  "importer": "directory",
+  "imported": true,
+  "uuid": "ce821a4a-aa09-49c4-906d-1e16b9083ff2",
+  "files": [],
+  "subMetas": {},
+  "userData": {
+    "compressionType": {},
+    "isRemoteBundle": {}
+  }
+}

+ 59 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSBannerTS.ts

@@ -0,0 +1,59 @@
+import {ATiOSJS} from "./ATiOSJS";
+const OC_WRAPPER_CLASS = "ATBannerAdWrapper";
+export const ATiOSBannerJS = {
+    loadBanner: function(placementId, extra) {
+        ATiOSJS.printJsLog("ATiOSBannerJS::loadBanner(" + placementId + ", " + extra + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "loadBannerWithPlacementID:extra:", placementId, extra);
+    },
+
+    setAdListener : function (listener) {
+        ATiOSJS.printJsLog("ATiOSBannerJS::setAdListener(" + listener + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "setDelegates:", listener);
+    },
+  
+    hasAdReady : function(placementId) {
+        ATiOSJS.printJsLog("ATiOSBannerJS::hasAdReady(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "bannerReadyForPlacementID:", placementId);
+    },
+
+    checkAdStatus : function(placementId) {
+        ATiOSJS.printJsLog("ATiOSBannerJS::checkAdStatus(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "bannerCheckAdStatusForPlacementID:", placementId);
+    },
+
+    showAdInPosition : function(placementId, position) { 
+        ATiOSJS.printJsLog("ATiOSBannerJS::showAdInPosition(" + placementId + ", " + position + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "showBannerWithPlacementID:scene:position:", placementId, null, position);
+    },
+
+    showAdInPositionAndScenario : function(placementId, position, scenario) { 
+        ATiOSJS.printJsLog("ATiOSBannerJS::showAdInPositionAndScenario(" + placementId + ", " + position + ", " + scenario + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "showBannerWithPlacementID:scene:position:", placementId, scenario, position);
+    },
+
+    showAdInRectangle : function(placementId, showAdRect) {
+        ATiOSJS.printJsLog("ATiOSBannerJS::showAdInRectangle(" + placementId + ", " + showAdRect + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "showBannerWithPlacementID:scene:rect:", placementId, null, showAdRect);
+    },
+
+    showAdInRectangleAndScenario : function(placementId, showAdRect, scenario) {
+        ATiOSJS.printJsLog("ATiOSBannerJS::showAdInRectangleAndScenario(" + placementId + ", " + showAdRect + ", " + scenario + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "showBannerWithPlacementID:scene:rect:", placementId, scenario, showAdRect);
+    },
+
+    removeAd : function(placementId) {
+        ATiOSJS.printJsLog("ATiOSBannerJS::removeAd(" + placementId + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "removeAd:", placementId);
+    },
+
+    reShowAd : function(placementId) {
+        ATiOSJS.printJsLog("ATiOSBannerJS::reShowAd(" + placementId + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "reShowAd:", placementId);
+    },
+
+    hideAd : function(placementId) {
+        ATiOSJS.printJsLog("ATiOSBannerJS::hideAd(" + placementId + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "hideAd:", placementId);
+    }
+};
+

+ 9 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSBannerTS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "412af3c8-1678-431b-9b76-91b40f95282c",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 52 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSIntersitiaAutolTS.ts

@@ -0,0 +1,52 @@
+import {ATiOSJS} from "./ATiOSJS";
+const OC_WRAPPER_CLASS = "ATInterstitialAutoAdWrapper";
+export const ATiOSInterstitialAutoAdTS  = {
+
+    setAdListener : function (listener) {
+        ATiOSJS.printJsLog("ATiOSInterstitialAutoAdJS::setAdListener(" + listener + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "setDelegates:", listener);
+    },
+
+    setAdExtraData : function (placementId, extra) {
+        
+        ATiOSJS.printJsLog("ATiOSInterstitialAutoAdJS::setAdExtraData(" + placementId + ", " + extra + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "setAutoLocalExtra:customDataJSONString:", placementId, extra);
+    },   
+    
+    addPlacementIds : function (placementId) {
+        ATiOSJS.printJsLog("ATiOSInterstitialAutoAdJS::addPlacementIds(" + placementId + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "addAutoLoadAdPlacementID:", placementId);
+    },    
+
+    removePlacementId : function (placementId) {
+        ATiOSJS.printJsLog("ATiOSInterstitialAutoAdJS::removePlacementId(" + placementId + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "removeAutoLoadAdPlacementID:", placementId);
+    }, 
+
+    hasAdReady : function (placementId) {
+        ATiOSJS.printJsLog("ATiOSInterstitialAutoAdJS::hasAdReady(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "autoLoadInterstitialAdReadyForPlacementID:", placementId);
+    }, 
+
+    checkAdStatus : function (placementId) {
+        ATiOSJS.printJsLog("ATiOSInterstitialAutoAdJS::hasAdReady(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "checkAutoAdStatus:",placementId);
+    }, 
+
+    entryAdScenario : function(placementId, scenario) {
+        ATiOSJS.printJsLog("ATiOSInterstitialAutoAdJS::entryAdScenario(" + placementId  + ", " + scenario + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "entryAutoAdScenarioWithPlacementID:scenarioID:", placementId, scenario);
+    },
+
+
+    showAd : function(placementId) {
+        ATiOSJS.printJsLog("ATiOSInterstitialAutoAdJS::showAd(" + placementId + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "showAutoInterstitialAdWithPlacementID:scenarioID:", placementId, null);   
+    },
+
+    showAdInScenario : function(placementId, scenario) {
+        ATiOSJS.printJsLog("ATiOSInterstitialAutoAdJS::showAdInScenario(" + placementId  + ", " + scenario + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "showAutoInterstitialAdWithPlacementID:scenarioID:", placementId, scenario);
+    },
+
+};

+ 9 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSIntersitiaAutolTS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "a28a0c22-dc02-4d7d-96d2-607fe7c13260",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 45 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSIntersitialTS.ts

@@ -0,0 +1,45 @@
+import {ATiOSJS} from "./ATiOSJS";
+const OC_WRAPPER_CLASS = "ATInterstitialAdWrapper";
+export const ATiOSInterstitialJS =  {
+    loadInterstitial : function (placementId, extra) {
+        ATiOSJS.printJsLog("ATiOSInterstitialJS::loadInterstitial(" + placementId + ", " + extra + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "loadInterstitialWithPlacementID:extra:", placementId, extra);
+    },
+
+    setAdListener : function (listener) {
+        ATiOSJS.printJsLog("ATiOSInterstitialJS::setAdListener(" + listener + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "setDelegates:", listener);
+    },
+
+    hasAdReady : function (placementId) {
+        ATiOSJS.printJsLog("ATiOSInterstitialJS::hasAdReady(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "interstitialReadyForPlacementID:", placementId);
+    },
+
+    checkAdStatus : function (placementId) {
+        ATiOSJS.printJsLog("ATiOSInterstitialJS::checkAdStatus(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "checkAdStatus:", placementId);
+    },
+
+    setUserData : function (placementId, userId, userData) {
+         cc.log("Android-setUserData");
+    },
+
+    showAd : function(placementId) {
+        ATiOSJS.printJsLog("ATiOSInterstitialJS::showAd(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "showInterstitialWithPlacementID:scene:", placementId, null);
+        
+    },
+
+    showAdInScenario : function(placementId, scenario) {
+        ATiOSJS.printJsLog("ATiOSInterstitialJS::showAd(" + placementId  + ", " + scenario + ")");
+        return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "showInterstitialWithPlacementID:scene:", placementId, scenario);
+    },
+
+    entryAdScenario : function(placementId, scenario) {
+        ATiOSJS.printJsLog("ATiOSInterstitialJS::entryAdScenario(" + placementId  + ", " + scenario + ")");
+        return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "entryAdScenarioWithPlacementID:scene:", placementId, scenario);
+    } 
+  
+};
+

+ 9 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSIntersitialTS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "2035258b-052d-423e-9046-4dfd8975ae98",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 61 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSJS.ts

@@ -0,0 +1,61 @@
+const OC_ATSDK_MANAGER_CLASS = "ATSDKManager";
+const OC_BIRDGE_CLASS = "ATJSBridge";
+export const ATiOSJS = {
+    initSDK : function(appid, appkey) {
+        jsb.reflection.callStaticMethod(OC_ATSDK_MANAGER_CLASS, "startWithAppID:appKey:", appid, appkey);
+    },
+
+    initCustomMap : function(customMap) {
+        this.printJsLog("ATiOSJS::initCustomMap(" + customMap + ")");
+        jsb.reflection.callStaticMethod(OC_ATSDK_MANAGER_CLASS, "setCustomData:", customMap);
+    },
+
+    setPlacementCustomMap : function(placmentId, customMap) {
+        this.printJsLog("ATiOSJS::setPlacementCustomMap(" + placmentId + ", " + customMap + ")");
+        jsb.reflection.callStaticMethod(OC_ATSDK_MANAGER_CLASS, "setCustomData:forPlacementID:", customMap, placmentId);
+    },
+
+    setGDPRLevel : function(level) {
+        this.printJsLog("ATiOSJS::setGDPRLevel(" + level + ")");
+        jsb.reflection.callStaticMethod(OC_ATSDK_MANAGER_CLASS, "setDataConsent:", level);
+    },
+
+    getGDPRLevel : function() {
+        this.printJsLog("ATiOSJS::getGDPRLevel()");
+        return jsb.reflection.callStaticMethod(OC_ATSDK_MANAGER_CLASS, "dataConsent");
+    },
+
+    getUserLocation : function(callbackMethod) {
+        this.printJsLog("ATiOSJS::getUserLocation(" + callbackMethod + ")");
+        jsb.reflection.callStaticMethod(OC_ATSDK_MANAGER_CLASS, "getUserLocationWithCallback:", callbackMethod);
+    },
+
+    showGDPRAuth : function () {
+        this.printJsLog("ATiOSJS::showGDPRAuth()");
+        jsb.reflection.callStaticMethod(OC_ATSDK_MANAGER_CLASS, "presentDataConsentDialog");
+    },
+    
+    setLogDebug : function (debug) {
+        this.printJsLog("ATiOSJS::setLogDebug(" + debug + ")");
+        jsb.reflection.callStaticMethod(OC_ATSDK_MANAGER_CLASS, "setDebugLog:", debug);
+    },
+    
+     printJsLog : function(msg) {
+        console.log(msg);
+        if (undefined != msg && msg != null) {
+            jsb.reflection.callStaticMethod(OC_BIRDGE_CLASS, "log:", msg);
+        }
+    },
+
+    deniedUploadDeviceInfo : function (deniedInfo) {
+        this.printJsLog("ATiOSJS::deniedUploadDeviceInfo(" + deniedInfo + ")");
+        jsb.reflection.callStaticMethod(OC_ATSDK_MANAGER_CLASS, "deniedUploadDeviceInfo:", deniedInfo);
+    },
+
+    showDebuggerUI : function (debugKey) {
+        this.printJsLog("ATiOSJS::showDebuggerUI(" + debugKey + ")");
+        jsb.reflection.callStaticMethod(OC_ATSDK_MANAGER_CLASS, "showDebuggerUIWithDebugKey:", debugKey);
+    }
+  
+};
+

+ 9 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSJS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "31fec8b5-0bd7-4800-9284-cf405809060e",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 45 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSNativeTS.ts

@@ -0,0 +1,45 @@
+import {ATiOSJS} from "./ATiOSJS";
+const OC_WRAPPER_CLASS = "ATNativeAdWrapper";
+
+export const ATiOSNativeTS = {
+    loadNative : function(placementId, settings) {
+        ATiOSJS.printJsLog("ATiOSBannerJS::loadNative(" + placementId + ", " + settings + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "loadNativeWithPlacementID:extra:", placementId, settings);
+    },
+
+    setAdListener : function (listener) {
+        ATiOSJS.printJsLog("ATiOSNativeJS::setAdListener(" + listener + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "setDelegates:", listener);
+    },
+  
+    hasAdReady : function(placementId) {
+        ATiOSJS.printJsLog("ATiOSNativeJS::hasAdReady(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "nativeReadyForPlacementID:", placementId);
+    },
+
+    checkAdStatus : function(placementId) {
+        ATiOSJS.printJsLog("ATiOSNativeJS::checkAdStatus(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "nativeCheckAdStatusForPlacementID:", placementId);
+    },
+
+    showAd : function(placementId, adViewProperty) { 
+        ATiOSJS.printJsLog("ATiOSNativeJS::showAd(" + placementId + ", " + adViewProperty + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "showNativeWithPlacementID:scene:metrics:", placementId, null, adViewProperty);
+    },
+
+    showAdInScenario : function(placementId, adViewProperty, scenario) { 
+        ATiOSJS.printJsLog("ATiOSNativeJS::showAdInScenario(" + placementId + ", " + adViewProperty + ", " + scenario + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "showNativeWithPlacementID:scene:metrics:", placementId, scenario, adViewProperty);
+    },
+
+    removeAd : function(placementId) {
+        ATiOSJS.printJsLog("ATiOSNativeJS::removeAd(" + placementId + ")");
+        jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "removeNativeWithPlacementID:", placementId);
+    },
+    entryAdScenario : function(placementId, scenario) {
+        ATiOSJS.printJsLog("ATiOSInterstitialJS::entryAdScenario(" + placementId  + ", " + scenario + ")");
+        return jsb.reflection.callStaticMethod(OC_WRAPPER_CLASS, "entryAdScenarioWithPlacementID:scene:", placementId, scenario);
+    }
+};
+
+

+ 9 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSNativeTS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "cf899e90-f059-48db-bb6f-11534e1e9c09",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 53 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSRewardedAutoVideoTS.ts

@@ -0,0 +1,53 @@
+import {ATiOSJS} from "./ATiOSJS";
+const OC_RV_WRAPPER_CLASS = "ATRewardedVideoAutoAdWrapper";
+
+export const ATiOSRewardedVideoAutoAdJS =  {
+
+    setAdListener : function (listener) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoAutoAdJS::setAdListener(" + listener + ")");
+        jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "setDelegates:", listener);
+    },
+
+    setAdExtraData : function (placementId, extra) {
+
+        ATiOSJS.printJsLog("ATiOSRewardedVideoAutoAdJS::setAdExtraData(" + placementId + ", " + extra + ")");
+        jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "setAutoLocalExtra:customDataJSONString:", placementId, extra);
+    },   
+    
+    addPlacementIds : function (placementId) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoAutoAdJS::addPlacementIds(" + placementId + ")");
+        jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "addAutoLoadAdPlacementID:", placementId);
+    },    
+
+    removePlacementId : function (placementId) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoAutoAdJS::removePlacementId(" + placementId + ")");
+        jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "removeAutoLoadAdPlacementID:", placementId);
+    }, 
+
+    hasAdReady : function (placementId) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoAutoAdJS::hasAdReady(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "autoLoadRewardedVideoReadyForPlacementID:", placementId);
+    }, 
+
+    checkAdStatus : function (placementId) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoAutoAdJS::hasAdReady(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "checkAutoAdStatus:", placementId);
+    }, 
+    
+    entryAdScenario : function(placementId, scenario) {
+        ATiOSJS.printJsLog("ATiOSInterstitialAutoAdJS::entryAdScenario(" + placementId  + ", " + scenario + ")");
+        jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "entryAutoAdScenarioWithPlacementID:scenarioID:", placementId, scenario);
+    },
+
+    showAd : function(placementId) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoAutoAdJS::showAd(" + placementId + ")");
+        jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "showAutoRewardedVideoWithPlacementID:scenarioID:", placementId, null);   
+    },
+
+    showAdInScenario : function(placementId, scenario) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoAutoAdJS::showAdInScenario(" + placementId  + ", " + scenario + ")");
+        jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "showAutoRewardedVideoWithPlacementID:scenarioID:", placementId, scenario);
+    } 
+
+};
+

+ 9 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSRewardedAutoVideoTS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "a7353f39-3606-467c-b7b4-93bff59d6c24",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 45 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSRewardedVideoTS.ts

@@ -0,0 +1,45 @@
+import {ATiOSJS} from "./ATiOSJS";
+const OC_RV_WRAPPER_CLASS = "ATRewardedVideoWrapper";
+export const ATiOSRewardedVideoTS = {
+    loadRewardedVideo : function (placementId, extra) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoJS::loadRewardedVideo(" + placementId + ", " + extra + ")");
+        jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "loadRewardedVideoWithPlacementID:extra:", placementId, extra);
+    },
+
+    setAdListener : function (listener) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoJS::setAdListener(" + listener + ")");
+        jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "setDelegates:", listener);
+    },
+
+    hasAdReady : function (placementId) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoJS::hasAdReady(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "rewardedVideoReadyForPlacementID:", placementId);
+    },
+
+    checkAdStatus : function (placementId) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoJS::checkAdStatus(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "checkAdStatus:", placementId);
+    },
+
+    setUserData : function (placementId, userId, userData) {
+         cc.log("Android-setUserData");
+    },
+
+    showAd : function(placementId) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoJS::showAd(" + placementId + ")");
+        return jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "showRewardedVideoWithPlacementID:scene:", placementId, null);
+        
+    },
+
+    showAdInScenario : function(placementId, scenario) {
+        ATiOSJS.printJsLog("ATiOSRewardedVideoJS::showAdInScenario(" + placementId  + ", " + scenario + ")");
+        return jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "showRewardedVideoWithPlacementID:scene:", placementId, scenario);
+    },
+
+    entryAdScenario : function(placementId, scenario) {
+        ATiOSJS.printJsLog("ATiOSInterstitialJS::entryAdScenario(" + placementId  + ", " + scenario + ")");
+        return jsb.reflection.callStaticMethod(OC_RV_WRAPPER_CLASS, "entryAdScenarioWithPlacementID:scene:", placementId, scenario);
+    }
+  
+};
+

+ 9 - 0
assets/scripts/AnyThinkAds/iOS/ATiOSRewardedVideoTS.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "c735db9f-ac24-4289-aee6-6738dbf119bb",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 4 - 0
assets/scripts/game/data/localText.ts

@@ -6,6 +6,10 @@ export const localText = {
     textObj: localText_cn,
 
     init(lang?: string) {
+        
+        console.log("zh:多语言初始化", lang);
+
+        
         if (lang == "en") {
             this.textObj = localText_en;
         }

+ 1 - 1
assets/scripts/game/data/localText_en.ts

@@ -1,6 +1,6 @@
 
 // 英文
 export const localText_en = {
-    clickGameStart: "click game start",
+    clickGameStart: "click game start"
 }
 

+ 1 - 0
assets/scripts/game/view/GameContiueLayer.ts

@@ -14,6 +14,7 @@ export class GameContinueLayer extends BaseLayer {
     isShowBanner: boolean = false;
 
     onLoad() {
+        console.log('zh:gameContiueLayer.ts onload');
         super.onLoad();
 
         cocosUtil.tweenScaleBreath(this.getNodeByPath("btnNext"));

+ 217 - 1
assets/scripts/game/view/LevelLayer.ts

@@ -1,4 +1,4 @@
-import { find, instantiate, macro, Node, ScrollView, sp, Sprite, tween, Tween, UITransform, v2, _decorator } from 'cc';
+import { find, instantiate, macro, Node, ScrollView, sp, Sprite, tween, Tween, UITransform, v2, _decorator ,sys} from 'cc';
 import { BaseLayer } from '../../common/BaseLayer';
 import { cocosUtil } from '../../utils/cocosUtil';
 import { utilTools } from '../../utils/utilTools';
@@ -14,11 +14,28 @@ import { playerModel } from '../model/playerModel';
 import { FlutterEffect } from './effect/FlutterEffect';
 import { ReelEffect } from './effect/ReelEffect';
 import { FightLayer } from './FightLayer';
+
+
+
+import ATRewardedVideoSDK from "../../AnyThinkAds/ATRewardedVideoTSSDK"
+import AAJS2 from "../../utils/ATAndroidJS2";
+import ATJSSDK from "../../AnyThinkAds/ATJSSDK";
+//import { EncryptUtil } from '../../utils/EncryptUtil';
+//import AESUtil from "../../utils/AESUtil";
+import GlobalManager from '../../utils/GlobalManager';
+
 const { ccclass, property } = _decorator;
 
 @ccclass('LevelLayer')
 export class LevelLayer extends BaseLayer {
 
+    /**
+     * AD播放完毕标识
+     */
+    private adPalyOverEve_ = 'adPalyOverEve';
+    //AD播放完毕后需要进行什么奖励的标记,如:fuHuo等,启用游戏的时候需要清空该KEY
+    private yxAdMark = 'yxAdMark';
+
     listScrollView: ScrollView;
     listContentLayer: Node;
     levelLayer: Node;
@@ -41,6 +58,7 @@ export class LevelLayer extends BaseLayer {
     cloundLayer2: Node;
 
     onLoad() {
+        console.log("zh:LevelLayer onLoad");
         super.onLoad();
 
         this.getNodeByPath("cloundLayer").addComponent(FlutterEffect);
@@ -75,8 +93,103 @@ export class LevelLayer extends BaseLayer {
 
         this.initUI();
 
+      //  this.initAd();
+       // this.initAdForPage();
+
+    }
+
+       /**
+     * 初始化AD
+     */
+       initAd() {
+
+        //1、清理AD奖励标记
+        sys.localStorage.removeItem('yxAdMark')
+
+        console.log("zh:initAd start");
+        // // 初始化SDK  
+        //ATJSSDK.initSDK("h67122e47607cd", "a4fd9a23bdd71c2314cf41140a77abb1e");//这是cccc线上的
+        ATJSSDK.initSDK("h67370c81d408e", "a0c9895b9687e4978a3ed2f2c0f441633");//正式的
+        ATJSSDK.setLogDebug(true);
+        // // 针对欧盟地区初始化时做的处理,按需求打开,不在欧盟地区发布的不用使用。
+        ATJSSDK.getUserLocation(function (userLocation) {
+            //如果处于欧盟地区且等级是UNKNOW时,就执行授权弹窗
+            if (userLocation === ATJSSDK.kATUserLocationInEU) {
+                if (ATJSSDK.getGDPRLevel() === ATJSSDK.UNKNOWN) {
+                    ATJSSDK.showGDPRAuth();
+                }
+            }
+        });
+        //var state = false;
+        ATRewardedVideoSDK.setAdListener(this);
+        if (sys.os === sys.OS.ANDROID) {
+            let deviceId = AAJS2.getDeviceUserId();
+            //console.log("checkstatus:",ATRewardedVideoSDK.checkAdStatus(AAJS2.getPlacementId()));
+            var setting = {};
+            setting[ATRewardedVideoSDK.userIdKey] = deviceId;
+            ATRewardedVideoSDK.loadRewardedVideo(AAJS2.getPlacementId(), setting);
+        }
+
+        if (sys.platform == sys.Platform.ANDROID) {
+            setTimeout(() => {
+                var allInfo = AAJS2.allInfo();
+                console.log('zh:allInfo=' + allInfo)
+                let key = "US2%*c3lv8sYkUe(!e-6g$E*RJg)dzn@";
+                let iv = "Jn0.aWsOu$y-Dbqb";
+
+                // let data = { data: AESUtil.AESencrypt(allInfo, key, iv) };
+                // ATSDK.printLog("zh:allInfo-jm=" + JSON.stringify(data));
+                // console.log('zh:ad_allInfo', data);
+                // AAJS2.makePostRequestWithXhr(JSON.stringify(data));
+
+
+                // let data = { data: EncryptUtil.aesEncrypt(allInfo, key, iv) };
+                // console.log("zh:allInfo jm=" + JSON.stringify(data));
+                // AAJS2.makePostRequestWithXhr(JSON.stringify(data));
+            }, 300);
+        }
+        console.log("zh:initAd end");
+    }
+
+
+
+    initAdForPage() {
+        if (sys.isNative && sys.platform === sys.Platform.ANDROID) {
+            let deviceId = AAJS2.getDeviceUserId();
+            console.log("zh:checkstatus:", ATRewardedVideoSDK.checkAdStatus(AAJS2.getPlacementId()));
+            var setting = {};
+            setting[ATRewardedVideoSDK.userIdKey] = deviceId;
+            ATRewardedVideoSDK.loadRewardedVideo(AAJS2.getPlacementId(), setting);
+        }
     }
 
+
+
+
+    
+
+    /**
+     * AD播放完毕的事件处理
+     */
+    handleCustomEvent() {
+        console.log('zh:00收到发送的事件')
+        let adKey = "zh_ad_type"
+        let idx =sys.localStorage.getItem(adKey);//0,1,2,3 
+        console.log('zh:onAdOverEve idx =' + idx)
+        switch (idx) {
+            case '1':
+                console.log('zh:开始使用消除道具')
+                GlobalManager.getInstance().callMethod('event_AddChanceRevive_util');
+                break;        
+            default:
+                console.log('zh:未知的道具类型AD' + idx)
+        }
+        sys.localStorage.setItem(adKey, '');
+    }
+
+
+
+
     onEnable() {
         this.addEventArr([
             msgac.levelRestart,
@@ -522,5 +635,108 @@ export class LevelLayer extends BaseLayer {
         this.closeLayer();
     }
 
+
+
+
+    
+    //#region 'ad'
+
+
+    onRewardedVideoAdLoaded(placementId) {
+        console.log("zh:onRewardedVideoAdLoaded", placementId, "", "")
+    }
+
+    onRewardedVideoAdFailed(placementId, errorInfo) {
+        console.log("zh:onRewardedVideoAdFailed", placementId, "", errorInfo)
+    }
+
+    onRewardedVideoAdPlayStart(placementId, callbackInfo) {
+        console.log("zh:onRewardedVideoAdPlayStart", placementId, callbackInfo, "")
+        let deviceId = AAJS2.getDeviceUserId();
+        var setting = {};
+        setting[ATRewardedVideoSDK.userIdKey] = deviceId;
+        ATRewardedVideoSDK.loadRewardedVideo(AAJS2.getPlacementId(), setting);
+    }
+
+    onRewardedVideoAdPlayEnd(placementId, callbackInfo) {
+        console.log("zh:onRewardedVideoAdPlayEnd", placementId, callbackInfo, "")
+
+
+        console.log('zh: ad over 开始发送事件11')
+        //this.node.emit("handleCustomEvent");
+        this.handleCustomEvent()
+        console.log('zh: ad over 开始发送事件OVER22')
+
+
+
+    }
+
+    onRewardedVideoAdPlayFailed(placementId, errorInfo, callbackInfo) {
+        console.log("zh:onRewardedVideoAdPlayFailed", placementId, callbackInfo, errorInfo)
+    }
+    onRewardedVideoAdClosed(placementId, callbackInfo) {
+        console.log("zh:onRewardedVideoAdClosed", placementId, callbackInfo, "")
+
+
+    }
+
+    onRewardedVideoAdPlayClicked(placementId, callbackInfo) {
+        console.log("zh:onRewardedVideoAdPlayClicked", placementId, callbackInfo, "")
+    }
+
+    onReward(placementId, callbackInfo) {
+        //this.state = true;
+    }
+    //Callbacks added v5.8.10
+    onAdSourceBiddingAttempt(placementId, callbackInfo) {
+        console.log("zh:onAdSourceBiddingAttempt", placementId, callbackInfo, "")
+    }
+
+    onAdSourceBiddingFilled(placementId, callbackInfo) {
+        console.log("zh:onAdSourceBiddingFilled", placementId, "", "")
+    }
+
+    onAdSourceBiddingFail(placementId, errorInfo, callbackInfo) {
+        console.log("zh:onAdSourceBiddingFail", placementId, callbackInfo, errorInfo)
+    }
+
+    onAdSourceAttempt(placementId, callbackInfo) {
+        console.log("zh:onAdSourceAttempt", placementId, callbackInfo, "")
+    }
+
+    onAdSourceLoadFilled(placementId, callbackInfo) {
+        console.log("zh:onAdSourceLoadFilled", placementId, callbackInfo, "")
+    }
+
+    onAdSourceLoadFail(placementId, errorInfo, callbackInfo) {
+        console.log("zh:onAdSourceLoadFail", placementId, callbackInfo, errorInfo)
+    }
+
+    onRewardedVideoAdAgainPlayStart(placementId, callbackInfo) {
+        console.log("zh:onRewardedVideoAdAgainPlayStart", placementId, callbackInfo, "")
+
+    }
+
+    onRewardedVideoAdAgainPlayEnd(placementId, callbackInfo) {
+        console.log("zh:onRewardedVideoAdAgainPlayEnd", placementId, callbackInfo, "")
+    }
+
+    onRewardedVideoAdAgainPlayFailed(placementId, errorInfo, callbackInfo) {
+        console.log("zh:onRewardedVideoAdAgainPlayFailed", placementId, callbackInfo, errorInfo)
+    }
+
+    onRewardedVideoAdAgainPlayClicked(placementId, callbackInfo) {
+        console.log("zh:onRewardedVideoAdAgainPlayClicked", placementId, callbackInfo, "")
+    }
+
+    onAgainReward(placementId, callbackInfo) {
+        console.log("zh:onAgainReward", placementId, callbackInfo, "")
+      
+    }
+
+
+
+    //#endregion
+
 }
 

+ 255 - 0
assets/scripts/utils/ATAndroidJS2.ts

@@ -0,0 +1,255 @@
+declare const jsb: any;
+const classJavaName = "org/cocos2dx/javascript/cocosjs/ATJSBridge";
+const classJavaParamName = "com/cocos/service/SDKWrapper";
+const Cocos2dxHelper = "org/cocos2dx/lib/Cocos2dxHelper";
+
+
+// const classJavaName = "org/cocos2dx/javascript/cocosjs/ATJSBridge";
+// const classJavaParamName = "org/cocos2dx/javascript/AppActivity";
+// const Cocos2dxHelper = "org/cocos2dx/lib/Cocos2dxHelper";
+
+/**
+ * 正式的,大螺丝
+ */
+const placementID = "n67370cb775887";
+/**
+ * 测试专用n6729e95f588aa    n66f7c61b71d4c   
+ */
+const testPlacementID = "n6729e95f588aa";
+/**
+ * 打砖块的
+ */
+const testPlacementIDForDzk = "n67122e8932a3d";
+
+
+
+interface ATAndroidJS {
+    getDeviceModel(): string;
+    getSystemVersion(): string;
+    getDeviceManufacturer(): string;
+    getCurrentLocale(): string;
+    getTimeZone(): string;
+    getCountry(): string;
+    getMediaType(): string;
+    getDeviceId(): string;
+    getVersionCode(): string;
+    getVersionName(): string;
+    getPackageName(): string;
+    getAppInstall(): string;
+    getAppInstandId(): string;
+    printJsLog(msg: string): void;
+    initSDK(appid: string, appkey: string): void;
+    initCustomMap(customMap: string): void;
+    setPlacementCustomMap(placementId: string, customMap: string): void;
+    setGDPRLevel(level: number): void;
+    getGDPRLevel(): number;
+    getUserLocation(callbackMethod: string): void;
+    showGDPRAuth(): void;
+    setLogDebug(debug: boolean): void;
+    deniedUploadDeviceInfo(deniedInfo: string): void;
+    allInfo():string;
+    makePostRequestWithXhr: (data: string) => void;
+    getLanguage():string;
+    getInstanceId():string;
+    getInfomation():string;
+    getAdId(): string;
+    getDeviceUserId():string;
+    getPlacementId():string;
+    getUserAgent():string;
+    getBuildId():string;
+    getDeviceHardWare():string;
+    getScreenResolution():string;
+    getScreenDenstiy():string;
+    getNetworkType():string;
+    getSdkApi():string;
+    getDeviceBRAND():string;
+}
+
+
+
+const ATAndroidJS: ATAndroidJS = {
+    getDeviceModel: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getDeviceModel", "()Ljava/lang/String;");
+    },
+    getSystemVersion: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getOSVersion", "()Ljava/lang/String;");
+    },
+    getDeviceManufacturer: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getDeviceManufacturer", "()Ljava/lang/String;");
+    },
+    getCurrentLocale: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getCurrentLocale", "()Ljava/lang/String;");
+    },
+    getTimeZone: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getTimeZone", "()Ljava/lang/String;");
+    },
+    getCountry: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getCountry", "()Ljava/lang/String;");
+    },
+    getMediaType: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getMediaType", "()Ljava/lang/String;");
+    },
+    getDeviceId: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getAndroidId", "()Ljava/lang/String;");
+    },
+    getVersionCode: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getVersionCode", "()Ljava/lang/String;");
+    },
+    getVersionName: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getVersionName", "()Ljava/lang/String;");
+    },
+    getPackageName: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getPackageName", "()Ljava/lang/String;");
+    },
+    getAppInstall: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getAppInstall", "()Ljava/lang/String;");
+    },
+    getAppInstandId: function () {
+       // return jsb.reflection.callStaticMethod(classJavaParamName, "getInstanceId", "()Ljava/lang/String;");
+       return jsb.reflection.callStaticMethod(classJavaParamName, "getInstanceIds", "()Ljava/lang/String;");
+    },
+    getUserAgent: function(){
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getUserAgent", "()Ljava/lang/String;");
+    },
+    getScreenResolution: function (){
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getScreenResolution", "()Ljava/lang/String;");
+    },
+    getScreenDenstiy: function(){
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getScreenDenstiy", "()Ljava/lang/String;");
+    },
+    getNetworkType: function(){
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getNetworkType", "()Ljava/lang/String;");
+    },
+    getDeviceHardWare: function (){
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getDeviceHardware", "()Ljava/lang/String;");
+    },
+    getDeviceBRAND: function(){
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getDeviceBRAND", "()Ljava/lang/String;");
+    },
+    getSdkApi: function(){
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getSdkApi", "()Ljava/lang/String;");
+    },
+    printJsLog: function (msg: string) {
+        if (msg !== undefined && msg !== null) {
+            jsb.reflection.callStaticMethod("android/util/Log", "i", "(Ljava/lang/String;Ljava/lang/String;)I", "AT-Cocos-JS", msg);
+        }
+    },
+    initSDK: function (appid: string, appkey: string) {
+        jsb.reflection.callStaticMethod(classJavaParamName, "initSDK", "(Ljava/lang/String;Ljava/lang/String;)V", appid, appkey);
+    },
+    initCustomMap: function (customMap: string) {
+        jsb.reflection.callStaticMethod(classJavaParamName, "initCustomMap", "(Ljava/lang/String;)V", customMap);
+    },
+    setPlacementCustomMap: function (placementId: string, customMap: string) {
+        jsb.reflection.callStaticMethod(classJavaParamName, "setPlacementCustomMap", "(Ljava/lang/String;Ljava/lang/String;)V", placementId, customMap);
+    },
+    setGDPRLevel: function (level: number) {
+        jsb.reflection.callStaticMethod(classJavaParamName, "setGDPRLevel", "(I)V", level);
+    },
+    getGDPRLevel: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getGDPRLevel", "()I");
+    },
+    getUserLocation: function (callbackMethod: string) {
+        jsb.reflection.callStaticMethod(classJavaParamName, "getUserLocation", "(Ljava/lang/String;)V", callbackMethod);
+    },
+    showGDPRAuth: function () {
+        jsb.reflection.callStaticMethod(classJavaParamName, "showGDPRAuth", "()V");
+    },
+    setLogDebug: function (debug: boolean) {
+        jsb.reflection.callStaticMethod(classJavaParamName, "setLogDebug", "(Z)V", debug);
+    },
+    deniedUploadDeviceInfo: function (deniedInfo: string) {
+        jsb.reflection.callStaticMethod(classJavaParamName, "deniedUploadDeviceInfo", "(Ljava/lang/String;)V", deniedInfo);
+    },
+    getLanguage: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getLanguage", "()Ljava/lang/String;");
+    },
+    getInstanceId: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getInstanceIds", "()Ljava/lang/String;");
+    },
+    getInfomation: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getInfos", "()Ljava/lang/String;");
+    },
+    getBuildId: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getBuildId", "()Ljava/lang/String;");
+    },
+    getAdId: function () {
+        return jsb.reflection.callStaticMethod(classJavaParamName, "getAdId", "()Ljava/lang/String;");
+    },
+    getPlacementId: function(){
+          return placementID;
+        // return testPlacementID;
+         // return testPlacementIDForDzk;
+    },
+    
+    
+    /**
+     * 本类封装了获取设备所有信息的方法,返回一个json字符串
+     * @returns json string
+     */
+    allInfo:function() {
+        const info = {
+            systemVersion: this.getSystemVersion(),
+            deviceModel: this.getDeviceModel(),
+            deviceManufacturer: this.getDeviceManufacturer(),
+            country: this.getCountry(),
+            timeZone: this.getTimeZone(),
+            device: this.getDeviceId(),
+            platform: 'Android',
+            language: this.getLanguage(),
+            versionCode: this.getVersionCode(),
+            versionName: this.getVersionName(),
+            packageName: this.getPackageName(),
+            adId: this.getAdId(),
+            information: this.getInfomation(),
+            appInstantsId: this.getAppInstandId(),
+            mediaType: this.getMediaType(),
+            userIp: '',
+            gameId: '22',
+            userAgent: this.getUserAgent(),
+            buildId: this.getBuildId(),
+            deviceHardware: this.getDeviceHardWare(),
+            screenResolution: this.getScreenResolution(),
+            screenDenstiy: this.getScreenDenstiy(),
+            networkType: this.getNetworkType(),
+            sdkApi: this.getSdkApi(),
+            deviceBrand: this.getDeviceBRAND()
+        };
+        return JSON.stringify(info);
+       
+    },
+    getDeviceUserId: function(){
+        return this.getDeviceId()
+    },
+  
+
+    /**
+     * 发送HTTP数据到服务器
+     * @param data 
+     */
+    makePostRequestWithXhr:function( data: string) {
+        var url="https://screwapi.gamefunserver.com/api/game/postData";
+        var xhr = new XMLHttpRequest();
+        xhr.open('POST', url, true); // 第三个参数表示异步执行
+        xhr.setRequestHeader('Content-Type', 'application/json');
+        // 定义请求成功时的回调函数
+        xhr.onload = function () {
+            if (xhr.status >= 200 && xhr.status < 300) {
+                console.log('请求成功:', xhr.responseText);
+                //ATSDK.printLog("zhangsan:请求成功="+xhr.responseText);
+            } else {
+                  console.error('请求失败: ' + xhr.status);
+               // ATSDK.printLog("zhangsan:请求失败="+xhr.status);
+            }
+        };
+        xhr.onerror = function () {
+            console.error('网络请求发生错误');
+           // ATSDK.printLog("zhangsan:网络请求发生错误");    
+        };
+       // var data = JSON.stringify({ key1: 'value1', key2: 'value2' });
+        xhr.send(data); 
+    }
+    
+};
+
+export default ATAndroidJS;

+ 9 - 0
assets/scripts/utils/ATAndroidJS2.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "278d4193-e7f7-4c9a-99bc-eaacbba62975",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}

+ 63 - 0
assets/scripts/utils/GlobalManager.ts

@@ -0,0 +1,63 @@
+// import { _decorator, Component } from 'cc';
+// const { ccclass } = _decorator;
+import {_decorator ,sys} from 'cc';
+const { ccclass, property } = _decorator;
+
+
+@ccclass('GlobalManager')
+export default class GlobalManager {
+    private static instance: GlobalManager;
+    private methodMap: Map<string, Function>;
+
+    // 禁止外部 new 实例化
+    private constructor() {
+        this.methodMap = new Map();
+    }
+
+    // 获取单例实例
+    public static getInstance(): GlobalManager {
+        if (!GlobalManager.instance) {
+            GlobalManager.instance = new GlobalManager();
+        }
+        return GlobalManager.instance;
+    }
+
+    // 注册全局方法
+    public registerMethod(name: string, method: Function): void {
+        if (typeof method !== 'function') {
+            console.error(`zh:尝试注册的 ${name} 不是一个函数`);
+            return;
+        }
+        if (this.methodMap.has(name)) {
+            console.warn(`zh:方法 ${name} 已经存在,正在覆盖`);
+        }
+        this.methodMap.set(name, method);
+        console.log(`zh:成功注册全局方法 ${name}`);
+    }
+
+    // 调用全局方法
+    public callMethod(name: string, ...args: any[]): any {
+        const method = this.methodMap.get(name);
+        if (method) {
+            console.log(`zh:调用全局方法 ${name}`);
+            return method(...args);
+        } else {
+            console.error(`zh:全局方法 Method ${name} not found`);
+        }
+    }
+}
+
+
+//GlobalManager_1.default.instance.callMethod('env_playAdEnd');
+
+
+//GlobalManager_1.default.instance.registerMethod('env_playAdEnd', this.utilForAd);
+
+
+// // 注册方法
+// GlobalManager.getInstance().registerMethod('sayHello', (name: string) => {
+//     console.log(`Hello, ${name}`);
+// });
+
+// // 调用方法
+// GlobalManager.getInstance().callMethod('sayHello', 'World');

+ 9 - 0
assets/scripts/utils/GlobalManager.ts.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "4.0.23",
+  "importer": "typescript",
+  "imported": true,
+  "uuid": "2f2c92fa-c98a-4e12-8e14-7878b4445ba6",
+  "files": [],
+  "subMetas": {},
+  "userData": {}
+}