当前位置: 首页>>代码示例>>C#>>正文


C# AndroidJavaObject.Set方法代码示例

本文整理汇总了C#中UnityEngine.AndroidJavaObject.Set方法的典型用法代码示例。如果您正苦于以下问题:C# AndroidJavaObject.Set方法的具体用法?C# AndroidJavaObject.Set怎么用?C# AndroidJavaObject.Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UnityEngine.AndroidJavaObject的用法示例。


在下文中一共展示了AndroidJavaObject.Set方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Init

	public static void Init(bool rawEnabled){
#if UNITY_IPHONE
		TGAM_Init(rawEnabled);
#elif UNITY_ANDROID
		jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
		jo = jc.GetStatic<AndroidJavaObject>("currentActivity");
		jo.Set<bool>("sendRawEnable", rawEnabled);
#endif
	}
开发者ID:m-ehrndal,项目名称:NeuroSkyUnityThinkGearPlugins,代码行数:9,代码来源:UnityThinkGear.cs

示例2: init

        public void init(Options options) {
            if (!IsDevice()) return;

            using (var j_options = new AndroidJavaObject("org.onepf.oms.OpenIabHelper$Options")) {
                j_options.Set<int>("discoveryTimeoutMs", options.discoveryTimeoutMs);
                j_options.Set<bool>("checkInventory", options.checkInventory);
                j_options.Set<int>("checkInventoryTimeoutMs", options.checkInventoryTimeoutMs);
                j_options.Set<int>("verifyMode", (int) options.verifyMode);

                AndroidJavaObject j_storeKeys = CreateJavaHashMap(options.storeKeys);
                j_options.Set("storeKeys", j_storeKeys);
                j_storeKeys.Dispose();

                j_options.Set("prefferedStoreNames", AndroidJNIHelper.ConvertToJNIArray(options.prefferedStoreNames));

                _plugin.Call("initWithOptions", j_options);
            }
        }
开发者ID:raenoh,项目名称:OpenIAB,代码行数:18,代码来源:OpenIAB.cs

示例3: 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;
 }
开发者ID:vimtaku,项目名称:unity-GoogleMixedTemplate,代码行数:22,代码来源:NerdGPG.cs

示例4: init

        public void init(Options options)
        {
            if (!IsDevice())
            {
                // Fake init process in the editor. For test purposes
                OpenIAB.EventManager.SendMessage("OnBillingSupported", "");
                return;
            }

            using (var j_options = new AndroidJavaObject("org.onepf.oms.OpenIabHelper$Options"))
            {
                j_options.Set<int>("discoveryTimeoutMs", options.discoveryTimeoutMs);
                j_options.Set<bool>("checkInventory", options.checkInventory);
                j_options.Set<int>("checkInventoryTimeoutMs", options.checkInventoryTimeoutMs);
                j_options.Set<int>("verifyMode", (int) options.verifyMode);

                AndroidJavaObject j_storeKeys = CreateJavaHashMap(options.storeKeys);
                j_options.Set("storeKeys", j_storeKeys);
                j_storeKeys.Dispose();

                j_options.Set("prefferedStoreNames", AndroidJNIHelper.ConvertToJNIArray(options.prefferedStoreNames));

                _plugin.Call("initWithOptions", j_options);
            }
        }
开发者ID:kraftdream,项目名称:TimeKiller,代码行数:25,代码来源:OpenIAB_Android.cs

示例5: 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
 }
开发者ID:kraftdream,项目名称:TimeKiller,代码行数:21,代码来源:NerdGPG.cs

示例6: TakePhotoSuccess

    public IEnumerator TakePhotoSuccess(string imagePath)
    {
        Debug.Log("### STRING RETURNED >>"+imagePath+"<< ###");
        if(GameObject.Find("MainScene").GetComponent<GUIStart>().enabled == false)
            yield return false;
        GameObject.Find("camPivot").GetComponent<gyroControl_v2>().enabled = false;
        GameObject.Find("LightPivot").GetComponent<LightConfiguration>().setCompassActive(false);

         Debug.Log("Calling native android functions to get the image size");
         AndroidJavaObject options = new AndroidJavaObject("android/graphics/BitmapFactory$Options");
        // Debug.Log("options set injustdecodebounds");
        options.Set<bool>("inJustDecodeBounds", true);
          //  Debug.Log("factory class");
        AndroidJavaClass factory = new AndroidJavaClass("android.graphics.BitmapFactory");
        //Debug.Log("factorydecodeFile");
        factory.CallStatic<AndroidJavaObject>("decodeFile",imagePath, options);
        int imgWidth = options.Get<int>("outWidth");
        int imgHeight = options.Get<int>("outHeight");
        Debug.Log("imgWidth=" + imgWidth);
        Debug.Log("imgHeight=" + imgHeight);
        float scaleMax = 1;
        //Debug.Log("javaobjects end");
        if (imgWidth > Screen.width)
        {

            scaleMax = ((float)Screen.width) / imgWidth;
        }
        if (imgHeight > Screen.height)
        {
        scaleMax = Mathf.Min(scaleMax, ((float)Screen.height) / imgHeight);
        }
        //Redimensione la photo si elle est plus grande que l'écran
         if(scaleMax<1){
            Debug.Log("Photo too big, scaling the photo taken : ratio="+scaleMax);
            EtceteraAndroid.scaleImageAtPath(imagePath,scaleMax);
         }
         WWW www = new WWW("file://" + imagePath);
         yield return www;
         Texture2D tex = www.texture;

          //  AndroidCommons.Toast("Texture loaded !!!!!");

        //EditorUtility.CompressTexture(tex, TextureFormat.RGBA32,TextureCompressionQuality.Fast);
        //tex.Compress(true);
        //ImgUtils.Bilinear(tex, tex.width / 2, tex.height / 2, true);

        /*
        int k = 0;
        while ((tex.width > 4096 || tex.height > 4096) && k < 2)
        {
            k++;
            Debug.Log("Texture of the photo ist too big !!!! tex.width= " + tex.width + " tex.height= " + tex.height);
            TextureScale.Bilinear(tex, tex.width / 2, tex.height / 2);
        }
        */

        //StartCoroutine(AndroidLoadPhoto(imagePath));

        Montage.sm.updateFond(tex, false,"");

        //	Montage.sm.updateFond(tex, false,"");
        //GetComponent<GUIMenuMain>().setStarter(true, true);

        StartCoroutine (loadImg());

        //		if(System.IO.File.Exists(imagePath))
        //		{
        //			Debug.Log("IMG STILL EXISTS: Deleting ...");
        //			System.IO.File.Delete(imagePath);
        //		}

        Debug.Log("setting background tex");
        GameObject.Find("backgroundImage").GetComponent<BgImgManager>().SetBackgroundTexture(tex);
        GameObject.Find("mainCam").GetComponent<MainCamManager>().FitViewportToScreen();
    }
开发者ID:gviaud,项目名称:OS-unity-5,代码行数:75,代码来源:PluginPhotoManagerGUI.cs

示例7: ResizeTexAtPath

    private void ResizeTexAtPath(string imagePath)
    {
        AndroidJavaObject options = new AndroidJavaObject("android/graphics/BitmapFactory$Options");
        // Debug.Log("options set injustdecodebounds");
        options.Set<bool>("inJustDecodeBounds", true);
        //  Debug.Log("factory class");
        AndroidJavaClass factory = new AndroidJavaClass("android.graphics.BitmapFactory");
        //Debug.Log("factorydecodeFile");
        factory.CallStatic<AndroidJavaObject>("decodeFile", imagePath, options);
        int imgWidth = options.Get<int>("outWidth");
        int imgHeight = options.Get<int>("outHeight");
        Debug.Log("imgWidth=" + imgWidth);
        Debug.Log("imgHeight=" + imgHeight);
        float scaleMax = 1;
        //Debug.Log("javaobjects end");
        if (imgWidth > Screen.width)
        {

        scaleMax = ((float)Screen.width) / imgWidth;
        }
        if (imgHeight > Screen.height)
        {
        scaleMax = Mathf.Min(scaleMax, ((float)Screen.height) / imgHeight);
        }
        //Redimensione la photo si elle est plus grande que l'écran
        if (scaleMax < 1)
        {
        Debug.Log("Photo too big, scaling the photo taken : ratio=" + scaleMax);
        #if UNITY_ANDROID
        EtceteraAndroid.scaleImageAtPath(imagePath, scaleMax);
        #endif
        }
    }
开发者ID:gviaud,项目名称:OS-unity-5,代码行数:33,代码来源:PluginPhotoManagerGUI.cs


注:本文中的UnityEngine.AndroidJavaObject.Set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。