using UnityEngine;
using System.Collections;
public class CameraToTexture : MonoBehaviour {
public Camera NGUICamera;
RenderTexture rt;
UITexture uiTexture;
void Start () {
uiTexture = gameObject.GetComponent<UITexture>();
rt
= new RenderTexture
(Screen
.width, Screen
.height,
24); NGUICamera.targetTexture = rt;
uiTexture.mainTexture = rt;
}
}