当前位置: 首页>>代码示例>>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;未经允许,请勿转载。