本文整理匯總了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;
}
示例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 );
}
}
示例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
});
}
}
示例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);
}
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}
示例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
}