Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="EditorView"/> class.
        /// </summary>
        public EditorView(IEditorArea editorArea)
        {
            if (editorArea == null)
            {
                throw new ArgumentNullException("editorArea");
            }

            _editorArea = editorArea;

            _editorCommands     = EditorConnector.CreateEditorCommands(_editorArea);
            _editorKeyBinding   = new EditorKeyBinding(this);
            _editorMouseBinding = new EditorMouseBinding(this);

            InitializeComponent();
        }
        protected override void OnEnable()
        {
            base.OnEnable();
            hkToggleBezierAutoHandles = CurvyProject.Instance.RegisterKeyBinding(new EditorKeyBinding("Bezier: Toggle AutoHandles", "", KeyCode.H));

            tT0 = serializedObject.FindProperty("m_StartTension");
            tC0 = serializedObject.FindProperty("m_StartContinuity");
            tB0 = serializedObject.FindProperty("m_StartBias");
            tT1 = serializedObject.FindProperty("m_EndTension");
            tC1 = serializedObject.FindProperty("m_EndContinuity");
            tB1 = serializedObject.FindProperty("m_EndBias");
            tOT = serializedObject.FindProperty("m_OverrideGlobalTension");
            tOC = serializedObject.FindProperty("m_OverrideGlobalContinuity");
            tOB = serializedObject.FindProperty("m_OverrideGlobalBias");

            EditorApplication.hierarchyWindowItemOnGUI -= OnHierarchyWindowItemOnGUI;
            EditorApplication.hierarchyWindowItemOnGUI += OnHierarchyWindowItemOnGUI;

            mBezierRot = Quaternion.identity;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="EditorView"/> class.
        /// </summary>
        public EditorView(IEditorArea editorArea)
        {
            if (editorArea == null)
            {
                throw new ArgumentNullException("editorArea");
            }

            _editorArea = editorArea;

            _editorCommands = EditorConnector.CreateEditorCommands(_editorArea);
            _editorKeyBinding = new EditorKeyBinding(this);
            _editorMouseBinding = new EditorMouseBinding(this);

            InitializeComponent();
        }