首页 > 编程语言 > 详细

unity RenderTexture

时间:2017-05-31 11:48:26      阅读:444      评论:0      收藏:0      [点我收藏+]

using UnityEngine;
using System.Collections;

public class RenderTextureTest : MonoBehaviour
{
private RenderTexture RT;
// Use this for initialization
void Start()
{
RT = new RenderTexture(256, 128, 16, RenderTextureFormat.ARGB32);
RT.Create();

GetComponentInChildren<Camera>().targetTexture = RT;
}

对于RenderTexture这个东西一直很是不解,因为他没有具体的赋值方法,对api一番试用后,大概知道它里面是自动赋值的。赋值的过程应该是在获取到摄像机后等于RenderTexture之时就把摄像机画面赋予它。这跟我们传统的把右边的赋值给左边有点不同,不知道是我理解错误还是这个api确实有些特殊。

 

unity RenderTexture

原文:http://www.cnblogs.com/joson/p/6923070.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!