using System; using UnityEditor.Recorder.Input; using UnityEngine; namespace UnityEditor.Recorder { /// /// This class is a specialization of InputSettingsSelector for image input types. /// [Serializable] public class ImageInputSelector : InputSettingsSelector { /// /// The settings when the input is set to Game View. /// [SerializeField] public GameViewInputSettings gameViewInputSettings = new GameViewInputSettings(); /// /// The settings when the input is set to Targeted Camera. /// [SerializeField] public CameraInputSettings cameraInputSettings = new CameraInputSettings(); /// /// The settings when the input is set to 360 View. /// [SerializeField] public Camera360InputSettings camera360InputSettings = new Camera360InputSettings(); /// /// The settings when the input is set to Render Texture Asset. /// [SerializeField] public RenderTextureInputSettings renderTextureInputSettings = new RenderTextureInputSettings(); /// /// The settings when the input is set to Texture Sampling. /// [SerializeField] public RenderTextureSamplerSettings renderTextureSamplerSettings = new RenderTextureSamplerSettings(); /// /// Use this property to set and retrieve the input settings of the currently selected image. /// Supported input types are: CameraInputSettings, GameViewInputSettings, Camera360InputSettings, RenderTextureInputSettings, RenderTextureSamplerSettings. /// /// Thrown when the value is null. /// Thrown when the value is not a supported ImageInputSettings type. public ImageInputSettings ImageInputSettings { get { return (ImageInputSettings)Selected; } set { if (value == null) throw new ArgumentNullException("value"); if (value is CameraInputSettings || value is GameViewInputSettings || value is Camera360InputSettings || value is RenderTextureInputSettings || value is RenderTextureSamplerSettings) { Selected = value; } else { throw new ArgumentException("Video input type not supported: '" + value.GetType() + "'"); } } } } [Serializable] class UTJImageInputSelector : InputSettingsSelector { [SerializeField] public CameraInputSettings cameraInputSettings = new CameraInputSettings(); [SerializeField] public RenderTextureInputSettings renderTextureInputSettings = new RenderTextureInputSettings(); [SerializeField] public RenderTextureSamplerSettings renderTextureSamplerSettings = new RenderTextureSamplerSettings(); public ImageInputSettings imageInputSettings { get { return (ImageInputSettings)Selected; } set { if (value == null) throw new ArgumentNullException("value"); if (value is CameraInputSettings || value is RenderTextureInputSettings || value is RenderTextureSamplerSettings) { Selected = value; } else { throw new ArgumentException("Video input type not supported: '" + value.GetType() + "'"); } } } } }