From 4af522779203eb3d03fa95c0b5bdd79c9beabec8 Mon Sep 17 00:00:00 2001 From: Memorix101 Date: Thu, 20 Apr 2023 03:38:56 +0200 Subject: [PATCH] patched spritefonts --- Assets/Scripts/XNATest.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/XNATest.cs b/Assets/Scripts/XNATest.cs index dd9d79f..e0d01cd 100644 --- a/Assets/Scripts/XNATest.cs +++ b/Assets/Scripts/XNATest.cs @@ -108,7 +108,9 @@ public class XNATest : MonoBehaviour { GUI.color = new Color(call.Color.X, call.Color.Y, call.Color.Z, call.Color.W); Vector2 size = GUI.skin.label.CalcSize(new GUIContent(call.Value)); - Font myFont = (Font)UnityEngine.Resources.Load($"Content/{call.Font.FontName.ToString()}", typeof(Font)); + string[] x = call.Font.PathTo.Split('/'); + string path = $"{call.Font.PathTo.Remove(call.Font.PathTo.Length - 1 - x[x.Length-1].Length)}/{call.Font.FontName.ToString()}"; + Font myFont = (Font)UnityEngine.Resources.Load($"{path}", typeof(Font)); //GUI.skin.font = myFont; GUIStyle myStyle = new GUIStyle();