#if UNITY_EDITOR using System; using System.Collections.Generic; using System.IO; using UnityEngine; namespace FishNet.Editing.PrefabCollectionGenerator { internal sealed class PrefabCollectionGeneratorConfigurationsz { #region Types. public enum SearchScopeType : byte { EntireProject = 0, SpecificFolders = 1 } #endregion //#region Public. ///// ///// True if prefab generation is enabled. ///// //public bool Enabled; ///// ///// True to rebuild all prefabs during any change. False to only check changed prefabs. ///// //public bool FullRebuild; ///// ///// True to log results to console. ///// //public bool LogToConsole; ///// ///// True to automatically save assets when default prefabs change. ///// //public bool SaveChanges; ///// ///// Path where prefabs file is created. ///// //public string AssetPath; ///// ///// How to search for files. ///// //public SearchScopeType SearchScope = SearchScopeType.EntireProject; ///// ///// Folders to exclude when using SearchScopeType.SpecificFolders. ///// //public List ExcludedFolders = new List(); ///// ///// Folders to include when using SearchScopeType.SpecificFolders. ///// //public List IncludedFolders = new List(); //#endregion //#region Private. ///// ///// Library folder for project. Presumably where files are saved, but this is changing. This is going away in favor of FN config. //fnconfig. ///// //private static string DirectoryPath => Path.Combine(Path.GetDirectoryName(Application.dataPath), "Library"); ///// ///// Full path of settings file. This is going away in favor of FN config. //fnconfig. ///// //private static string FilePath => Path.Combine(DirectoryPath, $"FishNet.Runtime.Editor.PrefabObjects.Generation.{nameof(Settings)}.json"); // #endregion // public Settings() //{ // Enabled = true; // LogToConsole = true; // FullRebuild = false; // SaveChanges = true; // SearchScope = SearchScopeType.EntireProject; // AssetPath = $"Assets{Path.DirectorySeparatorChar}FishNet{Path.DirectorySeparatorChar}Runtime{Path.DirectorySeparatorChar}DefaultPrefabObjects.asset"; //} //public void Save() //{ // //Create save folder if it doesn't exist. This is going away in favor of FN config. //fnconfig. // if (!Directory.Exists(DirectoryPath)) // Directory.CreateDirectory(DirectoryPath); // File.WriteAllText(FilePath, JsonUtility.ToJson(this)); //} //public static Settings Load() //{ // try // { // if (File.Exists(FilePath)) // return JsonUtility.FromJson(File.ReadAllText(FilePath)); // } // catch (Exception ex) // { // Debug.LogError($"An error has occurred when loading the prefab collection generator settings: {ex}"); // } // return new Settings(); //} } } #endif