protected override void OnBeginAction(CamViewState.ObjectAction action) { base.OnBeginAction(action); bool shapeAction = action != ObjectAction.RectSelect && action != ObjectAction.None; if (this.selectedBody != null && shapeAction) { this.selectedBody.BeginUpdateBodyShape(); } }
protected override void OnBeginAction(CamViewState.ObjectAction action) { base.OnBeginAction(action); bool shapeAction = action != ObjectAction.RectSelect && action != ObjectAction.None; if (this.selectedBody != null && shapeAction) { this.selectedBody.BeginUpdateBodyShape(); this.EditingUserGuide.SnapPosOrigin = this.selectedBody.GameObj.Transform.Pos; this.EditingUserGuide.SnapScaleOrigin = Vector3.One * this.selectedBody.GameObj.Transform.Scale; } }
protected override void OnEndAction(CamViewState.ObjectAction action) { base.OnEndAction(action); bool shapeAction = action != ObjectAction.RectSelect && action != ObjectAction.None; if (this.selectedBody != null && shapeAction) { this.selectedBody.EndUpdateBodyShape(); } if (this.createAction) { this.createAction = false; UndoRedoManager.EndMacro(UndoRedoManager.MacroDeriveName.FromFirst); } }
protected override void OnEndAction(CamViewState.ObjectAction action) { base.OnEndAction(action); bool shapeAction = action != ObjectAction.RectSelect && action != ObjectAction.None; if (this.selectedBody != null && shapeAction) { this.selectedBody.EndUpdateBodyShape(); } if (this.createAction) { this.createAction = false; UndoRedoManager.EndMacro(UndoRedoManager.MacroDeriveName.FromFirst); } this.EditingUserGuide.SnapPosOrigin = Vector3.Zero; this.EditingUserGuide.SnapScaleOrigin = Vector3.One; }
protected override void PostPerformAction(IEnumerable <CamViewState.SelObj> selObjEnum, CamViewState.ObjectAction action) { base.PostPerformAction(selObjEnum, action); SelShape[] selShapeArray = selObjEnum.OfType <SelShape>().ToArray(); // Update the body directly after modifying it if (this.selectedBody != null) { this.selectedBody.SynchronizeBodyShape(); } // Notify property changes DualityEditorApp.NotifyObjPropChanged(this, new ObjectSelection(this.selectedBody), ReflectionInfo.Property_RigidBody_Shapes); DualityEditorApp.NotifyObjPropChanged(this, new ObjectSelection(selShapeArray.Select(s => s.ActualObject))); }
protected override void PostPerformAction(IEnumerable <CamViewState.SelObj> selObjEnum, CamViewState.ObjectAction action) { base.PostPerformAction(selObjEnum, action); if (action == ObjectAction.Move) { DualityEditorApp.NotifyObjPropChanged( this, new ObjectSelection(selObjEnum.Select(s => (s.ActualObject as GameObject).Transform)), ReflectionInfo.Property_Transform_RelativePos); } else if (action == ObjectAction.Rotate) { DualityEditorApp.NotifyObjPropChanged( this, new ObjectSelection(selObjEnum.Select(s => (s.ActualObject as GameObject).Transform)), ReflectionInfo.Property_Transform_RelativePos, ReflectionInfo.Property_Transform_RelativeAngle); } else if (action == ObjectAction.Scale) { DualityEditorApp.NotifyObjPropChanged( this, new ObjectSelection(selObjEnum.Select(s => (s.ActualObject as GameObject).Transform)), ReflectionInfo.Property_Transform_RelativePos, ReflectionInfo.Property_Transform_RelativeScale); } }