Esempio n. 1
0
        private void HandleCopyPaste()
        {
            if (Event.current.type == EventType.ValidateCommand || Event.current.type == EventType.ExecuteCommand)
            {
                switch (Event.current.commandName)
                {
                case EventCommandNames.Copy:
                    if (Event.current.type == EventType.ExecuteCommand)
                    {
                        if (m_State.showCurveEditor)
                        {
                            UpdateSelectedKeysFromCurveEditor();
                        }
                        m_State.CopyKeys();
                    }
                    Event.current.Use();
                    break;

                case EventCommandNames.Paste:
                    if (Event.current.type == EventType.ExecuteCommand)
                    {
                        SaveCurveEditorKeySelection();
                        m_State.PasteKeys();
                        UpdateSelectedKeysToCurveEditor();

                        // data is scheduled for an update, bail out now to avoid using out of date data.
                        EditorGUIUtility.ExitGUI();
                    }
                    Event.current.Use();
                    break;
                }
            }
        }