Example #1
0
    private void ActionEndedListener(DiceGame.GameTurnEndedEventArgs args)
    {
        if (args.GameTurn is RerollTurn)
        {
            _playSound.PlaySound();
        }


        CleanBoard();
        RollDices();
    }
Example #2
0
 private void ActionEndedListener(DiceGame.GameTurnEndedEventArgs args)
 {
     if (!GameManager.Instance.GetCurrentGame().CurrentBoard.IsRerollPossible())
     {
         _rerollButton.interactable = false;
     }
     else
     {
         if (_rerollButton.interactable != true)
         {
             _rerollButton.interactable = true;
         }
     }
 }
Example #3
0
    private void ActionChangedListener(DiceGame.GameTurnEndedEventArgs args)
    {
        for (int i = _diceNumbers.Count - 1; i >= 0; i--)
        {
            var instance = _diceNumbers[i];
            _diceNumbers.Remove(instance);
            Destroy(instance.gameObject);
        }


        var dices = GameManager.Instance.GetCurrentGame().CurrentBoard.Dices;

        for (int i = 0; i < dices.Count; i++)
        {
            var modifier = dices[i].HasModifier(DiceModifier.Saved);
            if (modifier)
            {
                GUI_DiceNumber instance = Instantiate(_diceNumberPrefab, _diceAnchor);
                _diceNumbers.Add(instance);
                instance.InitDice(dices[i]);
            }
        }
    }