本文整理匯總了C#中UnityEngine.AndroidJavaClass.IsNull方法的典型用法代碼示例。如果您正苦於以下問題:C# AndroidJavaClass.IsNull方法的具體用法?C# AndroidJavaClass.IsNull怎麽用?C# AndroidJavaClass.IsNull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnityEngine.AndroidJavaClass
的用法示例。
在下文中一共展示了AndroidJavaClass.IsNull方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: AndroidBluetoothMultiplayer
/// <summary>
/// Initializes <see cref="AndroidBluetoothMultiplayer"/> class.
/// Retrieves a pointer to the Java plugin object.
/// Initalizes the singleton instance on the first usage of the class.
/// </summary>
static AndroidBluetoothMultiplayer() {
_plugin = null;
_isPluginAvailable = false;
try {
UpdateInstance();
} catch {
// Happens when this static constructor is called from a GameObject being created.
// Just ignoring, as this is intended.
}
#if !UNITY_EDITOR && UNITY_ANDROID
// Retrieve BluetoothMediator singleton instance
try {
using (AndroidJavaClass mediatorClass = new AndroidJavaClass(kPluginClassName)) {
if (!mediatorClass.IsNull()) {
_plugin = mediatorClass.CallStatic<AndroidJavaObject>("getSingleton");
_isPluginAvailable = !_plugin.IsNull();
}
}
} catch {
Debug.LogError("AndroidBluetoothMultiplayer initialization failed. Probably .jar not present?");
throw;
}
#endif
}