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


C# AndroidJavaObject.Get方法代码示例

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


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

示例1: DisplayMetricsAndroid

    static DisplayMetricsAndroid() {
        // Early out if we're not on an Android device
        if (Application.platform != RuntimePlatform.Android) {
            return;
        }

        // The following is equivalent to this Java code:
        //
        // metricsInstance = new DisplayMetrics();
        // UnityPlayer.currentActivity.getWindowManager().getDefaultDisplay().getMetrics(metricsInstance);
        //
        // ... which is pretty much equivalent to the code on this page:
        // http://developer.android.com/reference/android/util/DisplayMetrics.html

        using (
            AndroidJavaClass unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"),
            metricsClass = new AndroidJavaClass("android.util.DisplayMetrics")
        ) {
            using (
                AndroidJavaObject metricsInstance = new AndroidJavaObject("android.util.DisplayMetrics"),
                activityInstance = unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity"),
                windowManagerInstance = activityInstance.Call<AndroidJavaObject>("getWindowManager"),
                displayInstance = windowManagerInstance.Call<AndroidJavaObject>("getDefaultDisplay")
            ) {
                displayInstance.Call("getRealMetrics", metricsInstance);
                Density = metricsInstance.Get<float>("density");
                DensityDPI = metricsInstance.Get<int>("densityDpi");
                HeightPixels = metricsInstance.Get<int>("heightPixels");
                WidthPixels = metricsInstance.Get<int>("widthPixels");
                ScaledDensity = metricsInstance.Get<float>("scaledDensity");
                XDPI = metricsInstance.Get<float>("xdpi");
                YDPI = metricsInstance.Get<float>("ydpi");
            }
        }
    }
开发者ID:tentacode,项目名称:MultiTest,代码行数:35,代码来源:ScreenUnitConverter.cs

示例2: GenericHIDDevice

        public GenericHIDDevice(int inx, AndroidJavaObject device, IHIDInterface hidInterface)
			: base(inx, device.Get<int>("VID"), device.Get<int>("PID"),device.Get<string>("path"), IntPtr.Zero, hidInterface, device.Get<string>("path"))
        {


            __lastHIDReport = new HIDReport(this.index, new byte[_InputReportByteLength], HIDReport.ReadStatus.Success);
             
            _device=device;
            _listener = new ReadWriteListenerProxy();
        }
开发者ID:cupsster,项目名称:Unity3d-InputMapper,代码行数:10,代码来源:GenericHIDDevice.cs

示例3: Density

 static Density()
 {
     Value = 1.0f;
     #if UNITY_ANDROID
     using (
         AndroidJavaClass unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"),
         metricsClass = new AndroidJavaClass("android.util.DisplayMetrics")
         ) {
         using (
             AndroidJavaObject metricsInstance = new AndroidJavaObject("android.util.DisplayMetrics"),
             activityInstance = unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity"),
             windowManagerInstance = activityInstance.Call<AndroidJavaObject>("getWindowManager"),
             displayInstance = windowManagerInstance.Call<AndroidJavaObject>("getDefaultDisplay")
             ) {
             displayInstance.Call ("getMetrics", metricsInstance);
             Value = metricsInstance.Get<float> ("density");
         }
     }
     #endif
     #if UNITY_IPHONE
     if (Application.platform != RuntimePlatform.OSXEditor) {
         Value = IOSDensity_ ();
     }
     #endif
 }
开发者ID:polishedsolid,项目名称:Unity,代码行数:25,代码来源:Density.cs

示例4: Start

	// Use this for initialization
	void Start () {
		AndroidJavaClass majcUnityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
		AndroidJavaObject majoDivePluginInstance = majcUnityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity");
		metricsClass= new AndroidJavaClass("android.util.DisplayMetrics");
		metricsInstance= new AndroidJavaObject("android.util.DisplayMetrics");
		windowManagerInstance=majoDivePluginInstance.Call<AndroidJavaObject>("getWindowManager");
		displayInstance=windowManagerInstance.Call<AndroidJavaObject>("getDefaultDisplay");
		
		displayInstance.Call("getMetrics",metricsInstance);
		
		density=metricsInstance.Get<float>("density");
		densitydpi=metricsInstance.Get<int> ("densityDpi");
		vpixels=metricsInstance.Get<int>("heightPixels");
		vpixels=Screen.height;
		hpixels=metricsInstance.Get<int>("widthPixels");
		//hpixels=displayInstance.Call<int>("getWidth");
		hpixels=Screen.width;
		scaledDensity=metricsInstance.Get<float>("scaledDensity");
		xdpi=metricsInstance.Get<float>("xdpi");
		ydpi=metricsInstance.Get<float>("ydpi");
		xmm=hpixels/xdpi/0.0393701f;
		ymm=vpixels/ydpi/0.0393701f;
		
		
		hpixels=Screen.width;
		vpixels=Screen.height;
		xmm=hpixels/xdpi/0.0393701f;
		ymm=vpixels/ydpi/0.0393701f;
		mmdist=xmm/2;
	}
开发者ID:Gkxd,项目名称:ProjectCodetta,代码行数:31,代码来源:NaturalOrientation.cs

示例5: onRead

        void onRead(AndroidJavaObject jo) {
          //  Debug.Log("ReadWriteListenerProxy>>onRead:");
           //   Debug.Log("ReadWriteListenerProxy>>onRead rawObject:" + bufferObject);

            AndroidJavaObject bufferObject = jo.Get<AndroidJavaObject>("Buffer");

        

            byte[] buffer = AndroidJNIHelper.ConvertFromJNIArray<byte[]>(bufferObject.GetRawObject());
          //  Debug.Log("ReadWriteListenerProxy>>Call array succeded:");

         //   Debug.Log("ReadWriteListenerProxy>>onRead:" + BitConverter.ToString(buffer));
            if (ReadComplete != null)
                ReadComplete.Invoke(buffer);
        }
开发者ID:cupsster,项目名称:Unity3d-InputMapper,代码行数:15,代码来源:ReadWriteListenerProxy.cs

示例6: onAttributionChanged

            public void onAttributionChanged(AndroidJavaObject attribution)
            {
                AdjustAttribution adjustAttribution = new AdjustAttribution ();

                adjustAttribution.trackerName = attribution.Get<string> ("trackerName");
                adjustAttribution.trackerToken = attribution.Get<string> ("trackerToken");
                adjustAttribution.network = attribution.Get<string> ("network");
                adjustAttribution.campaign = attribution.Get<string> ("campaign");
                adjustAttribution.adgroup = attribution.Get<string> ("adgroup");
                adjustAttribution.creative = attribution.Get<string> ("creative");

                if (callback != null) {
                    callback (adjustAttribution);
                }
            }
开发者ID:tengontheway,项目名称:unity_sdk,代码行数:15,代码来源:AdjustAndroid.cs

示例7: getDensitySize

    private static int getDensitySize(int size) {
		#if UNITY_EDITOR
		return 0;
		#elif UNITY_IPHONE
		float screenScale = getScreenScale_();
		return (int)(size / screenScale + 0.5f);
        #elif UNITY_ANDROID
        AndroidJavaObject displayMetrics = new AndroidJavaObject ("android.util.DisplayMetrics");
        AndroidJavaClass unityPlayerClass = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
        AndroidJavaObject activityObject = unityPlayerClass.GetStatic<AndroidJavaObject> ("currentActivity");
        AndroidJavaObject windowManagerObject = activityObject.Call<AndroidJavaObject> ("getWindowManager");
        AndroidJavaObject displayObject = windowManagerObject.Call<AndroidJavaObject> ("getDefaultDisplay");
        displayObject.Call ("getMetrics", displayMetrics);
        float density = displayMetrics.Get<float> ("density");
        return (int)(((size / density) + 0.5f));
        #endif
    }
开发者ID:hanahanaside,项目名称:QuizBox,代码行数:17,代码来源:IMobileSdkAdsViewUtility.cs

示例8: Start

    // Use this for initialization.
    public void Start()
    {
        // Ensures all necessary scripts are added for the MainObject
        gameStateManagerRef = gameObject.GetComponent<GameStateManager>();
        gameStateManagerRef.EnsureCoreScriptsAdded();
        gameStateManagerRef.EnsureScriptAdded("MainMenu");

        if(gameStateManagerRef.gameStartedFromUI){
            activeScreen = gameObject.GetComponent("MainMenu") as MainMenu;
            currentScreenArea = ScreenAreas.MainMenu;
        }
        else{
            // This will not be the active screen, but active screen needs to be initialized.
            activeScreen = gameObject.GetComponent("MainMenu") as MainMenu;
            activeScreen.enabled = false;
            currentScreenArea = ScreenAreas.InGame;
        }

        screenOrientation = ScreenOrientation.Landscape;
        deviceOrientation = DeviceOrientation.LandscapeLeft;

        if(Application.platform.Equals(RuntimePlatform.Android)){
            #if UNITY_ANDROID
            using(AndroidJavaClass unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"),
                    metricsClass = new AndroidJavaClass("android.util.DisplayMetrics")){
                using(AndroidJavaObject metricsInstance = new AndroidJavaObject("android.util.DisplayMetrics"),
                        activityInstance = unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity"),
                        windowManagerInstance = activityInstance.Call<AndroidJavaObject>("getWindowManager"),
                        displayInstance = windowManagerInstance.Call<AndroidJavaObject>("getDefaultDisplay")){
                    displayInstance.Call("getMetrics", metricsInstance);
                    screenResolution.y = metricsInstance.Get<int>("heightPixels");
                    screenResolution.x = metricsInstance.Get<int>("widthPixels");
                    screenSize.x = Screen.width;
                    screenSize.y = Screen.height;
                    Screen.SetResolution((int)screenResolution.x, (int)screenResolution.y, true);
                    deviceOrientation = Input.deviceOrientation;
                }
            }
            #endif
        }
        else{
            // Overall screen resolution must be set initially to screen size for UI, then set to screen resolution while in game.
            screenSize = new Vector2(Screen.width, Screen.height);
            screenResolution = new Vector2(Screen.currentResolution.width, Screen.currentResolution.height);

            if(gameStateManagerRef.inUI){
                Screen.SetResolution((int)screenSize.x, (int)screenSize.y, gameStateManagerRef.fullScreen);
            }

            // Developer started in a level.
            else{
                Screen.SetResolution((int)screenResolution.x, (int)screenResolution.y, gameStateManagerRef.fullScreen);
            }
        }
    }
开发者ID:dindras234,项目名称:TearableWorld10-19-2015,代码行数:56,代码来源:ScreenManager.cs

示例9: Initialize

 public static void Initialize()
 {
     #if UNITY_ANDROID && !UNITY_EDITOR
         AndroidJavaClass jc = new AndroidJavaClass ("com.unity3d.player.UnityPlayer");
         mainActivity = jc.GetStatic<AndroidJavaObject> ("currentActivity");
         serverController = mainActivity.Get<AndroidJavaObject>("serverController");
         clientsController = mainActivity.Get<AndroidJavaObject>("clientsController");
     #endif
 }
开发者ID:thymen,项目名称:buffer_bci,代码行数:9,代码来源:FieldtripServicesControlerInterface.cs

示例10: Start

    /// <summary>
    /// Use this for initialization
    /// </summary>
    public void Start()
    {
        // Initialize the reference to the GameStateManager so that is actually points to it.
        gameStateManagerRef = gameObject.GetComponent<GameStateManager>();
        // start screen is always the first screen to be displayed so might as well load it here without any fancy footwork
        if (currentScreenArea.Equals(ScreenAreas.None))
        {
            gameObject.AddComponent<MainMenu>();
            activeScreen = gameObject.GetComponent("MainMenu") as MainMenu;
            currentScreenArea = ScreenAreas.MainMenu;
            screenOrientation = ScreenOrientation.Landscape;
            deviceOrientation = DeviceOrientation.LandscapeLeft;

            if (Application.platform.Equals(RuntimePlatform.Android))
            {
                using (AndroidJavaClass unityPlayerClass = new AndroidJavaClass("com.unity3d.player.UnityPlayer"),
                      metricsClass = new AndroidJavaClass("android.util.DisplayMetrics"))
                {
                    using (AndroidJavaObject metricsInstance = new AndroidJavaObject("android.util.DisplayMetrics"),
                            activityInstance = unityPlayerClass.GetStatic<AndroidJavaObject>("currentActivity"),
                            windowManagerInstance = activityInstance.Call<AndroidJavaObject>("getWindowManager"),
                            displayInstance = windowManagerInstance.Call<AndroidJavaObject>("getDefaultDisplay"))
                    {
                        displayInstance.Call("getMetrics", metricsInstance);
                        screenResolution.y = metricsInstance.Get<int>("heightPixels");
                        screenResolution.x = metricsInstance.Get<int>("widthPixels");
                        screenSize.x = Screen.width;
                        screenSize.y = Screen.height;
                        Screen.SetResolution((int)screenResolution.x, (int)screenResolution.y, true);
                        deviceOrientation = Input.deviceOrientation;
                    }
                }
            }

            else
            {
                // Overall screen resolution must be set initially to screen size for UI,
                // then set to screen resolution while in game
                screenSize = new Vector2(Screen.width, Screen.height);
                screenResolution = new Vector2(Screen.currentResolution.width, Screen.currentResolution.height);
                Screen.SetResolution((int)screenSize.x, (int)screenSize.y, gameStateManagerRef.fullScreen);
            }
        }
    }
开发者ID:dindras234,项目名称:TearableWorld10-19-2015,代码行数:47,代码来源:ScreenManager.cs

示例11: GetPushCache

		public static PlayFabNotificationPackage GetPushCache()
        {
			AndroidJavaObject package = new AndroidJavaObject("com.playfab.unityplugin.GCM.PlayFabNotificationPackage");
			package = PlayFabPushCacheClass.CallStatic<AndroidJavaObject>("getPushCache");
			
			PlayFabNotificationPackage cache = new PlayFabNotificationPackage();
			if(package != null)
			{
				cache.Title = package.Get<string>("Title");
				cache.Message = package.Get<string>("Message");
				cache.Icon = package.Get<string>("Icon");
				cache.Sound = package.Get<string>("Sound");
				cache.CustomData = package.Get<string>("CustomData");
			}
			else
			{
				Debug.Log("Package was null");
			}
			
			return cache;
        }
开发者ID:gabrielamboss,项目名称:Ulkoa,代码行数:21,代码来源:PlayFabAndroid.cs

示例12: init

	public static void init(){
		start_once=0;
		#if UNITY_EDITOR
		
		#elif UNITY_ANDROID
		
		javadivepluginclass = new AndroidJavaClass("com.shoogee.divejava.divejava") ;
		javaunityplayerclass= new AndroidJavaClass("com.unity3d.player.UnityPlayer");
		currentactivity = javaunityplayerclass.GetStatic<AndroidJavaObject>("currentActivity");
		javadiveplugininstance = javadivepluginclass.CallStatic<AndroidJavaObject>("instance");
		object[] args={currentactivity};
		javadiveplugininstance.Call<string>("set_activity",args);

		String answer;
		answer= javadiveplugininstance.Call<string>("setFullscreen");

		// Screen Metrics
		
		metricsClass= new AndroidJavaClass("android.util.DisplayMetrics");
		metricsInstance= new AndroidJavaObject("android.util.DisplayMetrics");
		windowManagerInstance=currentactivity.Call<AndroidJavaObject>("getWindowManager");
		displayInstance=windowManagerInstance.Call<AndroidJavaObject>("getDefaultDisplay");
		
		displayInstance.Call("getMetrics",metricsInstance);
		
		density=metricsInstance.Get<float>("density");
		densitydpi=metricsInstance.Get<int> ("densityDpi");
		vpixels=metricsInstance.Get<int>("heightPixels");
		vpixels=Screen.height;
		hpixels=metricsInstance.Get<int>("widthPixels");
		//hpixels=displayInstance.Call<int>("getWidth");
		hpixels=Screen.width;
		scaledDensity=metricsInstance.Get<float>("scaledDensity");
		xdpi=metricsInstance.Get<float>("xdpi");
		ydpi=metricsInstance.Get<float>("ydpi");
		xmm=hpixels/xdpi/0.0393701f;
		ymm=vpixels/ydpi/0.0393701f;
		
		#elif UNITY_IPHONE
		
		#endif 	
		initiated = true;
	}
开发者ID:MizoTake,项目名称:RemakePakure,代码行数:43,代码来源:DiveJava.cs

示例13: 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

示例14: 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

示例15: UpdateCodecOutput

    bool UpdateCodecOutput(AndroidJavaObject Decoder)
    {
        AndroidJavaObject BufferInfo = new AndroidJavaObject("android.media.MediaCodec$BufferInfo");

        //	returns status if not buffer index
        int OutputBufferIndex = Decoder.Call<int>("dequeueOutputBuffer", BufferInfo, TIMEOUT_USEC );

        //	got a format change, update texture etc
        if ( OutputBufferIndex == INFO_OUTPUT_FORMAT_CHANGED )
        {
            AndroidJavaObject MediaFormat = Decoder.Call<AndroidJavaObject>("getOutputFormat");
            if ( !ChangeFormat( MediaFormat ) )
                return false;

            return true;
        }

        bool Ready = true;
        switch ( OutputBufferIndex )
        {
        case INFO_TRY_AGAIN_LATER:
        case INFO_OUTPUT_BUFFERS_CHANGED:
        case INFO_OUTPUT_FORMAT_CHANGED:
        case OTHER_ERROR:
            Ready = false;
            break;

        default:
            if ( OutputBufferIndex < 0 )
                Ready = false;
            break;
        }

        if ( !Ready )
        {
            //Log ("Not ready to output yet... " + OutputBufferIndex);
            return true;
        }

        //Log ("got Output buffer #" + OutputBufferIndex);
        bool EndOfStream = (BufferInfo.Get<int>("flags") & BUFFER_FLAG_END_OF_STREAM) != 0;
        if ( EndOfStream )
        {
            Log ("end of output stream");
            return false;
        }

        //	grab buffer
        AndroidJavaObject Buffer = GetDecoderOutputBuffer (Decoder, OutputBufferIndex);
        if ( Buffer == null ) {
            Log ("failed to get output buffer #" + OutputBufferIndex);
            return false;
        }

        bool DoRender = ( BufferInfo.Get<int>("size") != 0 );
        //Log ("Got buffer: render? " + DoRender);

        //	gr: too big to copy to memory! over 1gb!?
        //	copy to texture
        int ByteLength = AndroidJNI.GetArrayLength (Buffer.GetRawObject ());
        Log ("Byte buffer length: " + ByteLength);
        //		byte[] Bytes = AndroidJNI.FromByteArray (Buffer.GetRawObject ());
        //byte[] Bytes = Buffer.Call<byte[]> ("array");
        //		Log ("Copy " + Bytes.Length + "bytes to texture!");

        // As soon as we call releaseOutputBuffer, the buffer will be forwarded
        // to SurfaceTexture to convert to a texture.  The API doesn't guarantee
        // that the texture will be available before the call returns, so we
        // need to wait for the onFrameAvailable callback to fire.
        Decoder.Call("releaseOutputBuffer", OutputBufferIndex, DoRender);
        glGetError("releaseOutputBuffer");
        mDecoder.SurfaceTexture.Call ("updateTexImage");
        glGetError ("updateTexImage");
        //	outputSurface.awaitNewImage();
        //	outputSurface.drawImage(true);

        return true;
    }
开发者ID:khaerul10056,项目名称:UnityAndroidVideoTexture,代码行数:78,代码来源:MediaCodec.cs


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