public void LoadMap(Map map, bool clearHistory = true) { if (MapIsLoaded) { UnloadMap(); } LoadedMap = map; mapStopwatch.Restart(); MapBuilder.instance.Build(LoadedMap); mapStopwatch.Stop(); UnityEngine.Debug.Log($"Built {LoadedMap.Bricks.Count} bricks in " + mapStopwatch.ElapsedMilliseconds + " ms"); MapLoaded.Invoke(); MapIsLoaded = true; SetRichPresence($"Building on '{map.Name}'", "icon", "BrickBuilder Icon"); if (clearHistory) { EditorHistory.ClearHistory(); } mapStopwatch.Reset(); }
public ShaderEditorVM() { tabs = new ObservableCollection <ShaderTabEditor>(); Tabs = CollectionViewSource.GetDefaultView(tabs); history = new EditorHistory(); Save = new SaveCommand(this); Errors = new ObservableCollection <string>(); }
static void Main() { var editor = new Editor("this is a nice string"); var editorHistory = new EditorHistory(editor); editorHistory.Backup(); editor.DoSomething(); editorHistory.Backup(); editor.DoSomething(); editorHistory.ShowHistory(); }