yyl
9 天以前 51b0f6ed9f4e1d3bb6f8144470b46908c7699a96
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Cysharp.Threading.Tasks;
using ProjSG.Resource;
 
public class FontUtility
{
    // T044: Fonts loaded via FontUtility.InitAsync or UILoader.LoadFont
    // Actual location: Assets/ResourcesOut/Font/
 
    public static Font preferred
    {
        get { return ResourceCacheManager.Instance.GetCached<Font>("Assets/ResourcesOut/Font/GameFont1.ttf"); }
    }
 
    public static Font secondary
    {
        get { return ResourceCacheManager.Instance.GetCached<Font>("Assets/ResourcesOut/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");
    }
 
}