48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using System.IO;
|
|
using FlaxEngine;
|
|
|
|
namespace Game;
|
|
|
|
public static class AssetManager
|
|
{
|
|
public static string ContentPath { get; private set; } =
|
|
Path.Combine(Directory.GetCurrentDirectory(), "Content");
|
|
|
|
public static string DemoPath { get; private set; } =
|
|
Path.Combine(Directory.GetCurrentDirectory(), "Demos");
|
|
|
|
public static string CachePath { get; private set; } =
|
|
Path.Combine(Directory.GetCurrentDirectory(), "Cache");
|
|
|
|
public static string ConfigFilePath { get; private set; } =
|
|
Path.Combine(ContentPath, "config.cfg");
|
|
|
|
#if FLAX_EDITOR
|
|
public static string ConfigDevFilePath { get; private set; } =
|
|
Path.Combine(ContentPath, "devconfig.cfg");
|
|
#endif
|
|
|
|
public static GameplayGlobals Globals { get; private set; }
|
|
public static Config Config { get; private set; }
|
|
|
|
//public static void Init()
|
|
static AssetManager()
|
|
{
|
|
Globals = Content.Load<GameplayGlobals>(Path.Combine(ContentPath, "Settings", "GameSettings", "GameplayGlobals.flax"));
|
|
}
|
|
|
|
public static void LoadConfigurationFiles()
|
|
{
|
|
Config = ConfigParser.ParseFile(ConfigFilePath);
|
|
#if FLAX_EDITOR
|
|
if (!File.Exists(ConfigDevFilePath))
|
|
{
|
|
File.WriteAllText(ConfigDevFilePath,
|
|
$"""
|
|
// Personal configuration file used during development, do not commit this file.
|
|
""");
|
|
}
|
|
Config.Merge(ConfigParser.ParseFile(ConfigDevFilePath));
|
|
#endif
|
|
}
|
|
} |