コード例 #1
0
        public static void Load()
        {
            if (!File.Exists(settingsFileName))
            {
                Save();
                Core.Log("Have no settings file, huh? Here is one for you (づ。◕‿‿◕。)づ");
                return;
            }
            ConfigNode configNode = ConfigNode.Load(settingsFileName);

            if (!configNode.HasNode(configTagMain))
            {
                BackupAndSave();
                Core.Log("General Failure reading settings file");
                return;
            }
            configNode = configNode.GetNode(configTagMain);
            try
            {
                bool isOk = true;
                bool isOkCurrent;

                isOkCurrent = configNode.HasValue(configTagScenesDirectory);
                if (isOkCurrent)
                {
                    string directory = configNode.GetValue(configTagScenesDirectory);
                    if (directory != string.Empty)
                    {
                        isOkCurrent = Directory.Exists(directory);
                        if (isOkCurrent)
                        {
                            ScenesDirectory = directory;
                        }
                    }
                }
                isOk &= isOkCurrent;

                if (!isOk)
                {
                    BackupAndSave();
                    Core.Log("General Failure reading settings file");
                }
            }
            catch (Exception stupid)
            {
                BackupAndSave();
                Core.Log("Not to worry, we are still flying half a ship.");
                Core.Log(stupid.Message);
            }
            SceneExporterGUI.Initialize();
        }
コード例 #2
0
 public static void Export()
 {
     SceneExporterGUI.ApplySettings();
     activeDirectory = Path.Combine(Settings.ScenesDirectory, DateTime.Now.ToString("yyMMdd-HHmmss"));
     if (!Directory.Exists(activeDirectory))
     {
         Directory.CreateDirectory(activeDirectory);
     }
     if (Core.IsExportingTextures)
     {
         texturesDirectory = Path.Combine(activeDirectory, "textures");
         if (!Directory.Exists(texturesDirectory))
         {
             Directory.CreateDirectory(texturesDirectory);
         }
     }
     Core.Log(String.Format("Starting exporting. Looking for gameobjects within {0} meters range.", Core.DistanceMax));
     DoExport();
     Core.Log(String.Format("{0} gameobjects exported.", gameObjectIndex));
 }