本文整理汇总了C#中UnityEngine.jvalue类的典型用法代码示例。如果您正苦于以下问题:C# jvalue类的具体用法?C# jvalue怎么用?C# jvalue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
jvalue类属于UnityEngine命名空间,在下文中一共展示了jvalue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BurstlyCurrencyWrapper_initialize
private static void BurstlyCurrencyWrapper_initialize(string publisherId, string userId)
{
jvalue[] args = new jvalue[2];
args[0].l = AndroidJNI.NewStringUTF(publisherId);
args[1].l = AndroidJNI.NewStringUTF(userId);
AndroidJNI.CallStaticVoidMethod(BurstlyPluginClass, methodID_initialize, args);
}
示例2: BurstlyCurrencyWrapper_increaseBalance
private static void BurstlyCurrencyWrapper_increaseBalance(string currency, int amount)
{
jvalue[] args = new jvalue[2];
args[0].l = AndroidJNI.NewStringUTF(currency);
args[1].i = amount;
AndroidJNI.CallStaticVoidMethod(BurstlyPluginClass, methodID_increaseBalance, args);
}
示例3: CheckException
public static void CheckException()
{
IntPtr localref = AndroidJNI.ExceptionOccurred();
if (!(localref != IntPtr.Zero))
return;
AndroidJNI.ExceptionClear();
IntPtr num1 = AndroidJNI.FindClass("java/lang/Throwable");
IntPtr num2 = AndroidJNI.FindClass("android/util/Log");
try
{
IntPtr methodId = AndroidJNI.GetMethodID(num1, "toString", "()Ljava/lang/String;");
IntPtr staticMethodId = AndroidJNI.GetStaticMethodID(num2, "getStackTraceString", "(Ljava/lang/Throwable;)Ljava/lang/String;");
string message = AndroidJNI.CallStringMethod(localref, methodId, new jvalue[0]);
jvalue[] args = new jvalue[1];
args[0].l = localref;
string javaStackTrace = AndroidJNI.CallStaticStringMethod(num2, staticMethodId, args);
throw new AndroidJavaException(message, javaStackTrace);
}
finally
{
AndroidJNISafe.DeleteLocalRef(localref);
AndroidJNISafe.DeleteLocalRef(num1);
AndroidJNISafe.DeleteLocalRef(num2);
}
}
示例4: NewProxyInstance
public static IntPtr NewProxyInstance(int delegateHandle, IntPtr interfaze)
{
jvalue[] array = new jvalue[2];
array[0].i = delegateHandle;
array[1].l = interfaze;
return AndroidJNISafe.CallStaticObjectMethod(AndroidReflection.s_ReflectionHelperClass, AndroidReflection.s_ReflectionHelperNewProxyInstance, array);
}
示例5: Destroy
public static void Destroy() {
#if UNITY_ANDROID && !UNITY_EDITOR
JavaVM.AttachCurrentThread();
jvalue[] args = new jvalue[] {};
AndroidJNI.CallVoidMethod(LoopMeClass, DestroyPtr, args);
#endif
}
示例6: BurstlyAdWrapper_createBannerPlacement
private static void BurstlyAdWrapper_createBannerPlacement(string placementName, string appId, string zoneId, float originX, float originY, float width, float height)
{
jvalue[] args = new jvalue[7];
args[0].l = AndroidJNI.NewStringUTF(placementName);
args[1].l = AndroidJNI.NewStringUTF(appId);
args[2].l = AndroidJNI.NewStringUTF(zoneId);
args[3].f = originX;
args[4].f = originY;
args[5].f = width;
args[6].f = height;
AndroidJNI.CallStaticVoidMethod(BurstlyPluginClass, methodID_createBannerPlacement, args);
}
示例7: Write
public static int Write(ref int[] data)
{
IntPtr pArr = AndroidJNIHelper.ConvertToJNIArray(data);
jvalue[] blah = new jvalue[1];
blah[0].l = pArr;
if (writeMethodId == null)
writeMethodId = AndroidJNIHelper.GetMethodID(jo.GetRawClass(), "writeUsbPort");
int ret = AndroidJNI.CallIntMethod(jo.GetRawObject(), writeMethodId, blah);
AndroidJNI.DeleteLocalRef(pArr);
return ret;
}
示例8: CallBooleanMethod
public static bool CallBooleanMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
{
bool flag;
try
{
flag = AndroidJNI.CallBooleanMethod(obj, methodID, args);
}
finally
{
CheckException();
}
return flag;
}
示例9: CallIntMethod
public static int CallIntMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
{
int num;
try
{
num = AndroidJNI.CallIntMethod(obj, methodID, args);
}
finally
{
CheckException();
}
return num;
}
示例10: CallCharMethod
public static char CallCharMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
{
char ch;
try
{
ch = AndroidJNI.CallCharMethod(obj, methodID, args);
}
finally
{
CheckException();
}
return ch;
}
示例11: CallDoubleMethod
public static double CallDoubleMethod(IntPtr obj, IntPtr methodID, jvalue[] args)
{
double num;
try
{
num = AndroidJNI.CallDoubleMethod(obj, methodID, args);
}
finally
{
CheckException();
}
return num;
}
示例12: GetConstructorMember
public static IntPtr GetConstructorMember(IntPtr jclass, string signature)
{
jvalue[] args = new jvalue[2];
try
{
args[0].l = jclass;
args[1].l = AndroidJNISafe.NewStringUTF(signature);
return AndroidJNISafe.CallStaticObjectMethod(AndroidReflection.s_ReflectionHelperClass, AndroidReflection.s_ReflectionHelperGetConstructorID, args);
}
finally
{
AndroidJNISafe.DeleteLocalRef(args[1].l);
}
}
示例13: closeWebView
public void closeWebView()
{
// attach our thread to the java vm
bool mainThread = (mainThreadId == System.Threading.Thread.CurrentThread.ManagedThreadId);
AndroidJNI.AttachCurrentThread();
// call
jvalue[] args = new jvalue[0];
AndroidJNI.CallStaticVoidMethod(JavaClass, CloseWebViewId,args);
if(mainThread == false){
AndroidJNI.DetachCurrentThread();
}
}
示例14: GetFieldMember
public static IntPtr GetFieldMember(IntPtr jclass, string fieldName, string signature, bool isStatic)
{
jvalue[] args = new jvalue[4];
try
{
args[0].l = jclass;
args[1].l = AndroidJNISafe.NewStringUTF(fieldName);
args[2].l = AndroidJNISafe.NewStringUTF(signature);
args[3].z = isStatic;
return AndroidJNISafe.CallStaticObjectMethod(AndroidReflection.s_ReflectionHelperClass, AndroidReflection.s_ReflectionHelperGetFieldID, args);
}
finally
{
AndroidJNISafe.DeleteLocalRef(args[1].l);
AndroidJNISafe.DeleteLocalRef(args[2].l);
}
}
示例15: openWebView
public void openWebView(String url)
{
// attach our thread to the java vm; obviously the main thread is already attached but this is good practice..
bool mainThread = (mainThreadId == System.Threading.Thread.CurrentThread.ManagedThreadId);
AndroidJNI.AttachCurrentThread();
// call
jvalue[] args = new jvalue[1];
args[0] = new jvalue();
args[0].l = AndroidJNI.NewStringUTF(url);
AndroidJNI.CallStaticVoidMethod(JavaClass, OpenWebViewId,args);
if(mainThread == false){
AndroidJNI.DetachCurrentThread();
}
}