Exemplo n.º 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()
        {
            AudioClip audioClip           = InspectedObject as AudioClip;
            AudioClipImportOptions output = null;

            if (audioClip != null)
            {
                LibraryEntry meshEntry = ProjectLibrary.GetEntry(ProjectLibrary.GetPath(audioClip));
                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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 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 = (AudioBitDepth)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);
        }
Exemplo n.º 5
0
 private static extern void Internal_CreateInstance(AudioClipImportOptions instance);
Exemplo n.º 6
0
 private static extern void Internal_create(AudioClipImportOptions managedInstance);