Logging refactor

dll update
This commit is contained in:
2020-09-28 01:02:17 -07:00
parent 1859e51a2e
commit 885dfb3397
11 changed files with 34 additions and 38 deletions

View File

@ -1,6 +1,7 @@
using System.IO;
using System.Collections;
using System.Collections.Generic;
using ConformalDecals.Util;
using TMPro;
using UniLinq;
using UnityEngine;
@ -15,18 +16,18 @@ namespace ConformalDecals.Text {
public override IEnumerator Load(UrlDir.UrlFile urlFile, FileInfo fileInfo) {
if (_fallbackFont == null) {
_fallbackFont = Resources.FindObjectsOfTypeAll<TMP_FontAsset>().First(o => o.name == FallbackName);
if (_fallbackFont == null) Debug.LogError($"Could not find fallback font '{FallbackName}'");
if (_fallbackFont == null) Logging.LogError($"Could not find fallback font '{FallbackName}'");
}
Debug.Log($"[ConformalDecals] '{urlFile.fullPath}'");
Logging.Log($"Loading font file '{urlFile.fullPath}'");
var bundle = AssetBundle.LoadFromFile(urlFile.fullPath);
if (!bundle) {
Debug.Log($"[ConformalDecals] could not load font asset {urlFile.fullPath}");
Logging.Log($"Could not load font asset {urlFile.fullPath}");
}
else {
var loadedFonts = bundle.LoadAllAssets<TMP_FontAsset>();
foreach (var font in loadedFonts) {
Debug.Log($"[ConformalDecals] adding font {font.name}");
Logging.Log($"Adding font {font.name}");
font.fallbackFontAssets.Add(_fallbackFont);
}
}