Exemplo n.º 1
0
        private void DrawAssetMappingList()
        {
            GUILayout.BeginVertical(GUI.skin.box);
            GUILayout.BeginHorizontal();

            GUILayout.Label("Audio Asset Mappings");


            if (GUILayout.Button("Nuke"))
            {
                ScriptableObject.CreateInstance <ConfirmActionPopup>()
                .SetQuestion("You're about to nuke all elements from this library, are you sure?")
                .CenterOnRect(_currentWindow.position)
                .OnConfirm += DeleteAllElements;
            }

            if (GUILayout.Button("Remove"))
            {
                RemoveSelectedElement();
            }

            if (GUILayout.Button("Add"))
            {
                EditorWindow.CreateInstance <CreateAudioAssetPopup>()
                .SetFolder("Assets/Audio/AudioAssets/")
                .CenterOnRect(_currentWindow.position)
                .OnCreated += AddElement;
            }
            GUILayout.EndHorizontal();
            _SelectableAudioAssetList.DoList(_MappingList.arraySize, _ScrollVector);
            GUILayout.EndVertical();
        }
Exemplo n.º 2
0
        public void DrawClipList()
        {
            GUILayout.BeginVertical(GUI.skin.box);
            GUILayout.BeginHorizontal();
            GUILayout.Label("Sound clips");

            if (GUILayout.Button("Nuke"))
            {
                EditorWindow.CreateInstance <ConfirmActionPopup>()
                .SetQuestion("You're about to remove all soundclips. Are you sure?")
                .CenterOnRect(_CurrentWindow.position)
                .OnConfirm += RemoveAllElements;
            }

            if (GUILayout.Button("Remove"))
            {
                RemoveElement();
            }

            if (GUILayout.Button("Add"))
            {
                AddElement();
            }
            GUILayout.EndHorizontal();


            _SelectableList.DoList(_ClipList.arraySize, _ScrollVector);
            GUILayout.EndVertical();

            AudioClip[] audioclips = EditorScriptUtil.FilteredDrop <AudioClip>();

            if (audioclips != null)
            {
                foreach (AudioClip clip in audioclips)
                {
                    AddClip(clip);
                }
            }
        }
Exemplo n.º 3
0
        public void DoList()
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label($"{nameof(AudioLibraryList)}");

            if (GUILayout.Button("Create New Library"))
            {
                EditorWindow.CreateInstance <CreateAudioLibraryAssetPopup>()
                .SetFolder("Assets/Audio/Resources/")
                .CenterOnRect(_CurrentWindow.position)
                .OnCreated += OnNewElementcreated;
            }

            if (GUILayout.Button("Delete"))
            {
                RemoveSelectedElement();
            }

            GUILayout.EndHorizontal();
            _ScrollPosition = EditorGUILayout.BeginScrollView(_ScrollPosition);
            _SelectionList.DoList(_AssetLabels.Length, _ScrollPosition);
            EditorGUILayout.EndScrollView();
        }