unitycoder / UnityMobilePaint

Public repository for MobilePaint issues & requests
https://www.assetstore.unity3d.com/en/#!/content/19803?aid=1101lGti
MIT License
51 stars 16 forks source link

how to add undo-redo #38

Open unitycoder opened 5 years ago

unitycoder commented 5 years ago

try with simple Stack like here https://github.com/unitycoder/PixelArtTool/blob/131c381ca66a8b9da170e338456031d60539484b/PixelArtTool/MainWindow.xaml.cs#L41 then search for those undoStack and redoStack variables to see how its done, used only in couple places. The idea is that when you call undo, that undo buffer is moved into redoStack, and if you redo, its moved to undostack.

for mobilepaint, would use byte[] instead of that writeablebitmap there.