public static ZombieSettings GetGameSettings() { ZombieSettings settings = null; var world = Find.World; if (world != null && world.components != null) { settings = world.components.OfType <ZombieSettings>().FirstOrDefault(); } return(settings); }
public override void WriteSettings() { var settings = ZombieSettings.GetGameSettings(); if (settings != null) { settings.WriteSettings(); } else { ZombieSettingsDefaults.WriteSettings(); } }
public override void DoSettingsWindowContents(Rect inRect) { var settings = ZombieSettings.GetGameSettings(); if (settings != null) { settings.DoWindowContents(inRect); } else { ZombieSettingsDefaults.DoWindowContents(inRect); } }