Example #1
0
        void GenerateSnapshot()
        {
            if (scene == null)
            {
                return;
            }

            var arguments = new SnapshotGenerator.Arguments
            {
                OutputPath = SnapshotGenerator.GetDefaultSnapshotPath(outputPath)
            };

            SnapshotGenerator.Generate(arguments, scene.WorldSize, scene.GetHeight, scene.Units, scene.Fields);
        }
        protected virtual void GenerateSnapshot()
        {
            if (scene == null)
            {
                return;
            }

            var arguments = new SnapshotGenerator.Arguments
            {
                OutputPath = SnapshotGenerator.GetSnapshotPath(outputPath)
            };

            var snapshot = scene.GenerateSnapshot();

            Debug.Log($"Writing snapshot to: {outputPath}");
            snapshot.WriteToFile(arguments.OutputPath);
        }
Example #3
0
        public void OnGUI()
        {
            using (new EditorGUILayout.VerticalScope())
            {
                if (GUILayout.Button("Defaults"))
                {
                    SetDefaults();
                    Repaint();
                }

                arguments.OutputPath = EditorGUILayout.TextField("Snapshot path", arguments.OutputPath);

                var shouldDisable = string.IsNullOrEmpty(arguments.OutputPath);
                using (new EditorGUI.DisabledScope(shouldDisable))
                {
                    if (GUILayout.Button("Generate snapshot"))
                    {
                        SnapshotGenerator.Generate(arguments);
                    }
                }
            }
        }