public void UpdateUI(MoneyTreeOpenDto moneyTreeOpenDto) { if (moneyTreeOpenDto.lv == 0) { level.text = "0"; goldcount.text = "0"; slider.value = 0f; timer.text = "未获得摇钱树"; btn_Harvest.gameObject.SetActive(false); } else { level.text = NumberConvert.NunberToChar(moneyTreeOpenDto.lv); timer.text = moneyTreeOpenDto.timer.ToString() + "小时/12小时"; slider.value = moneyTreeOpenDto.timer * 1.0f / 12; goldcount.text = moneyTreeOpenDto.goldNum.ToString(); PlayerCache.loginInfo.gold = moneyTreeOpenDto.holdGold; btn_Harvest.gameObject.SetActive(true); } totalGold.text = PlayerCache.loginInfo.gold.ToString(); UIHallManager uIHallManager = MessageManager.GetInstance.GetUIDict <UIHallManager>(); if (uIHallManager != null) { if (uIHallManager.gameObject.activeSelf) { uIHallManager.UpdateUI(); } } if (PlayerCache.loginInfo != null) { totalGold.text = PlayerCache.loginInfo.gold.ToString(); } }