public TransformManager(GameEditor edit) { ma = new MoveArrows(); rc = new RotateCircles(); editor = edit; currentState = TransformManagerState.select; activeObject = new ObjectContainer(); GameEngine.renderController.setSelect(); }
public void SwitchState(TransformManagerState newstate) { if (newstate != currentState) { mymouse = false; lockedaxis = false; axis = Axis.none; if (currentaction != null) { currentaction.CancelAction(this.editor); ma.SetTransformMatrix(activeObject.middleMarix); lockedaxis = false; currentaction = null; axis = Axis.none; } switch (newstate) { case TransformManagerState.move: { if (activeObject.Length != 0) ma.SetTransformMatrix(activeObject.middleMarix); Vector3 transl = ma.transform.Translation; if (activeObject.Length == 1) GameEngine.renderController.setMove(new string[] { transl.X.ToString(), transl.Y.ToString(), transl.Z.ToString() }); else GameEngine.renderController.setRelative(threezeros); }break; case TransformManagerState.rotatelocal: case TransformManagerState.rotatesame: { if (activeObject.Length != 0) rc.SetTransformMatrix(activeObject.middleMarix); }break; } currentState = newstate; } }