using System.Collections; using System.Collections.Generic; using UnityEngine; public class RenderTextureControl : MonoBehaviour { Camera cam; void Awake () { cam = GetComponent(); } IEnumerator RenderOneFrameToTexture() { yield return new WaitForEndOfFrame(); cam.enabled = false; } void OnEnable() { StartCoroutine(RenderOneFrameToTexture()); } void OnDisable() { cam.enabled = true; } }