public void NumberInputValueChanged() { int parsedValue; if (int.TryParse(NumberInput.text, out parsedValue)) { GameRulesManager.CurrentlyWorkshoppedGameRules.SetCardsPerRank(RepresentedNumber, Mathf.Max(0, parsedValue)); NumberInput.text = GameRulesManager.CurrentlyWorkshoppedGameRules.GetCardsPerRank(RepresentedNumber).ToString(); GameRulesManagerInstance.MarkRuleAsDirty(); } else { NumberInput.text = GameRulesManager.CurrentlyWorkshoppedGameRules.GetCardsPerRank(RepresentedNumber).ToString(); } }
public void TickDown() { GameRulesManager.CurrentlyWorkshoppedGameRules.SetCardsPerRank(RepresentedNumber, Mathf.Max(0, GameRulesManager.CurrentlyWorkshoppedGameRules.GetCardsPerRank(RepresentedNumber) - 1)); NumberInput.text = GameRulesManager.CurrentlyWorkshoppedGameRules.GetCardsPerRank(RepresentedNumber).ToString(); GameRulesManagerInstance.MarkRuleAsDirty(); }