本文整理汇总了C#中UnityEngine.jvalue类的典型用法代码示例。如果您正苦于以下问题:C# jvalue类的具体用法?C# jvalue怎么用?C# jvalue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
jvalue类属于UnityEngine命名空间,在下文中一共展示了jvalue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:CoderDawson,项目名称:BurstlyUnityPlugin,代码行数:7,代码来源:BurstlyCurrency.cs
示例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);
}
开发者ID:CoderDawson,项目名称:BurstlyUnityPlugin,代码行数:7,代码来源:BurstlyCurrency.cs
示例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);
}
}
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:25,代码来源:AndroidJNISafe.cs
示例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);
}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:7,代码来源:AndroidReflection.cs
示例5: Destroy
public static void Destroy() {
#if UNITY_ANDROID && !UNITY_EDITOR
JavaVM.AttachCurrentThread();
jvalue[] args = new jvalue[] {};
AndroidJNI.CallVoidMethod(LoopMeClass, DestroyPtr, args);
#endif
}
开发者ID:injectios,项目名称:loopme-unity3d-plugin,代码行数:8,代码来源:LoopMeAndroidBinding.cs
示例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);
}
开发者ID:CoderDawson,项目名称:BurstlyUnityPlugin,代码行数:12,代码来源:BurstlyAds.cs
示例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;
}
开发者ID:lfwelove,项目名称:lbp,代码行数:12,代码来源:AndroidHidPort.cs
示例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;
}
开发者ID:randomize,项目名称:VimConfig,代码行数:13,代码来源:AndroidJNISafe.cs
示例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;
}
开发者ID:randomize,项目名称:VimConfig,代码行数:13,代码来源:AndroidJNISafe.cs
示例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;
}
开发者ID:randomize,项目名称:VimConfig,代码行数:13,代码来源:AndroidJNISafe.cs
示例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;
}
开发者ID:randomize,项目名称:VimConfig,代码行数:13,代码来源:AndroidJNISafe.cs
示例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);
}
}
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:14,代码来源:AndroidReflection.cs
示例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();
}
}
开发者ID:technerdlove,项目名称:SnowBallZ,代码行数:15,代码来源:NUnityWebViewAndroid.cs
示例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);
}
}
开发者ID:BlakeTriana,项目名称:unity-decompiled,代码行数:17,代码来源:AndroidReflection.cs
示例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();
}
}
开发者ID:technerdlove,项目名称:SnowBallZ,代码行数:18,代码来源:NUnityWebViewAndroid.cs
示例16: OnGUI
void OnGUI()
{
if (GUI.Button(new Rect(200, 10, 200, 100), "GetPWCheckValue4"))
{
string strCrc = jo.Call<string>("GetPWCheckValue4", (long)lineId, (long)machineId, (long)maxProfit, (long)profit, (long)checkCount);
int value;
if (int.TryParse(strCrc, out value))
{
crc = value;
}
DebugConsole.Log("校验码=" + crc.ToString());
}
if (GUI.Button(new Rect(200, 150, 200, 100), "CreateCheckPWString"))
{
AndroidJavaObject rev = jo.Call<AndroidJavaObject>("CreateCheckPWString",
(long)lineId, (long)machineId, (long)maxProfit, (long)profit, (long)checkCount, (long)crc, (long)userInput);
byte[] buf = AndroidJNIHelper.ConvertFromJNIArray<byte[]>(rev.GetRawObject());
string log = "c# CreateCheckPWString:";
foreach (byte b in buf)
log += string.Format("{0:X}", b) + ", ";
DebugConsole.Log(log);
List<int> data = new List<int>();
data.Add(0x42);
data.Add(0x5a);
data.Add(32);
foreach(byte b in buf)
data.Add((int)b);
while (data.Count < 64)
data.Add(0);
hidUtils.WriteData(data.ToArray());
}
if (GUI.Button(new Rect(200, 300, 200, 100), "GetCheckPWStringValue"))
{
byte[] data = sendToChip.ToArray();
IntPtr pArr = AndroidJNIHelper.ConvertToJNIArray(data);
jvalue[] blah = new jvalue[1];
blah[0].l = pArr;
IntPtr methodId = AndroidJNIHelper.GetMethodID(jo.GetRawClass(), "GetCheckPWStringValue");
DebugConsole.Log(AndroidJNI.CallStringMethod(jo.GetRawObject(), methodId, blah));
}
}
开发者ID:lfwelove,项目名称:lbp,代码行数:44,代码来源:TestEncryChip.cs
示例17: GetMethodMember
public static IntPtr GetMethodMember(IntPtr jclass, string methodName, string signature, bool isStatic)
{
IntPtr ptr;
jvalue[] args = new jvalue[4];
try
{
args[0].l = jclass;
args[1].l = AndroidJNISafe.NewStringUTF(methodName);
args[2].l = AndroidJNISafe.NewStringUTF(signature);
args[3].z = isStatic;
ptr = AndroidJNISafe.CallStaticObjectMethod(s_ReflectionHelperClass, s_ReflectionHelperGetMethodID, args);
}
finally
{
AndroidJNISafe.DeleteLocalRef(args[1].l);
AndroidJNISafe.DeleteLocalRef(args[2].l);
}
return ptr;
}
开发者ID:randomize,项目名称:VimConfig,代码行数:19,代码来源:AndroidReflection.cs
示例18: GetMethodMember
public static IntPtr GetMethodMember(IntPtr jclass, string methodName, string signature, bool isStatic)
{
jvalue[] array = new jvalue[4];
IntPtr result;
try
{
array[0].l = jclass;
array[1].l = AndroidJNISafe.NewStringUTF(methodName);
array[2].l = AndroidJNISafe.NewStringUTF(signature);
array[3].z = isStatic;
result = AndroidJNISafe.CallStaticObjectMethod(AndroidReflection.s_ReflectionHelperClass, AndroidReflection.s_ReflectionHelperGetMethodID, array);
}
finally
{
AndroidJNISafe.DeleteLocalRef(array[1].l);
AndroidJNISafe.DeleteLocalRef(array[2].l);
}
return result;
}
开发者ID:guozanhua,项目名称:UnityDecompiled,代码行数:19,代码来源:AndroidReflection.cs
示例19: getHttp
public void getHttp( String url, NetConnectionReceivedHandler connectionReceivedHandler, NetConnectionSendFailHandler asyncSendFailResult)
{
_currentGetConnectionReceivedHandler = connectionReceivedHandler;
_currentGetAsyncSendFailResult = asyncSendFailResult;
// attach our thread to the java vm
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, HttpGetId,args);
if(mainThread == false){
AndroidJNI.DetachCurrentThread();
}
}
开发者ID:technerdlove,项目名称:SnowBallZ,代码行数:20,代码来源:NUnityNetAndroid.cs
示例20: getItem
public string getItem(string key)
{
// attach our thread to the java vm
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(key);
string result = AndroidJNI.CallStaticStringMethod(JavaClass, GetItemId,args);
// detach our thread to the java vm
if(mainThread == false){
AndroidJNI.DetachCurrentThread();
}
return result;
}
开发者ID:technerdlove,项目名称:SnowBallZ,代码行数:20,代码来源:NUnityStorageAndroid.cs
注:本文中的UnityEngine.jvalue类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论