This repository was archived by the owner on Feb 11, 2024. It is now read-only.
2DSE: Added Undo and Redo support.#201
Open
Henry00IS wants to merge 10 commits intosabresaurus:masterfrom
Open
2DSE: Added Undo and Redo support.#201Henry00IS wants to merge 10 commits intosabresaurus:masterfrom
Henry00IS wants to merge 10 commits intosabresaurus:masterfrom
Conversation
…ir own undo/redo history while they have keyboard focus. The 2D Shape Editor now uses this helper class and implements a custom history system. Currently the latest project state can no longer be accessed with redo, this has to be fixed yet.
…StackHelper` to `UndoRedoBarrier` which is a more accurate description of what it attempts to achieve. C# type `Stack` does not get serialized and can't survive C# recompiles (the history is lost).
…zed by Unity. This causes the undo/redo history in the 2D Shape Editor to be lost after C# recompilations which is detrimental to the user experience. Created two extension methods; `List<T>.Push<T>(value)` and `List<T>.Pop<T>()` respectively that simulate identical behaviour to `Stack<T>` on `List<T>`.
…s returning null on ScriptableObject.CreateInstance.
… 2D Shape Editor window is already open when Unity Editor starts (Init method is never called).
…ept and cancel CTRL+Z and CTRL+Y. Unity editor 2017 (tested with 2017.4.17f1) uses the fake undo history and exploits behaviour only found in 2017 that allows redos without there being a redo. Unity editor 5 users will have to be happy with undo functionality alone.
…sabresaurus for pointing this out.
… selected objects list will be cleared to prevent null reference exceptions.
Collaborator
Author
|
Can someone on a mac computer give this PR a go? Move some things around in your scene, press Command+Z and Command+Y in the 2D Shape Editor window to undo and redo things. It shouldn't affect the scene. Feedback on 2017 and 2018 are more than welcome. You can download the ZIP file here. |
Contributor
|
CMD-Z performs and undo in the scene, not in the 2D Shape Editor. Unity 2018.3 on Mac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks to @vertxxyz's tips I was able to easily add undo and redo support to the 2D Shape Editor.This has since evolved in #198.
Does not allow undo/redo of extruded brushes, this is purely for the editor window itself.