public void Redo(ILevelEditorUndo undo)
 {
     if (LevelEditorWorld.TryGetObject(targetInstanceId, out var target))
     {
         undo.LevelEditor.ObjectManager.DeleteObject(target, false);
     }
 }
 private void Awake()
 {
     if (undo != null)
     {
         realUndo = undo.NeedComponent <ILevelEditorUndo>();
     }
 }
 public void Redo(ILevelEditorUndo undo)
 {
     if (LevelEditorWorld.TryGetObject(objects, out ILevelEditorObject target))
     {
         Transform targetTransform = target.MyGameObject.transform;
         targetTransform.position    = toPositions;
         targetTransform.eulerAngles = toRotations;
         targetTransform.localScale  = toScales;
     }
 }
Ejemplo n.º 4
0
        public override void EndEdit(bool notify, ILevelEditorUndo undo)
        {
            if (notify)
            {
                InvokeOnValueChanged(editingId, lastEditValue);
            }

            if (undo != null)
            {
                undo.AddAction(new SetValueUndoAction(this, editingId, beginEditValue, lastEditValue));
            }
        }
    void IExposedToLevelEditor.EndEdit(bool notify, ILevelEditorUndo undo)
    {
        if (notify)
        {
            ALE__GENERATED__OnValueChanged?.Invoke(ALE__GENERATED__editingId, ALE__GENERATED__lastModifyValue);
        }

        if (undo != null)
        {
            undo.AddAction(new SetValueUndoAction(this, ALE__GENERATED__editingId, ALE__GENERATED__startEditValue, ALE__GENERATED__lastModifyValue));
        }
    }
        public void Undo(ILevelEditorUndo undo)
        {
            ILevelEditorObject newObj = undo.LevelEditor.ObjectManager.CreateObject(targetId, targetInstanceId, false);

            IExposedToLevelEditor[] exposed = newObj.GetExposedComponents();

            Assert.AreEqual(exposed.Length, savedValues.Length);

            for (int i = 0; i < exposed.Length; i++)
            {
                exposed[i].ApplyWrapper(savedValues[i], true);
            }
        }
 public void Redo(ILevelEditorUndo undo)
 {
     for (int i = 0; i < objects.Length; i++)
     {
         if (LevelEditorWorld.TryGetObject(objects[i], out ILevelEditorObject target))
         {
             Transform targetTransform = target.MyGameObject.transform;
             targetTransform.position    = toPositions[i];
             targetTransform.eulerAngles = toRotations[i];
             targetTransform.localScale  = toScales[i];
         }
     }
 }
        public void Redo(ILevelEditorUndo undo)
        {
            if (current == null)
            {
                undo.LevelEditor.Selection.SetSelection(null, false);
                return;
            }

            if (LevelEditorWorld.TryGetObject(current.InstanceID, out ILevelEditorObject currentObj))
            {
                undo.LevelEditor.Selection.SetSelection(currentObj, false);
            }
        }
        public void Undo(ILevelEditorUndo undo)
        {
            if (previous == null)
            {
                undo.LevelEditor.Selection.SetSelection(null, false);
                return;
            }

            if (LevelEditorWorld.TryGetObject(previous.InstanceID, out ILevelEditorObject previousObj))
            {
                undo.LevelEditor.Selection.SetSelection(previousObj, false);
            }
        }
 public static void SetValue(this IExposedToLevelEditor exposed, int id, object value, bool notify, ILevelEditorUndo undo)
 {
     exposed.BeginEdit(id);
     exposed.ModifyValue(value, notify);
     exposed.EndEdit(notify, undo);
 }
 public abstract void EndEdit(bool notify, ILevelEditorUndo undo);
 public void Undo(ILevelEditorUndo undo)
 {
     undo.LevelEditor.ObjectManager.DeleteObject(obj, false);
 }
 public void Redo(ILevelEditorUndo undo)
 {
     obj = undo.LevelEditor.ObjectManager.CreateObject(resource, position, rotation, parent, instanceID, false);
 }
 public void Undo(ILevelEditorUndo undo)
 {
     exposed.SetValue(propertyId, previousValue, true);
 }
 public void Redo(ILevelEditorUndo undo)
 {
     exposed.SetValue(propertyId, newValue, true);
 }