private void UpdateRemainTime() { TimeSpan timeSpan = (TimeSpan)(this._cabinData.levelUpEndTime - TimeUtil.Now); this._Day_TextComp.text = string.Format("{0:D2}", timeSpan.Days); this._Hrs_TextComp.text = string.Format("{0:D2}", timeSpan.Hours); this._Min_TextComp.text = string.Format("{0:D2}", timeSpan.Minutes); this._Sec_TextComp.text = string.Format("{0:D2}", timeSpan.Seconds); E_TimeFormat timeFormat = this.GetTimeFormat(timeSpan); if (this._lastFrame_timeFormat != timeFormat) { this.SetUITimeFormat(timeFormat); } this._lastFrame_timeFormat = timeFormat; }
public void BindingTargetBuilding(MonoIslandBuilding target, CabinDataItemBase cabinData) { this._cabinData = cabinData; this._target = target; this._isUpdating = true; Dictionary <CabinType, bool> cabinNeedToShowNewUnlockDict = Singleton <MiHoYoGameData> .Instance.LocalData.CabinNeedToShowNewUnlockDict; bool flag = !cabinNeedToShowNewUnlockDict.ContainsKey(this._cabinData.cabinType) ? false : cabinNeedToShowNewUnlockDict[this._cabinData.cabinType]; this._LvInfo_Lv_PopUp_New.gameObject.SetActive(flag); this._LvInfo_Lv_PopUp_PopUp.gameObject.SetActive(false); if (!flag) { this.RefreshPopUp(); } this._target.GetModel().RefreshLockStyle(this._cabinData.status); bool flag2 = (this._cabinData is CabinCollectDataItem) && (this._cabinData as CabinCollectDataItem).CanFetchScoin(); this._Output.gameObject.SetActive(flag2); this._lastFrame_output_active = flag2; this._Locked.gameObject.SetActive(this._cabinData.status == CabinStatus.Locked); this._LvInfo.gameObject.SetActive(this._cabinData.status == CabinStatus.UnLocked); this._lastFrame_cabinStatus = this._cabinData.status; if (this._cabinData.status == CabinStatus.UnLocked) { this._LvInfo_Lv_Name_TextComp.text = this._cabinData.GetCabinName(); } bool flag3 = this._cabinData.levelUpEndTime > TimeUtil.Now; this._LvInfo_LvUpProgress.gameObject.SetActive(flag3); if (flag3) { E_TimeFormat timeFormat = this.GetTimeFormat((TimeSpan)(this._cabinData.levelUpEndTime - TimeUtil.Now)); this.SetUITimeFormat(timeFormat); this._lastFrame_timeFormat = timeFormat; } }
private void SetUITimeFormat(E_TimeFormat timeFormat) { if (timeFormat == E_TimeFormat.Day) { this._Day.gameObject.SetActive(true); this._DayText.gameObject.SetActive(true); this._Hrs.gameObject.SetActive(true); this._HrsText.gameObject.SetActive(true); this._Min.gameObject.SetActive(false); this._MinText.gameObject.SetActive(false); this._Sec.gameObject.SetActive(false); this._SecText.gameObject.SetActive(false); } else if (timeFormat == E_TimeFormat.Hour) { this._Day.gameObject.SetActive(false); this._DayText.gameObject.SetActive(false); this._Hrs.gameObject.SetActive(true); this._HrsText.gameObject.SetActive(true); this._Min.gameObject.SetActive(true); this._MinText.gameObject.SetActive(true); this._Sec.gameObject.SetActive(false); this._SecText.gameObject.SetActive(false); } else { this._Day.gameObject.SetActive(false); this._DayText.gameObject.SetActive(false); this._Hrs.gameObject.SetActive(false); this._HrsText.gameObject.SetActive(false); this._Min.gameObject.SetActive(true); this._MinText.gameObject.SetActive(true); this._Sec.gameObject.SetActive(true); this._SecText.gameObject.SetActive(true); } }