private void SetCooldown(SleepingBag entity, ConfigData.OInfo info) { var value = entity.ShortPrefabName.Contains("bed") ? info.bed : info.bag; entity.secondsBetweenReuses = value; entity.SendNetworkUpdate(); }
private void SetCooldown(SleepingBag entity, SettingsEntry info) { if (info == null) { return; } if (entity.ShortPrefabName.Contains("bed")) { entity.secondsBetweenReuses = info.bed; entity.unlockTime = info.unlockTimeBed + UnityEngine.Time.realtimeSinceStartup; } else { entity.secondsBetweenReuses = info.bag; entity.unlockTime = info.unlockTimeBag + UnityEngine.Time.realtimeSinceStartup; } entity.SendNetworkUpdate(); }