public void TotalPointChanged() { if (UpgradeMenuUI.activeInHierarchy) { UpgradeMenu menu = UpgradeMenuUI.GetComponent <UpgradeMenu>(); if (menu != null) { menu.UpdateTotalPointText(); } } }