示例#1
0
    //Records edits used in translation operation
    void recordEdits(Transform transformEditing)
    {
        //Record edits for translation
        TranslationEdit translationEdit   = new TranslationEdit(transformEditing, initTransformEditingEditVector, transformEditing.position);
        TranslationEdit transformToolEdit = new TranslationEdit(transformTool.transform, initTransformToolEditVector, transformTool.transform.position);

        //Create compound edit to store transformEditing and transformTool translations
        CompoundEdit compoundEdit = new CompoundEdit();

        compoundEdit.addEdit(translationEdit);
        compoundEdit.addEdit(transformToolEdit);

        editTracker.trackEdit(compoundEdit); //Start tracking edit in edit tracker
    }
示例#2
0
    //Records edits used in scaling operation
    void recordEdits(Transform transformEditing)
    {
        //Record edits for scaling
        ScaleEdit       scaleEdit     = new ScaleEdit(transformEditing, initTransformEditingScale, transformEditing.localScale);
        TranslationEdit posOffsetEdit = new TranslationEdit(transformEditing, initTransformEditingWorldPos, transformEditing.position);

        //Create compound edit to store transformEditing and transformTool translations
        CompoundEdit compoundEdit = new CompoundEdit();

        compoundEdit.addEdit(scaleEdit);
        compoundEdit.addEdit(posOffsetEdit);

        editTracker.trackEdit(compoundEdit); //Start tracking edit in edit tracker
    }
示例#3
0
    //Records edits used in rotation operation
    void recordEdits(Transform transformEditing)
    {
        //Record edits for rotation
        RotationEdit rotationEdit = new RotationEdit(transformEditing, initTransformEditingEditVector, transformEditing.rotation.eulerAngles);
        RotationEdit transformToolRotationEdit = new RotationEdit(transformTool.transform, initTransformToolEditVector, transformTool.transform.rotation.eulerAngles);
        //TranslationEdit transformToolTranslationEdit = new TranslationEdit(transformTool.transform, transformTool.transform.position, transformTool.transform.position);

        //Create compound edit to store transformEditing and transformTool rotations
        CompoundEdit compoundEdit = new CompoundEdit();

        compoundEdit.addEdit(rotationEdit);
        compoundEdit.addEdit(transformToolRotationEdit);
        //compoundEdit.addEdit(transformToolTranslationEdit);

        editTracker.trackEdit(compoundEdit); //Start tracking edit in edit tracker
    }