Beispiel #1
0
        public static void LoadAsync(string abName, string assetName, Action <TMP_FontAsset> callback)
        {
            if (string.IsNullOrEmpty(abName) || string.IsNullOrEmpty(assetName))
            {
                Debug.LogError("abName or assetName is null!!!");
                if (callback != null)
                {
                    callback(null);
                }
                return;
            }

            Action <AssetLoadData> tCallBack = null;

            if (callback != null)
            {
                tCallBack = (data) =>
                {
                    callback(data.mAsset as TMP_FontAsset);
                };
            }

            HFont res = Get <HFont>(abName, assetName, AssetType.eFont);

            res.StartLoad(false, false, false, tCallBack);
        }
Beispiel #2
0
        public static TMP_FontAsset Load(string abName, string assetName)
        {
            if (string.IsNullOrEmpty(abName) || string.IsNullOrEmpty(assetName))
            {
                Debug.LogError("abName or assetName is null!!!");
                return(null);
            }

            HFont res = Get <HFont>(abName, assetName, AssetType.eFont);

            res.StartLoad(true, false, false, null);
            return(res.AssetData.mAsset as TMP_FontAsset);
        }