當前位置: 首頁>>代碼示例>>C#>>正文


C# AndroidJavaObject.CallStatic方法代碼示例

本文整理匯總了C#中UnityEngine.AndroidJavaObject.CallStatic方法的典型用法代碼示例。如果您正苦於以下問題:C# AndroidJavaObject.CallStatic方法的具體用法?C# AndroidJavaObject.CallStatic怎麽用?C# AndroidJavaObject.CallStatic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UnityEngine.AndroidJavaObject的用法示例。


在下文中一共展示了AndroidJavaObject.CallStatic方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Init

        public static void Init()
        {
            AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
            if (jc == null)
            return;

            AndroidJavaObject joactivety = jc.GetStatic<AndroidJavaObject>("currentActivity");
            if (joactivety == null)
            return;
            AndroidJavaObject context = joactivety.Call<AndroidJavaObject>("getApplicationContext");
            // 初始化HttpDns
            AndroidJavaObject joDnsClass = new AndroidJavaObject("com.tencent.msdk.dns.MSDKDnsResolver");
            Debug.Log(" WGGetHostByName ===========" + joDnsClass);
            if (joDnsClass == null)
            return;
            m_dnsJo = joDnsClass.CallStatic<AndroidJavaObject>("getInstance");
            Debug.Log(" WGGetHostByName ===========" + m_dnsJo);
            if (m_dnsJo == null)
            return;
            m_dnsJo.Call("init", context);
            // 初始化燈塔
            AndroidJavaObject joBeaconClass = new AndroidJavaObject("com.tencent.beacon.event.UserAction");
            if (joBeaconClass == null)
            return;
            m_dnsJo.Call("initUserAction", context);
        }
開發者ID:XClouded,項目名稱:httpdns-android-sdk,代碼行數:26,代碼來源:HttpDns.cs

示例2: toAndroidJavaObject

 public override AndroidJavaObject toAndroidJavaObject(AndroidJavaObject jniUnityStoreAssets)
 {
     AndroidJavaObject jniHashMap = jniUnityStoreAssets.CallStatic<AndroidJavaObject>("createStringIntegerHashMap");
     foreach(KeyValuePair<string, int> kvp in currencyValue)
     {
         jniUnityStoreAssets.CallStatic("voidPutIntoStringIntegerHashMap", jniHashMap, kvp.Key, kvp.Value);
     }
     return new AndroidJavaObject("com.soomla.store.domain.data.StaticPriceModel", jniHashMap);
 }
開發者ID:Heartbroken,項目名稱:unity3d-store,代碼行數:9,代碼來源:StaticPriceModel.cs

示例3: toAndroidJavaObject

 public override AndroidJavaObject toAndroidJavaObject(AndroidJavaObject jniUnityStoreAssets)
 {
     AndroidJavaObject jniArrayListHashMap = jniUnityStoreAssets.CallStatic<AndroidJavaObject>("createStringIntegerHashMapArrayList");
     foreach(Dictionary<string, int> curval in currencyValuePerBalance) {
         AndroidJavaObject jniHashMap = jniUnityStoreAssets.CallStatic<AndroidJavaObject>("createStringIntegerHashMap");
         foreach(KeyValuePair<string, int> kvp in curval)
         {
             jniUnityStoreAssets.CallStatic("voidPutIntoStringIntegerHashMap", jniHashMap, kvp.Key, kvp.Value);
         }
         jniArrayListHashMap.Call<bool>("add", jniHashMap);
     }
     return new AndroidJavaObject("com.soomla.store.domain.data.BalanceDrivenPriceModel", jniArrayListHashMap);
 }
開發者ID:Heartbroken,項目名稱:unity3d-store,代碼行數:13,代碼來源:BalanceDrivenPriceModel.cs

示例4: Settings

		public void Settings(string json)
		{
			using (AndroidJavaObject settingsWrapper = new AndroidJavaObject("com.fyber.unity.settings.SettingsWrapper"))
			{
				settingsWrapper.CallStatic("perform", json);
			}
		}
開發者ID:DefyGames,項目名稱:FyberUnityDemo,代碼行數:7,代碼來源:AndroidPluginBridge.cs

示例5: Report

		public void Report(string json)	
		{	
			using (AndroidJavaObject reportWrapper = new AndroidJavaObject("com.fyber.unity.reporters.ReporterWrapper"))
			{
				reportWrapper.CallStatic("report", json);
			}
		}
開發者ID:DefyGames,項目名稱:FyberUnityDemo,代碼行數:7,代碼來源:AndroidPluginBridge.cs

示例6: toAndroidJavaObject

 public AndroidJavaObject toAndroidJavaObject(AndroidJavaObject jniUnityStoreAssets)
 {
     return jniUnityStoreAssets.CallStatic<AndroidJavaObject>("createGoogleMarketItem"
             , this.ProductId
             , (int)(this.consumable)
             , this.Price);
 }
開發者ID:Heartbroken,項目名稱:unity3d-store,代碼行數:7,代碼來源:MarketItem.cs

示例7: Cache

		public void Cache(string action)	
		{	
			using (AndroidJavaObject cacheManager = new AndroidJavaObject("com.fyber.unity.cache.CacheWrapper"))
			{
				cacheManager.CallStatic(action);
			}
		}
開發者ID:DefyGames,項目名稱:FyberUnityDemo,代碼行數:7,代碼來源:AndroidPluginBridge.cs

示例8: StartAd

		public void StartAd(string json)
		{
			using (AndroidJavaObject adWrapper = new AndroidJavaObject("com.fyber.unity.ads.AdWrapper"))
			{
				adWrapper.CallStatic("start", json);
			}
		}
開發者ID:DefyGames,項目名稱:FyberUnityDemo,代碼行數:7,代碼來源:AndroidPluginBridge.cs

示例9: toAndroidJavaObject

 public AndroidJavaObject toAndroidJavaObject(AndroidJavaObject jniUnityStoreAssets)
 {
     return jniUnityStoreAssets.CallStatic<AndroidJavaObject>("createVirtualCategory"
             , this.Name
             , this.Id
             , this.Equipping.toInt());
 }
開發者ID:Heartbroken,項目名稱:unity3d-store,代碼行數:7,代碼來源:VirtualCategory.cs

示例10: EnableLogging

		public void EnableLogging(bool shouldLog)
		{
			//com.fyber.utils.FyberLogger.enableLogging
			using (AndroidJavaObject logger = new AndroidJavaObject("com.fyber.utils.FyberLogger"))
			{
				logger.CallStatic<bool>("enableLogging", shouldLog);
			}
		}
開發者ID:DefyGames,項目名稱:FyberUnityDemo,代碼行數:8,代碼來源:AndroidPluginBridge.cs

示例11: Start

 void Start()
 {
     #if UNITY_ANDROID
          AndroidJNI.AttachCurrentThread();
          jc = new AndroidJavaClass("com.android.plava.spiderspy.CallStatusBridge");
          jc.CallStatic("setCallBack", new object[2] {gameObject.name, "OnCallStateChange"});
      #endif
 }
開發者ID:rbbernardino,項目名稱:spyder,代碼行數:8,代碼來源:CallStateBridge.cs

示例12: Init

 public static void Init(string wechatID)
 {
     Debug.Log("Unity Init");
     if (Application.platform == RuntimePlatform.Android) {
         var pluginClass = new AndroidJavaClass("com.yym.wechatplugin.WeChatPlugin");
         shareItem = pluginClass.CallStatic<AndroidJavaObject>("instance");
         shareItem.CallStatic("_initWeChat", wechatID);
     }
 }
開發者ID:yoyo2004cn,項目名稱:VWCarFactory,代碼行數:9,代碼來源:WeChatPluginAndroid.cs

示例13: GetImageFromGallery

        public void GetImageFromGallery()
        {
            loader.enableLoader ();

                AndroidJNI.AttachCurrentThread ();
                AndroidJavaClass unity = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
                AndroidJavaObject profClass = new AndroidJavaObject ("com.gamedonia.medical.UnityBinder");
                profClass.CallStatic ("OpenGallery", unity.GetStatic<AndroidJavaObject> ("currentActivity"));
        }
開發者ID:Derojo,項目名稱:Medical,代碼行數:9,代碼來源:ProfilePicture.cs

示例14: initialize

        private static void initialize()
        {
#if UNITY_ANDROID && !UNITY_EDITOR
        unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
        unityRootActivity = unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity");
        speechActivityClass = new AndroidJavaClass("com.ntx24.speechservice.speechservice.SpeechController");
        speechActivityClass.CallStatic("StartSpeechFragment", unityRootActivity);
#endif
            smInitialized = true;
        }
開發者ID:techierajan,項目名稱:FirstLight,代碼行數:10,代碼來源:SpeechToText.cs

示例15: initStore

 void initStore()
 {
     cls_StorePurchaser = new AndroidJavaClass("com.storetest.StorePurchaser");
     using (AndroidJavaClass cls = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
     {
         using (AndroidJavaObject obj_Activity = cls.GetStatic<AndroidJavaObject>("currentActivity"))
         {
             cls_StorePurchaser.CallStatic("initStore", obj_Activity, publicAndroidKey);
         }
     }
 }
開發者ID:hjupter,項目名稱:CloudGoodsSDK,代碼行數:11,代碼來源:AndroidCreditPurchaser.cs


注:本文中的UnityEngine.AndroidJavaObject.CallStatic方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。