void HandleCommandEvents(int treeViewKeyboardControlID)
        {
            if (GUIUtility.keyboardControl != treeViewKeyboardControlID)
            {
                return;
            }

            EventType eventType = Event.current.type;

            if (eventType == EventType.ExecuteCommand || eventType == EventType.ValidateCommand)
            {
                bool execute = eventType == EventType.ExecuteCommand;

                if (Event.current.commandName == EventCommandNames.Delete || Event.current.commandName == EventCommandNames.SoftDelete)
                {
                    Event.current.Use();
                    if (execute)
                    {
                        ProjectWindowUtil.DeleteAssets(m_TreeView.GetSelection().ToList(), true);
                    }
                }
                else if (Event.current.commandName == EventCommandNames.Duplicate)
                {
                    Event.current.Use();
                    if (execute)
                    {
                        ProjectWindowUtil.DuplicateAssets(m_TreeView.GetSelection());
                    }
                }
            }
        }
Exemplo n.º 2
0
 private void HandleCommandEvents(int treeViewKeyboardControlID)
 {
     if (GUIUtility.keyboardControl == treeViewKeyboardControlID)
     {
         EventType type = Event.current.type;
         if (type == EventType.ExecuteCommand || type == EventType.ValidateCommand)
         {
             bool flag = type == EventType.ExecuteCommand;
             if (Event.current.commandName == "Delete" || Event.current.commandName == "SoftDelete")
             {
                 Event.current.Use();
                 if (flag)
                 {
                     ProjectWindowUtil.DeleteAssets(this.m_TreeView.GetSelection().ToList <int>(), true);
                 }
             }
             else if (Event.current.commandName == "Duplicate")
             {
                 Event.current.Use();
                 if (flag)
                 {
                     ProjectWindowUtil.DuplicateAssets(this.m_TreeView.GetSelection());
                 }
             }
         }
     }
 }
        public void DeleteAudioMixerCallback(object obj)
        {
            AudioMixerController controller = (AudioMixerController)obj;

            if (controller != null)
            {
                ProjectWindowUtil.DeleteAssets(new[] { controller.GetInstanceID() }.ToList(), true);
            }
        }