Hi ArenMook,
I have attempted the following:
I have a game object in the Hierarchy named "NGUIObject" - I have attached a component UITexture to it.
I have created a UI Root (2D) and it simply contains 1 single label.
I have attached the following script to "NGUIObject"
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;
}
}
When I run it, I can see in the Inspector for "NGUIObject" that the texture is being assigned to the Texture in UITexture - but I am seeing nothing on the screen.
Am I missing a step somewhere?
Thanks again,
J.