Created
September 27, 2014 17:58
-
-
Save toxicFork/dda3e728374dd19b2be6 to your computer and use it in GitHub Desktop.
Modification disposable
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
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