Exemple #1
0
        /// <summary>
        /// Добавить конфигурацию по пути Resources\Configs\
        /// </summary>
        /// <typeparam name="T">Тип конфигурации</typeparam>
        private static void CreateConfigAsset <T>()
            where T : ScriptableObject
        {
            T asset = ScriptableObject.CreateInstance <T>();

            string directory = @"Assets\Resources\Configs\";

            FileTool.CheckAssetDirectory(directory);

            AssetDatabase.CreateAsset(asset, Path.Combine(directory, typeof(T).Name + ".asset"));

            AssetDatabase.SaveAssets();

            EditorUtility.FocusProjectWindow();

            Selection.activeObject = asset;
        }