Created
August 1, 2020 11:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//「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