/// <summary> /// On View controller did activate /// </summary> /// <param name="__instance">PlayerStatisticsViewController instance</param> /// <returns></returns> internal static void Postfix(ref PlayerStatisticsViewController __instance) { var l_HeaderBG = __instance.transform.Find("HeaderPanel")?.Find("BG"); if (l_HeaderBG != null && l_HeaderBG && l_HeaderBG.GetComponent <ImageView>() && ColorUtility.TryParseHtmlString("#00000080", out var l_Color)) { l_HeaderBG.GetComponent <ImageView>().color = l_Color; } }
private IEnumerator WaitForLoad() { while (!loaded) { stats = Resources.FindObjectsOfTypeAll <PlayerStatisticsViewController>().FirstOrDefault(); if (stats == null) { yield return(new WaitForSeconds(0.01f)); } else { Plugin.Log("Found PlayerStatisticsViewController!", Plugin.LogLevel.DebugOnly); loaded = true; } } Init(); }
public void Update() { if (!showFailCounter && loaded) { if (_failedLevelsCountText == null) { if (stats == null) { stats = Resources.FindObjectsOfTypeAll <PlayerStatisticsViewController>().FirstOrDefault(); } _failedLevelsCountText = ReflectionUtil.GetPrivateField <TextMeshProUGUI>(stats, "_failedLevelsCountText"); } if (_failedLevelsCountText.text != failedLevelsCountReplacementText) { Plugin.Log("Replacing the _failedLevelsCountText with: " + failedLevelsCountReplacementText, Plugin.LogLevel.Info); _failedLevelsCountText.text = failedLevelsCountReplacementText; _failedLevelsCountText.ForceMeshUpdate(true); } } }