Пример #1
0
        void OnEnable()
        {
            _deviceSelection        = serializedObject.FindProperty("_deviceSelection");
            _queueLength            = serializedObject.FindProperty("_queueLength");
            _targetTexture          = serializedObject.FindProperty("_targetTexture");
            _targetRenderer         = serializedObject.FindProperty("_targetRenderer");
            _targetMaterialProperty = serializedObject.FindProperty("_targetMaterialProperty");

            // Scan all available devices.
            var devices = DeviceEnumerator.GetDeviceNames();

            _deviceLabels  = devices.Select((x) => new GUIContent(x)).ToArray();
            _deviceOptions = Enumerable.Range(0, devices.Length).ToArray();
        }
Пример #2
0
        void OnEnable()
        {
            _deviceSelection = serializedObject.FindProperty("_deviceSelection");
            _formatSelection = serializedObject.FindProperty("_formatSelection");
            _queueLength     = serializedObject.FindProperty("_queueLength");
            _lowLatencyMode  = serializedObject.FindProperty("_lowLatencyMode");
            _isMaster        = serializedObject.FindProperty("_isMaster");

            // Scan all available devices.
            var devices = DeviceEnumerator.GetDeviceNames();

            _deviceLabels = devices.Select((x) => new GUIContent(x)).ToArray();
            _deviceValues = Enumerable.Range(0, devices.Length).ToArray();

            CacheFormats(_deviceSelection.intValue);
        }