using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class GetCameraRenderer : MonoBehaviour
{
public RenderTexture _renderTexture;
public Camera _mainCamera;
public Camera _childCamera;
public RenderTexture renderTexture;
public RawImage left;
public RawImage right;
public void Start()
{
if (_mainCamera)
{
renderTexture = new RenderTexture(Screen.width,Screen.height,24);
_mainCamera.targetTexture= renderTexture;
_mainCamera.Render();
RenderTexture.active = renderTexture;
if(left)
left.texture = renderTexture;
}
if (_childCamera)
{
_childCamera.targetTexture = renderTexture;
if (right)
right.texture = _childCamera.targetTexture;
}
}
}