Beispiel #1
0
        /// <summary>
        /// Retrieves import options for the audio clip we're currently inspecting.
        /// </summary>
        /// <returns>Audio clip import options object.</returns>
        private AudioClipImportOptions GetImportOptions()
        {
            AudioClipImportOptions output = null;

            LibraryEntry meshEntry = ProjectLibrary.GetEntry(InspectedResourcePath);

            if (meshEntry != null && meshEntry.Type == LibraryEntryType.File)
            {
                FileEntry meshFileEntry = (FileEntry)meshEntry;
                output = meshFileEntry.Options as AudioClipImportOptions;
            }

            if (output == null)
            {
                if (importOptions == null)
                {
                    output = new AudioClipImportOptions();
                }
                else
                {
                    output = importOptions;
                }
            }

            return(output);
        }
Beispiel #2
0
        /// <inheritdoc/>
        protected internal override InspectableState Refresh()
        {
            AudioClipImportOptions newImportOptions = GetImportOptions();

            formatField.Value   = (ulong)newImportOptions.Format;
            readModeField.Value = (ulong)newImportOptions.ReadMode;
            bitDepthField.Value = (ulong)newImportOptions.BitDepth;
            is3DField.Value     = newImportOptions.Is3D;

            importOptions = newImportOptions;

            return(InspectableState.NotModified);
        }
Beispiel #3
0
        /// <inheritdoc/>
        protected internal override void Initialize()
        {
            importOptions = GetImportOptions();

            formatField.OnSelectionChanged   += x => importOptions.Format = (AudioFormat)x;
            readModeField.OnSelectionChanged += x => importOptions.ReadMode = (AudioReadMode)x;
            bitDepthField.OnSelectionChanged += x => importOptions.BitDepth = (int)x;
            is3DField.OnChanged += x => importOptions.Is3D = x;

            Layout.AddElement(formatField);
            Layout.AddElement(readModeField);
            Layout.AddElement(bitDepthField);
            Layout.AddElement(is3DField);
            Layout.AddSpace(10);

            reimportButton = new GUIReimportButton(InspectedResourcePath, Layout, () =>
            {
                ProjectLibrary.Reimport(InspectedResourcePath, importOptions, true);
            });

            UpdateGUIValues();
        }
Beispiel #4
0
        /// <inheritdoc/>
        protected internal override void Initialize()
        {
            importOptions = GetImportOptions();

            formatField.OnSelectionChanged   += x => importOptions.Format = (AudioFormat)x;
            readModeField.OnSelectionChanged += x => importOptions.ReadMode = (AudioReadMode)x;
            bitDepthField.OnSelectionChanged += x => importOptions.BitDepth = (int)x;
            is3DField.OnChanged += x => importOptions.Is3D = x;

            reimportButton.OnClick += TriggerReimport;

            Layout.AddElement(formatField);
            Layout.AddElement(readModeField);
            Layout.AddElement(bitDepthField);
            Layout.AddElement(is3DField);
            Layout.AddSpace(10);

            GUILayout reimportButtonLayout = Layout.AddLayoutX();

            reimportButtonLayout.AddFlexibleSpace();
            reimportButtonLayout.AddElement(reimportButton);
        }
 private static extern void Internal_create(AudioClipImportOptions managedInstance);