diff --git a/Assets/Scripts/PartIndexScript.cs b/Assets/Scripts/PartIndexScript.cs index 9476fcd19..ff4491088 100644 --- a/Assets/Scripts/PartIndexScript.cs +++ b/Assets/Scripts/PartIndexScript.cs @@ -241,15 +241,27 @@ private IEnumerator AttemptAddPartHelper() if (x >= 10) { x = 0; + UpdateTextAndTally(); yield return new WaitForEndOfFrame(); } } + UpdateTextAndTally(); + yield return null; + } + + private void UpdateTextAndTally() + { for (int i = 0; i < contents.Length; i++) { texts[i].SetActive(contents[i].childCount > 0); } + UpdateTallyGraphic(); + } + + private void UpdateTallyGraphic() + { // Update tally graphic bar if (statsNumbers[3] > 0) { @@ -269,7 +281,6 @@ private IEnumerator AttemptAddPartHelper() // Just found out about string interpolation. Damn that stuff rocks. statsTotalTally.text = $"{statsNumbers[3]}"; - yield return null; } public static void AttemptAddToPartsObtained(EntityBlueprint.PartInfo part)