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


C# AndroidJavaObject.GetRawObject方法代碼示例

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


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

示例1: CreateJavaHashMap

        private AndroidJavaObject CreateJavaHashMap(Dictionary<string, string> storeKeys)
        {
            var j_HashMap = new AndroidJavaObject("java.util.HashMap");
            IntPtr method_Put = AndroidJNIHelper.GetMethodID(j_HashMap.GetRawClass(), "put",
                "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");

            if (storeKeys != null)
            {
                object[] args = new object[2];
                foreach (KeyValuePair<string, string> kvp in storeKeys)
                {
                    using (AndroidJavaObject k = new AndroidJavaObject("java.lang.String", kvp.Key))
                    {
                        using (AndroidJavaObject v = new AndroidJavaObject("java.lang.String", kvp.Value))
                        {
                            args[0] = k;
                            args[1] = v;
                            AndroidJNI.CallObjectMethod(j_HashMap.GetRawObject(),
                                method_Put, AndroidJNIHelper.CreateJNIArgArray(args));
                        }
                    }
                }
            }
            return j_HashMap;
        }
開發者ID:kraftdream,項目名稱:TimeKiller,代碼行數:25,代碼來源:OpenIAB_Android.cs

示例2: graphRequest

    // Calls a custom Graph API method with the key/value pairs in the Dictionary.  Pass in a null dictionary if no parameters are needed.
    public static void graphRequest( string graphPath, string httpMethod, Dictionary<string,string> parameters )
    {
        if( Application.platform != RuntimePlatform.Android )
            return;

        // load up the Bundle
        using( var bundle = new AndroidJavaObject( "android.os.Bundle" ) )
        {
            var putStringMethod = AndroidJNI.GetMethodID( bundle.GetRawClass(), "putString", "(Ljava/lang/String;Ljava/lang/String;)V" );
            var args = new object[2];

            // add all our dictionary elements into the Bundle
            if( parameters != null )
            {
                foreach( var kv in parameters  )
                {
                    args[0] = new AndroidJavaObject( "java.lang.String", kv.Key );
                    args[1] = new AndroidJavaObject( "java.lang.String", kv.Value );
                    AndroidJNI.CallObjectMethod( bundle.GetRawObject(), putStringMethod, AndroidJNIHelper.CreateJNIArgArray( args ) );
                }
            }

            // call off to java land
            _facebookPlugin.Call( "graphRequest", graphPath, httpMethod, bundle );
        }
    }
開發者ID:simmmis,項目名稱:Kill-Red,代碼行數:27,代碼來源:FacebookAndroid.cs

示例3: trackEvent

 public static void trackEvent(string eventStr, Hashtable chnlDetail)
 {
     using (AndroidJavaObject androidJavaObject = new AndroidJavaObject("java.util.HashMap", new object[0]))
     {
         IntPtr methodID = AndroidJNIHelper.GetMethodID(androidJavaObject.GetRawClass(), "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
         object[] array = new object[2];
         foreach (DictionaryEntry dictionaryEntry in chnlDetail)
         {
             using (AndroidJavaObject androidJavaObject2 = new AndroidJavaObject("java.lang.String", new object[]
             {
                 dictionaryEntry.Key
             }))
             {
                 using (AndroidJavaObject androidJavaObject3 = new AndroidJavaObject("java.lang.String", new object[]
                 {
                     dictionaryEntry.Value
                 }))
                 {
                     array[0] = androidJavaObject2;
                     array[1] = androidJavaObject3;
                     AndroidJNI.CallObjectMethod(androidJavaObject.GetRawObject(), methodID, AndroidJNIHelper.CreateJNIArgArray(array));
                 }
             }
         }
         AdvertMgr.callSdkApi("trackEvent", new object[]
         {
             eventStr,
             androidJavaObject
         });
     }
 }
開發者ID:floatyears,項目名稱:Decrypt,代碼行數:31,代碼來源:AdvertMgr.cs

示例4: logEvent

    public void logEvent(string eventId, Dictionary<string, string> parameters)
    {
        using(AndroidJavaObject obj_HashMap = new AndroidJavaObject("java.util.HashMap"))
        {
            // Call 'put' via the JNI instead of using helper classes to avoid:
            // 	"JNI: Init'd AndroidJavaObject with null ptr!"
            IntPtr method_Put = AndroidJNIHelper.GetMethodID(obj_HashMap.GetRawClass(), "put",
                "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");

            object[] args = new object[2];
            foreach(KeyValuePair<string, string> kvp in parameters)
            {
                using(AndroidJavaObject k = new AndroidJavaObject("java.lang.String", kvp.Key))
                {
                    using(AndroidJavaObject v = new AndroidJavaObject("java.lang.String", kvp.Value))
                    {
                        args[0] = k;
                        args[1] = v;
                        AndroidJNI.CallObjectMethod(obj_HashMap.GetRawObject(),
                            method_Put, AndroidJNIHelper.CreateJNIArgArray(args));
                    }
                }
            }
            cls_FlurryAgent.CallStatic("logEvent", eventId, obj_HashMap);
        }
    }
開發者ID:slightlysocial,項目名稱:unity-admanager,代碼行數:26,代碼來源:FlurryAgent.cs

示例5: AudioCallConnection

	public AudioCallConnection(GameObject obj) : base()
	{
#if UNITY_EDITOR
		audioCallConnection = new AndroidJavaObject(IntPtr.Zero);
#elif UNITY_ANDROID
		audioCallConnection = bridge.Call<AndroidJavaObject>("audioCallConnection", obj.name);
		Debug.Log("audioCallConnection: "+audioCallConnection.GetRawObject());
		//showMessage("I call ShowMessage!");
#endif
	}
開發者ID:jibemobile,項目名稱:jibe-unity-plugin-public,代碼行數:10,代碼來源:AudioCallConnection.cs

示例6: DataManager

 public DataManager()
 {
     #if UNITY_ANDROID&&!UNITY_EDITOR
        if(javaUnityApplicasaDataManager==null)
     javaUnityApplicasaDataManager = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaDataManager");
        innerDataManagerJavaObject = new AndroidJavaObject("com.applicasa.DataManager.DataManager");
        innerDataManager = innerDataManagerJavaObject.GetRawObject();
     #elif UNITY_IPHONE && !UNITY_EDITOR
     innerDataManager = ApplicasaDataManager();
     #endif
 }
開發者ID:Applicasa,項目名稱:Sample-App-Unity,代碼行數:11,代碼來源:DataManager.cs

示例7: Foo

 public Foo()
 {
     #if UNITY_ANDROID&&!UNITY_EDITOR
        if(javaUnityApplicasaFoo==null)
     javaUnityApplicasaFoo = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaFoo");
        innerFooJavaObject = new AndroidJavaObject("com.applicasa.Foo.Foo");
        innerFoo = innerFooJavaObject.GetRawObject();
     #elif UNITY_IPHONE && !UNITY_EDITOR
     innerFoo = ApplicasaFoo();
     #endif
 }
開發者ID:Applicasa,項目名稱:Sample-App-Unity,代碼行數:11,代碼來源:Foo.cs

示例8: ThirdPartyAction

 public ThirdPartyAction()
 {
     #if UNITY_ANDROID&&!UNITY_EDITOR
        if(javaUnityApplicasaThirdPartyAction==null)
     javaUnityApplicasaThirdPartyAction = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaThirdPartyAction");
        innerThirdPartyActionJavaObject = new AndroidJavaObject("com.applicasa.ThirdPartyAction.ThirdPartyAction");
        innerThirdPartyAction = innerThirdPartyActionJavaObject.GetRawObject();
     #elif UNITY_IPHONE && !UNITY_EDITOR
     innerThirdPartyAction = ApplicasaThirdPartyAction();
     #endif
 }
開發者ID:Applicasa,項目名稱:Sample-App-Unity,代碼行數:11,代碼來源:ThirdPartyAction.cs

示例9: Achievments

 public Achievments()
 {
     #if UNITY_ANDROID&&!UNITY_EDITOR
        if(javaUnityApplicasaAchievments==null)
     javaUnityApplicasaAchievments = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaAchievments");
        innerAchievmentsJavaObject = new AndroidJavaObject("com.applicasa.Achievments.Achievments");
        innerAchievments = innerAchievmentsJavaObject.GetRawObject();
     #elif UNITY_IPHONE && !UNITY_EDITOR
     innerAchievments = ApplicasaAchievments();
     #endif
 }
開發者ID:Applicasa,項目名稱:Sample-App-Unity,代碼行數:11,代碼來源:Achievments.cs

示例10: Dynamic

 public Dynamic()
 {
     #if UNITY_ANDROID&&!UNITY_EDITOR
        if(javaUnityApplicasaDynamic==null)
     javaUnityApplicasaDynamic = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaDynamic");
        innerDynamicJavaObject = new AndroidJavaObject("com.applicasa.Dynamic.Dynamic");
        innerDynamic = innerDynamicJavaObject.GetRawObject();
     #elif UNITY_IPHONE && !UNITY_EDITOR
     innerDynamic = ApplicasaDynamic();
     #endif
 }
開發者ID:Applicasa,項目名稱:Sample-App-Unity,代碼行數:11,代碼來源:Dynamic.cs

示例11: VirtualGoodCategory

 public VirtualGoodCategory()
 {
     #if UNITY_ANDROID&&!UNITY_EDITOR
        if(javaUnityApplicasaVirtualGoodCategory==null)
     javaUnityApplicasaVirtualGoodCategory = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaVirtualGoodCategory");
        innerVirtualGoodCategoryJavaObject = new AndroidJavaObject("com.applicasa.VirtualGoodCategory.VirtualGoodCategory");
        innerVirtualGoodCategory = innerVirtualGoodCategoryJavaObject.GetRawObject();
     #elif UNITY_IPHONE && !UNITY_EDITOR
     innerVirtualGoodCategory = ApplicasaVirtualGoodCategory();
     #endif
 }
開發者ID:Applicasa,項目名稱:Sample-App-Unity,代碼行數:11,代碼來源:VirtualGoodCategory.cs

示例12: ScoreB

 public ScoreB()
 {
     #if UNITY_ANDROID&&!UNITY_EDITOR
        if(javaUnityApplicasaScoreB==null)
     javaUnityApplicasaScoreB = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaScoreB");
        innerScoreBJavaObject = new AndroidJavaObject("com.applicasa.ScoreB.ScoreB");
        innerScoreB = innerScoreBJavaObject.GetRawObject();
     #elif UNITY_IPHONE && !UNITY_EDITOR
     innerScoreB = ApplicasaScoreB();
     #endif
 }
開發者ID:Applicasa,項目名稱:Sample-App-Unity,代碼行數:11,代碼來源:ScoreB.cs

示例13: Colors

 public Colors()
 {
     #if UNITY_ANDROID&&!UNITY_EDITOR
        if(javaUnityApplicasaColors==null)
     javaUnityApplicasaColors = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaColors");
        innerColorsJavaObject = new AndroidJavaObject("com.applicasa.Colors.Colors");
        innerColors = innerColorsJavaObject.GetRawObject();
     #elif UNITY_IPHONE && !UNITY_EDITOR
     innerColors = ApplicasaColors();
     #endif
 }
開發者ID:Applicasa,項目名稱:Sample-App-Unity,代碼行數:11,代碼來源:Colors.cs

示例14: Languages

 public Languages()
 {
     #if UNITY_ANDROID&&!UNITY_EDITOR
        if(javaUnityApplicasaLanguages==null)
     javaUnityApplicasaLanguages = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaLanguages");
        innerLanguagesJavaObject = new AndroidJavaObject("com.applicasa.Languages.Languages");
        innerLanguages = innerLanguagesJavaObject.GetRawObject();
     #elif UNITY_IPHONE && !UNITY_EDITOR
     innerLanguages = ApplicasaLanguages();
     #endif
 }
開發者ID:Applicasa,項目名稱:Sample-App-Unity,代碼行數:11,代碼來源:Languages.cs

示例15: GameV

 public GameV()
 {
     #if UNITY_ANDROID&&!UNITY_EDITOR
        if(javaUnityApplicasaGameV==null)
     javaUnityApplicasaGameV = new AndroidJavaClass("com.applicasaunity.Unity.ApplicasaGameV");
        innerGameVJavaObject = new AndroidJavaObject("com.applicasa.GameV.GameV");
        innerGameV = innerGameVJavaObject.GetRawObject();
     #elif UNITY_IPHONE && !UNITY_EDITOR
     innerGameV = ApplicasaGameV();
     #endif
 }
開發者ID:Applicasa,項目名稱:Sample-App-Unity,代碼行數:11,代碼來源:GameV.cs


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