public void SaveAsNewButton() { GameRules newRules = CurrentlyWorkshoppedGameRules.CloneRules(); SaveDataManager.SaveNewRuleSet(newRules); RulePresetSelector newRulesPreset = ObjectPooler.GetObject(RulesPresetSelectorPF, RulesPresetHolder); RulePresetSelectors.Add(newRulesPreset); newRulesPreset.SetRepresentedRules(newRules, this); SetRulesFromPreset(newRules); }
public void UpdateButton() { SaveDataManager.UpdateRuleSet(CurrentlyWorkshoppedGameRules); CurrentlyWorkshoppedGameRules = CurrentlyWorkshoppedGameRules.CloneRules(); FutureGameRules = CurrentlyWorkshoppedGameRules.CloneRules(); UpdateRuleSetButton.interactable = false; RulePresetSelector matchingSelector = MatchingSelector(CurrentlyWorkshoppedGameRules); if (matchingSelector != null) { matchingSelector.SetRepresentedRules(CurrentlyWorkshoppedGameRules, this); } }
void HydrateRulePresetPanel() { HashSet <GameRules> rulesToSet = new HashSet <GameRules>(); rulesToSet.UnionWith(SaveDataManager.GetDefaultGameRules()); rulesToSet.UnionWith(SaveDataManager.GetSavedRuleSets()); foreach (GameRules rules in rulesToSet) { RulePresetSelector newRulePresetSelector = ObjectPooler.GetObject(RulesPresetSelectorPF, RulesPresetHolder); newRulePresetSelector.SetRepresentedRules(rules, this); RulePresetSelectors.Add(newRulePresetSelector); } }