本文整理匯總了C#中UnityEngine.AndroidJavaObject.SetStatic方法的典型用法代碼示例。如果您正苦於以下問題:C# AndroidJavaObject.SetStatic方法的具體用法?C# AndroidJavaObject.SetStatic怎麽用?C# AndroidJavaObject.SetStatic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UnityEngine.AndroidJavaObject
的用法示例。
在下文中一共展示了AndroidJavaObject.SetStatic方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: init
public bool init(string clientId, string gameObjectName)
{
// clientId is only needed for iOS
#if UNITY_IPHONE
GPG_Init(clientId);
GPG_SetGameObjectName(gameObjectName);
return true;
#elif UNITY_ANDROID
AndroidJavaClass unityPlayer = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
mCurrentActivity = unityPlayer.GetStatic<AndroidJavaObject> ("currentActivity");
mNerdGPG = new AndroidJavaObject ("com.nerdiacs.nerdgpgplugin.NerdGPG");
if(mCurrentActivity!=null && mNerdGPG!=null) {
mNerdGPG.Set<bool>("mDebugLog",true); // enable logging
mNerdGPG.SetStatic<string>("gameObjectName",gameObjectName);
mNerdGPG.Call<bool>("init",mCurrentActivity);
return true;
}
else
return false;
#endif
return true;
}
示例2: init
public bool init()
{
#if UNITY_IPHONE
GPG_Init(appID + ".apps.googleusercontent.com");
GPG_SetGameObjectName(name);
return true;
#elif UNITY_ANDROID
AndroidJavaClass unityPlayer = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
mCurrentActivity = unityPlayer.GetStatic<AndroidJavaObject> ("currentActivity");
Debug.Log("Current activity "+mCurrentActivity);
mNerdGPG = new AndroidJavaObject ("com.nerdiacs.nerdgpgplugin.NerdGPG");
if(mCurrentActivity!=null && mNerdGPG!=null) {
mNerdGPG.Set<bool>("mDebugLog",true); // enable logging
mNerdGPG.SetStatic<string>("gameObjectName",name);
mNerdGPG.Call<bool>("init",mCurrentActivity);
return true;
}
else
return false;
#endif
}