本文整理汇总了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
}