feat: Add config

This commit is contained in:
2025-02-18 12:04:38 +08:00
parent 02fc481993
commit 5b3a51150c
12 changed files with 305 additions and 39 deletions

View File

@@ -1,7 +1,8 @@
using Cryville.Common.Font;
using System.Collections.Generic;
using UnityEngine;
namespace Cryville.Crtr {
namespace Cryville.EEW.Unity {
internal static class PlatformConfig {
#if UNITY_STANDALONE_WIN
public static readonly string Name = "windows";
@@ -11,11 +12,17 @@ namespace Cryville.Crtr {
#error Unknown platform.
#endif
#if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN
#if UNITY_EDITOR_WIN
public static readonly string ConfigPath = Application.persistentDataPath;
#else
public static readonly string ConfigPath = Application.dataPath;
#endif
public static readonly string FileProtocolPrefix = "file:///";
public static readonly FontManager FontManager = new FontManagerWindows();
public static Dictionary<string, List<string>> ScriptFontMap => FallbackListFontMatcher.GetDefaultWindowsFallbackMap();
public static readonly string TextShader = "TextMesh Pro/Shaders/TMP_SDF SSD";
#elif UNITY_ANDROID
public static readonly string ConfigPath = Application.persistentDataPath;
public static readonly string FileProtocolPrefix = "file://";
public static readonly FontManager FontManager = new FontManagerAndroid();
public static Dictionary<string, List<string>> ScriptFontMap => FallbackListFontMatcher.GetDefaultAndroidFallbackMap();