fixed wave counter's lack of font

This commit is contained in:
msk
2022-01-30 14:41:03 -08:00
parent d4c5e84404
commit 640245cdd5
5 changed files with 32 additions and 16 deletions
+10 -2
View File
@@ -88,9 +88,16 @@ public class MeatKitPlugin : BaseUnityPlugin
HPReadability.ImproveHPTextReadability(healthCounter.transform.GetChild(0).gameObject);
}
// grab Agency FB from game if it's not set
if(fontAgencyFB == null)
GetFonts();
}
// called on scene change, find fonts from game if they're not set
private void GetFonts()
{
// Agency FB
if (fontAgencyFB == null)
{
var healthCounter = FindObjectOfType<FistVR.FVRHealthBar>();
if (healthCounter != null)
{
fontAgencyFB = healthCounter.transform.GetChild(0).GetChild(0).GetComponent<Text>().font;
@@ -108,6 +115,7 @@ public class MeatKitPlugin : BaseUnityPlugin
}
}
}
}
public MeatKitPlugin(): base()