/*
             * [CompilerGenerated]
             * private static GenericMenu.MenuFunction2 <>f__mg$cache0;
             *
             * [CompilerGenerated]
             * private static GenericMenu.MenuFunction2 <>f__mg$cache1;
             *
             * [CompilerGenerated]
             * private static GenericMenu.MenuFunction2 <>f__mg$cache2;
             *
             * [CompilerGenerated]
             * private static GenericMenu.MenuFunction2 <>f__mg$cache3;
             */

            public static void Show(Rect buttonRect, AudioMixerSnapshotController snapshot, AudioMixerSnapshotListView list)
            {
                GenericMenu genericMenu = new GenericMenu();

                AudioMixerSnapshotListView.SnapshotMenu.data userData = new AudioMixerSnapshotListView.SnapshotMenu.data
                {
                    snapshot = snapshot,
                    list     = list
                };
                GenericMenu arg_49_0 = genericMenu;
                GUIContent  arg_49_1 = EditorGUIUtility.TrTextContent("Set as start Snapshot", null, null);
                bool        arg_49_2 = false;

                /*
                 * if (AudioMixerSnapshotListView.SnapshotMenu.<>f__mg$cache0 == null)
                 * {
                 *      AudioMixerSnapshotListView.SnapshotMenu.<>f__mg$cache0 = new GenericMenu.MenuFunction2(AudioMixerSnapshotListView.SnapshotMenu.SetAsStartupSnapshot);
                 * }
                 * arg_49_0.AddItem(arg_49_1, arg_49_2, AudioMixerSnapshotListView.SnapshotMenu.<>f__mg$cache0, userData);
                 */
                genericMenu.AddSeparator("");
                GenericMenu arg_85_0 = genericMenu;
                GUIContent  arg_85_1 = EditorGUIUtility.TrTextContent("Rename", null, null);
                bool        arg_85_2 = false;

                /*
                 * if (AudioMixerSnapshotListView.SnapshotMenu.<>f__mg$cache1 == null)
                 * {
                 *      AudioMixerSnapshotListView.SnapshotMenu.<>f__mg$cache1 = new GenericMenu.MenuFunction2(AudioMixerSnapshotListView.SnapshotMenu.Rename);
                 * }
                 * arg_85_0.AddItem(arg_85_1, arg_85_2, AudioMixerSnapshotListView.SnapshotMenu.<>f__mg$cache1, userData);
                 */
                GenericMenu arg_B6_0 = genericMenu;
                GUIContent  arg_B6_1 = EditorGUIUtility.TrTextContent("Duplicate", null, null);
                bool        arg_B6_2 = false;

                /*
                 * if (AudioMixerSnapshotListView.SnapshotMenu.<>f__mg$cache2 == null)
                 * {
                 *      AudioMixerSnapshotListView.SnapshotMenu.<>f__mg$cache2 = new GenericMenu.MenuFunction2(AudioMixerSnapshotListView.SnapshotMenu.Duplicate);
                 * }
                 * arg_B6_0.AddItem(arg_B6_1, arg_B6_2, AudioMixerSnapshotListView.SnapshotMenu.<>f__mg$cache2, userData);
                 */
                GenericMenu arg_E7_0 = genericMenu;
                GUIContent  arg_E7_1 = EditorGUIUtility.TrTextContent("Delete", null, null);
                bool        arg_E7_2 = false;

                /*
                 * if (AudioMixerSnapshotListView.SnapshotMenu.<>f__mg$cache3 == null)
                 * {
                 *      AudioMixerSnapshotListView.SnapshotMenu.<>f__mg$cache3 = new GenericMenu.MenuFunction2(AudioMixerSnapshotListView.SnapshotMenu.Delete);
                 * }
                 * arg_E7_0.AddItem(arg_E7_1, arg_E7_2, AudioMixerSnapshotListView.SnapshotMenu.<>f__mg$cache3, userData);
                 */
                genericMenu.DropDown(buttonRect);
            }
Exemple #2
0
            public static void Show(Rect buttonRect, AudioMixerSnapshotController snapshot, AudioMixerSnapshotListView list)
            {
                GenericMenu menu     = new GenericMenu();
                data        userData = new data {
                    snapshot = snapshot,
                    list     = list
                };

                if (< > f__mg$cache0 == null)
                {
Exemple #3
0
 private int GetSnapshotIndex(AudioMixerSnapshotController snapshot)
 {
     for (int i = 0; i < this.m_Snapshots.Count; i++)
     {
         if (this.m_Snapshots[i] == snapshot)
         {
             return(i);
         }
     }
     return(0);
 }
 private int GetSnapshotIndex(AudioMixerSnapshotController snapshot)
 {
     for (int index = 0; index < this.m_Snapshots.Count; ++index)
     {
         if ((UnityEngine.Object) this.m_Snapshots[index] == (UnityEngine.Object)snapshot)
         {
             return(index);
         }
     }
     return(0);
 }
Exemple #5
0
 private void DeleteSnapshot(AudioMixerSnapshotController snapshot)
 {
     AudioMixerSnapshotController[] snapshots = this.m_Controller.snapshots;
     if (snapshots.Length <= 1)
     {
         Debug.Log("You must have at least 1 snapshot in an AudioMixer.");
         return;
     }
     this.m_Controller.RemoveSnapshot(snapshot);
     this.LoadFromBackend();
     this.m_ReorderableListWithRenameAndScrollView.list.index = this.GetSnapshotIndex(this.m_Controller.TargetSnapshot);
     this.UpdateViews();
 }
Exemple #6
0
        private int GetSnapshotIndex(AudioMixerSnapshotController snapshot)
        {
            int result;

            for (int i = 0; i < this.m_Snapshots.Count; i++)
            {
                if (this.m_Snapshots[i] == snapshot)
                {
                    result = i;
                    return(result);
                }
            }
            result = 0;
            return(result);
        }
            public static void Show(Rect buttonRect, AudioMixerSnapshotController snapshot, AudioMixerSnapshotListView list)
            {
                GenericMenu menu     = new GenericMenu();
                data        userData = new data {
                    snapshot = snapshot,
                    list     = list
                };

                menu.AddItem(new GUIContent("Set as start Snapshot"), false, new GenericMenu.MenuFunction2(AudioMixerSnapshotListView.SnapshotMenu.SetAsStartupSnapshot), userData);
                menu.AddSeparator(string.Empty);
                menu.AddItem(new GUIContent("Rename"), false, new GenericMenu.MenuFunction2(AudioMixerSnapshotListView.SnapshotMenu.Rename), userData);
                menu.AddItem(new GUIContent("Duplicate"), false, new GenericMenu.MenuFunction2(AudioMixerSnapshotListView.SnapshotMenu.Duplicate), userData);
                menu.AddItem(new GUIContent("Delete"), false, new GenericMenu.MenuFunction2(AudioMixerSnapshotListView.SnapshotMenu.Delete), userData);
                menu.DropDown(buttonRect);
            }
            public static void Show(Rect buttonRect, AudioMixerSnapshotController snapshot, AudioMixerSnapshotListView list)
            {
                GenericMenu genericMenu = new GenericMenu();

                AudioMixerSnapshotListView.SnapshotMenu.data userData = new AudioMixerSnapshotListView.SnapshotMenu.data
                {
                    snapshot = snapshot,
                    list     = list
                };
                GenericMenu arg_47_0 = genericMenu;
                GUIContent  arg_47_1 = new GUIContent("Set as start Snapshot");
                bool        arg_47_2 = false;

                if (AudioMixerSnapshotListView.SnapshotMenu.< > f__mg$cache0 == null)
                {
                    AudioMixerSnapshotListView.SnapshotMenu.< > f__mg$cache0 = new GenericMenu.MenuFunction2(AudioMixerSnapshotListView.SnapshotMenu.SetAsStartupSnapshot);
                }
                arg_47_0.AddItem(arg_47_1, arg_47_2, AudioMixerSnapshotListView.SnapshotMenu.< > f__mg$cache0, userData);
                genericMenu.AddSeparator("");
                GenericMenu arg_81_0 = genericMenu;
                GUIContent  arg_81_1 = new GUIContent("Rename");
                bool        arg_81_2 = false;

                if (AudioMixerSnapshotListView.SnapshotMenu.< > f__mg$cache1 == null)
                {
                    AudioMixerSnapshotListView.SnapshotMenu.< > f__mg$cache1 = new GenericMenu.MenuFunction2(AudioMixerSnapshotListView.SnapshotMenu.Rename);
                }
                arg_81_0.AddItem(arg_81_1, arg_81_2, AudioMixerSnapshotListView.SnapshotMenu.< > f__mg$cache1, userData);
                GenericMenu arg_B0_0 = genericMenu;
                GUIContent  arg_B0_1 = new GUIContent("Duplicate");
                bool        arg_B0_2 = false;

                if (AudioMixerSnapshotListView.SnapshotMenu.< > f__mg$cache2 == null)
                {
                    AudioMixerSnapshotListView.SnapshotMenu.< > f__mg$cache2 = new GenericMenu.MenuFunction2(AudioMixerSnapshotListView.SnapshotMenu.Duplicate);
                }
                arg_B0_0.AddItem(arg_B0_1, arg_B0_2, AudioMixerSnapshotListView.SnapshotMenu.< > f__mg$cache2, userData);
                GenericMenu arg_DF_0 = genericMenu;
                GUIContent  arg_DF_1 = new GUIContent("Delete");
                bool        arg_DF_2 = false;

                if (AudioMixerSnapshotListView.SnapshotMenu.< > f__mg$cache3 == null)
                {
                    AudioMixerSnapshotListView.SnapshotMenu.< > f__mg$cache3 = new GenericMenu.MenuFunction2(AudioMixerSnapshotListView.SnapshotMenu.Delete);
                }
                arg_DF_0.AddItem(arg_DF_1, arg_DF_2, AudioMixerSnapshotListView.SnapshotMenu.< > f__mg$cache3, userData);
                genericMenu.DropDown(buttonRect);
            }
            static public void Show(Rect buttonRect, AudioMixerSnapshotController snapshot, AudioMixerSnapshotListView list)
            {
                var  menu  = new GenericMenu();
                data input = new data()
                {
                    snapshot = snapshot, list = list
                };

                menu.AddItem(EditorGUIUtility.TrTextContent("Set as start Snapshot"), false, SetAsStartupSnapshot, input);
                menu.AddSeparator("");
                menu.AddItem(EditorGUIUtility.TrTextContent("Rename"), false, Rename, input);
                menu.AddItem(EditorGUIUtility.TrTextContent("Duplicate"), false, Duplicate, input);
                menu.AddItem(EditorGUIUtility.TrTextContent("Delete"), false, Delete, input);

                menu.DropDown(buttonRect);
            }
 void Rename(AudioMixerSnapshotController snapshot)
 {
     m_ReorderableListWithRenameAndScrollView.BeginRename(GetSnapshotIndex(snapshot), 0f);
 }
 void SetAsStartupSnapshot(AudioMixerSnapshotController snapshot)
 {
     Undo.RecordObject(m_Controller, "Set start snapshot");
     m_Controller.startSnapshot = snapshot;
 }
Exemple #12
0
 private void SetAsStartupSnapshot(AudioMixerSnapshotController snapshot)
 {
     this.m_Controller.startSnapshot = snapshot;
 }
 private void Rename(AudioMixerSnapshotController snapshot)
 {
     this.m_ReorderableListWithRenameAndScrollView.BeginRename(this.GetSnapshotIndex(snapshot), 0.0f);
 }