small fixes & cleanup
This commit is contained in:
parent
882f70be0b
commit
694dab564d
5 changed files with 60 additions and 52 deletions
|
@ -6,12 +6,16 @@ public class Screenshot : MonoBehaviour
|
|||
public bool takeScreenshot;
|
||||
public string filename = "unity_screenshot.png";
|
||||
|
||||
public RenderTexture textureReference;
|
||||
|
||||
void Start()
|
||||
{
|
||||
if (takeScreenshot)
|
||||
{
|
||||
Camera cam = GetComponent<Camera>();
|
||||
|
||||
cam.targetTexture = textureReference;
|
||||
|
||||
RenderTexture currentRT = RenderTexture.active;
|
||||
RenderTexture.active = cam.targetTexture;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue