Unity RenderTexture 当作为 Camera.targetTexture 时,在某些安卓手机或模拟器无法显示

Camera.clearFlags 必须为 CameraClearFlags.Depth ,CameraClearFlags.Nothing 时会不显示

using UnityEngine;
using UnityEngine.UI;

public class Test:MonoBehaviour{
	
	public RawImage rawImage;
	public Camera cam;

	private RenderTexture m_renderTexture;
	
	private void Start(){
		m_renderTexture=new RenderTexture(512,512,16,RenderTextureFormat.ARGB32);

		rawImage.texture=m_renderTexture;
		cam.targetTexture=m_renderTexture;
		//必须为 CameraClearFlags.Depth ,CameraClearFlags.Nothing 时会不显示
		cam.clearFlags=CameraClearFlags.Depth;
	}
}

Unity RenderTexture 当作为 Camera.targetTexture 时,在某些安卓手机或模拟器无法显示

上一篇:android--check-box小练习


下一篇:Android开发——自定义view之京东淘宝首页二级联动