Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul MemberChange #38

Open
bddckr opened this issue Mar 20, 2019 · 0 comments
Open

Overhaul MemberChange #38

bddckr opened this issue Mar 20, 2019 · 0 comments

Comments

@bddckr
Copy link
Contributor

bddckr commented Mar 20, 2019

  • Get rid of InspectorEditor.
  • Use Undo.postprocessModifications to notice changes done.
    • Set the backing field to previousValue if Unity already changed it.
    • Call the setter, passing currentValue.
  • Use Undo.undoRedoPerformed to get told about undo or redo happening.
    • Since this event doesn't tell us what actually happened (undo or redo?), nor which property it affected, we need to check that ourselves. Do so by remembering the postprocessModifications above and go through each of those SerializedPropertys to compare their serialized value (which is the current value after Unity did this undo/redo operation) against the remembered values.
    • Revert the backing field to the "previous" value.
    • Call the setter, passing the "current" value retrieved previously from the SerializedProperty.
  • Replace Zinnia.ObservableListEditor by merging its functionality into this overhauled way instead.

Related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant