예제 #1
0
    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();
        }
    }
예제 #2
0
 public void TickDown()
 {
     GameRulesManager.CurrentlyWorkshoppedGameRules.SetCardsPerRank(RepresentedNumber, Mathf.Max(0, GameRulesManager.CurrentlyWorkshoppedGameRules.GetCardsPerRank(RepresentedNumber) - 1));
     NumberInput.text = GameRulesManager.CurrentlyWorkshoppedGameRules.GetCardsPerRank(RepresentedNumber).ToString();
     GameRulesManagerInstance.MarkRuleAsDirty();
 }