Skip to content

Instantly share code, notes, and snippets.

@toxicFork
Created September 27, 2014 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toxicFork/dda3e728374dd19b2be6 to your computer and use it in GitHub Desktop.
Save toxicFork/dda3e728374dd19b2be6 to your computer and use it in GitHub Desktop.
Modification disposable
public class Modification : IDisposable {
private readonly Object[] objects;
public Modification(string action, params Object[] objects) {
this.objects = objects;
EditorHelpers.RecordUndo(action, objects);
}
public void Dispose() {
foreach (Object o in objects) {
EditorUtility.SetDirty(o);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment