コード例 #1
0
ファイル: Gizmo.cs プロジェクト: PawelPajor/agaq-builder
        protected virtual void OnInputDeviceFirstButtonUp()
        {
            // If the objects were transformed since the left mouse button was pressed, we will
            // take a snapshot of all game objects which were transformed and then use the pre
            // and post transform snapshots to execute a post gizmo transformed objects action.
            if (_objectsWereTransformedSinceLeftMouseButtonWasPressed)
            {
                // Create post transform snapshots
                TakeObjectTransformSnapshots(out _postTransformObjectSnapshots);

                // Execute a post gizmo transformed objects action
                var action = new PostGizmoTransformedObjectsAction(_preTransformObjectSnapshots, _postTransformObjectSnapshots, this);
                action.Execute();

                // Reset for the next transform session
                _objectsWereTransformedSinceLeftMouseButtonWasPressed = false;
            }

            /*_isDragging = false;
             * if (GizmoDragEnd != null && IsReadyForObjectManipulation()) GizmoDragEnd(this);*/
            if (_isDragging)
            {
                _isDragging = false;
                if (GizmoDragEnd != null)
                {
                    GizmoDragEnd(this);
                }
            }
        }
コード例 #2
0
 public void StoreObjectsTransform()  //pre+post构成一组撤销
 {
     TakeObjectTransformSnapshots(out _postTransformObjectSnapshots);
     // Execute a post gizmo transformed objects action
     if (_preTransformObjectSnapshots != null && _postTransformObjectSnapshots != null)
     {
         var action = new PostGizmoTransformedObjectsAction(_preTransformObjectSnapshots, _postTransformObjectSnapshots, this);
         action.Execute();
     }
 }