예제 #1
0
    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();
    }
예제 #2
0
 public ShaderEditorVM()
 {
     tabs    = new ObservableCollection <ShaderTabEditor>();
     Tabs    = CollectionViewSource.GetDefaultView(tabs);
     history = new EditorHistory();
     Save    = new SaveCommand(this);
     Errors  = new ObservableCollection <string>();
 }
예제 #3
0
        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();
        }