|
using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using Cysharp.Threading.Tasks;
|
using ProjSG.Resource;
|
|
public class FontUtility
|
{
|
// T044: Fonts must be pre-loaded via StartupEssential preload config
|
// (location: "Assets/ResourcesOut/BuiltIn/Font")
|
|
public static Font preferred
|
{
|
get { return ResourceCacheManager.Instance.GetCached<Font>("Assets/ResourcesOut/BuiltIn/Font/GameFont1.ttf"); }
|
}
|
|
public static Font secondary
|
{
|
get { return ResourceCacheManager.Instance.GetCached<Font>("Assets/ResourcesOut/BuiltIn/Font/GameFont2.ttf"); }
|
}
|
|
/// <summary>
|
/// US2: Async initialization — fallback API if preload is not yet available.
|
/// </summary>
|
public static async UniTask InitAsync()
|
{
|
// Fallback: async load and cache via ResManager
|
await ResManager.Instance.LoadAssetAsync<Font>("Font", "GameFont1");
|
await ResManager.Instance.LoadAssetAsync<Font>("Font", "GameFont2");
|
}
|
|
}
|