码迷,mamicode.com
首页 > 编程语言 > 详细

unity RenderTexture

时间:2017-05-31 12:14:08      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:tin   tco   赋值   component   摄像机   ret   get   sys   unit   

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

标签:tin   tco   赋值   component   摄像机   ret   get   sys   unit   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!