void Awake() { obj = GameObject.Find(objName); if (obj == null) { obj = gameObject; obj.name = objName; DontDestroyOnLoad(obj); System.IO.Directory.CreateDirectory(screenshotDirectory); pictureCount = 0; videoCap = gameObject.AddComponent <CaptureFromScreen>(); videoCap._useMediaFoundationH264 = true; videoCap._outputFolderPath = videoDirectory; videoCap._autoFilenameExtension = "mp4"; } else if (obj != gameObject) { Destroy(gameObject); } }
private void Awake() { capture = GetComponent <CaptureFromScreen>(); }