| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  | using System.Collections; | 
					
						
							|  |  |  | using System.Collections.Generic; | 
					
						
							| 
									
										
										
										
											2025-09-01 10:32:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  | using UnityEngine; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-09-01 10:32:50 +00:00
										 |  |  | namespace WZ | 
					
						
							| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  | { | 
					
						
							|  |  |  |     public struct AdPriceInfo | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         public double MaxPrice; | 
					
						
							|  |  |  |         public double AdmobPrice; | 
					
						
							|  |  |  |         public double BigoPrice; | 
					
						
							| 
									
										
										
										
											2025-08-31 07:12:52 +00:00
										 |  |  |         public double KwaiPrice; | 
					
						
							| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  |         public string ToponAdUnitId; | 
					
						
							|  |  |  |          | 
					
						
							| 
									
										
										
										
											2025-08-31 07:12:52 +00:00
										 |  |  |         public AdPriceInfo(double maxPrice, double admobPrice, double bigoPrice, double kwaiPrice,string toponAdUnitId) | 
					
						
							| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  |         { | 
					
						
							|  |  |  |             MaxPrice = maxPrice; | 
					
						
							|  |  |  |             AdmobPrice = admobPrice; | 
					
						
							|  |  |  |             BigoPrice = bigoPrice; | 
					
						
							| 
									
										
										
										
											2025-08-31 07:12:52 +00:00
										 |  |  |             KwaiPrice = kwaiPrice; | 
					
						
							| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  |             ToponAdUnitId = toponAdUnitId; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     public static class AdsBidResult | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         private static object m_toponObj = "m_toponObj"; | 
					
						
							|  |  |  |         private static object m_maxObj = "m_maxObj"; | 
					
						
							|  |  |  |         private static object m_admobObj = "m_admobObj"; | 
					
						
							|  |  |  |         private static object m_bigoObj = "m_bigoObj"; | 
					
						
							| 
									
										
										
										
											2025-08-31 07:12:52 +00:00
										 |  |  |         private static object m_kwaiObj = "m_kwaiObj"; | 
					
						
							| 
									
										
										
										
											2025-08-31 05:15:14 +00:00
										 |  |  |         public static PlatformType GetPlatformType(AdPriceInfo priceInfo) | 
					
						
							| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  |         { | 
					
						
							|  |  |  | #if UNITY_ANDROID && !UNITY_EDITOR | 
					
						
							|  |  |  |             using (AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) | 
					
						
							|  |  |  |             { | 
					
						
							|  |  |  |                 AndroidJavaObject activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity"); | 
					
						
							|  |  |  |                 AndroidJavaObject toponCustomContentInfo = new AndroidJavaObject("com.anythink.core.api.ATCustomContentInfo", priceInfo.ToponAdUnitId, m_toponObj); | 
					
						
							|  |  |  |                 AndroidJavaObject admobCustomContentInfo = new AndroidJavaObject("com.anythink.core.api.ATCustomContentInfo", priceInfo.AdmobPrice * 1000, m_admobObj); | 
					
						
							|  |  |  |                 AndroidJavaObject maxCustomContentInfo = new AndroidJavaObject("com.anythink.core.api.ATCustomContentInfo", priceInfo.MaxPrice * 1000, m_maxObj); | 
					
						
							|  |  |  |                 AndroidJavaObject bigoCustomContentInfo = new AndroidJavaObject("com.anythink.core.api.ATCustomContentInfo", priceInfo.BigoPrice * 1000, m_bigoObj); | 
					
						
							| 
									
										
										
										
											2025-08-31 07:12:52 +00:00
										 |  |  |                 AndroidJavaObject kwaiCustomContentInfo = new AndroidJavaObject("com.anythink.core.api.ATCustomContentInfo", priceInfo.KwaiPrice * 1000, m_kwaiObj); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 AndroidJavaObject atCustomContentInfoList = new AndroidJavaObject("java.util.ArrayList"); | 
					
						
							|  |  |  |                 atCustomContentInfoList.Call<bool>("add", toponCustomContentInfo); | 
					
						
							|  |  |  |                 atCustomContentInfoList.Call<bool>("add", admobCustomContentInfo); | 
					
						
							|  |  |  |                 atCustomContentInfoList.Call<bool>("add", maxCustomContentInfo); | 
					
						
							|  |  |  |                 atCustomContentInfoList.Call<bool>("add", bigoCustomContentInfo); | 
					
						
							| 
									
										
										
										
											2025-08-31 07:12:52 +00:00
										 |  |  |                 atCustomContentInfoList.Call<bool>("add", kwaiCustomContentInfo); | 
					
						
							| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |                 AndroidJavaClass sdkGlobalSetting = new AndroidJavaClass("com.anythink.core.api.ATSDKGlobalSetting"); | 
					
						
							|  |  |  |                 AndroidJavaObject maxPriceCustomContentInfo = sdkGlobalSetting.CallStatic<AndroidJavaObject>("customContentReviewResult", atCustomContentInfoList); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 string customContentString = maxPriceCustomContentInfo.Get<string>("customContentString"); | 
					
						
							|  |  |  |                 double customContentDouble = maxPriceCustomContentInfo.Get<double>("customContentDouble"); | 
					
						
							|  |  |  |                 AndroidJavaObject customContentObject = maxPriceCustomContentInfo.Get<AndroidJavaObject>("customContentObject"); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |                 string customContentObjectString = customContentObject != null ? customContentObject.Call<string>("toString") : "null"; | 
					
						
							| 
									
										
										
										
											2025-08-31 07:12:52 +00:00
										 |  |  |                 LoggerUtils.Debug("[AdsBidResult] maxPrice: " + priceInfo.MaxPrice * 1000 + " bigoPrice: " + priceInfo.BigoPrice * 1000 + " admobPrice: " + priceInfo.AdmobPrice * 1000 + " kwaiPrice: " + priceInfo.KwaiPrice * 1000 + " toponAdUnitId: " + priceInfo.ToponAdUnitId); | 
					
						
							| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  |                 LoggerUtils.Debug("[AdsBidResult] final maxPriceCustomContentInfo: " + customContentString + " double: " + customContentDouble + " object:" + customContentObjectString); | 
					
						
							|  |  |  |                 if (customContentObjectString.Equals(m_toponObj)) | 
					
						
							|  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2025-09-01 08:14:50 +00:00
										 |  |  |                     return PlatformType.Topon; | 
					
						
							| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  |                 } | 
					
						
							|  |  |  |                 else if (customContentObjectString.Equals(m_maxObj)) | 
					
						
							|  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2025-09-01 08:14:50 +00:00
										 |  |  |                     return PlatformType.AppLovin; | 
					
						
							| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  |                 } | 
					
						
							|  |  |  |                 else if (customContentObjectString.Equals(m_admobObj)) | 
					
						
							|  |  |  |                 { | 
					
						
							|  |  |  |                     return PlatformType.Admob; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |                 else if (customContentObjectString.Equals(m_bigoObj)) | 
					
						
							|  |  |  |                 { | 
					
						
							|  |  |  |                     return PlatformType.Bigo; | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2025-08-31 07:12:52 +00:00
										 |  |  |                 else if (customContentObjectString.Equals(m_kwaiObj)) | 
					
						
							|  |  |  |                 {  | 
					
						
							|  |  |  |                     return PlatformType.Kwai; | 
					
						
							|  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2025-08-31 02:52:49 +00:00
										 |  |  |                 else | 
					
						
							|  |  |  |                 { | 
					
						
							|  |  |  |                     return PlatformType.NULL; | 
					
						
							|  |  |  |                 } | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  | #else | 
					
						
							|  |  |  |             return PlatformType.NULL; | 
					
						
							|  |  |  | #endif | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |