Skip to content

Instantly share code, notes, and snippets.

@krasushim
Created August 1, 2020 11:25
//「Sub Scene Controller.cs」でシーンのカメラ映像を予め用意したRenderTextureに書き出しする.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class SubSceneController : MonoBehaviour
{
[SerializeField] Camera sceneCamera; //インスペクター上から設定しましょう
[SerializeField] RenderTexture outputTexture;//インスペクター上から設定しましょう
void Start()
{
// この1行だけでOK
sceneCamera.targetTexture = outputTexture;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment