示例#1
0
        private void InitInputs()
        {
            if (videoInput != null)
            {
                Destroy(videoInput);
            }

            if (audioInput != null)
            {
                Destroy(audioInput);
            }

            audioInput = gameObject.AddComponent <AudioInput>();

            switch (recorder.defaultVideoInput)
            {
            case VideoInputType.Screen:
                videoInput = gameObject.AddComponent <ScreenInput>();
                break;

            case VideoInputType.Camera360:
            case VideoInputType.Camera:
                videoInput = gameObject.AddComponent <CameraInput>();
                break;
            }

            videoInput.recorder = recorder;
            audioInput.recorder = recorder;
        }
示例#2
0
        private void InitInputs()
        {
            if (videoInput != null)
            {
                Destroy(videoInput);
            }

#if UNITY_2018_1_OR_NEWER
            if (audioInput != null)
            {
                Destroy(audioInput);
            }

            audioInput          = gameObject.AddComponent <AudioInput>();
            audioInput.encoder  = this;
            audioInput.recorder = recorder;
#endif

            switch (recorder.defaultVideoInput)
            {
            case VideoInputType.Screen:
                videoInput = gameObject.AddComponent <ScreenInput>();
                break;

#if UNITY_2018_1_OR_NEWER
            case VideoInputType.Camera360:
#endif
            case VideoInputType.Camera:
                videoInput = gameObject.AddComponent <CameraInput>();
                break;
            }

            videoInput.recorder = recorder;
        }