internal void SetWaterSource(WaterSource waterSource) { this.waterSource = waterSource; this.m_VolumeInLiters = waterSource.GetVolumeLiters(); this.m_WaterQuality = waterSource.GetQuality(); this.m_DrinkingAudio = "Play_Slurping1"; this.m_TimeToDrinkSeconds = 4; }
internal static void UpdateButtons(Panel_PickWater panel) { WaterSource waterSource = GetWaterSource(panel); if (!waterSource) { Debug.LogError("Could not find WaterSource"); return; } float limit = Water.GetRemainingCapacity(waterSource.GetQuality()) + Water.GetRemainingCapacityEmpty(); panel.m_ButtonIncrease.SetActive(panel.m_numLiters < limit); }
internal static void ClampAmount(Panel_PickWater panel) { WaterSource waterSource = GetWaterSource(panel); if (!waterSource) { Debug.LogError("Could not find WaterSupply to transfer to"); return; } float limit = Water.GetRemainingCapacity(waterSource.GetQuality()) + Water.GetRemainingCapacityEmpty(); panel.m_numLiters = Mathf.Min(panel.m_numLiters, limit); }
internal static void UpdateCapacityInfo(Panel_PickWater panel) { WaterSource waterSource = GetWaterSource(panel); if (!waterSource) { Debug.LogError("UpdateCapacityInfo: Could not find WaterSource"); return; } labelCapacityInfo.text = GetWaterInfo(LiquidQuality.Potable) + " " + GetWaterInfo(LiquidQuality.NonPotable) + " " + Localization.Get("GAMEPLAY_Empty") + ": " + WaterUtils.FormatWaterAmount(0) + "/" + WaterUtils.FormatWaterAmount(Water.GetRemainingCapacityEmpty()); labelNoCapacityWarning.gameObject.SetActive(Water.GetRemainingCapacityEmpty() == 0 && Water.GetRemainingCapacity(waterSource.GetQuality()) == 0); }