Example #1
0
 void OnDieLandedOnFace(BattleDie die, int value)
 {
     if (_PlayFaceSoundsToggle.isOn)
     {
         if (_Sounds.FaceValues?.Length >= value)
         {
             _audioSource.PlayOneShot(_Sounds.FaceValues[value - 1]);
         }
         else
         {
             Debug.LogWarning("No sound for face value " + value);
         }
     }
 }
Example #2
0
        public BattleDie TryAddDie(Die die, BattleGameDieUI uiDie)
        {
            BattleDie battleDie = null;
            bool      add       = true;

#if TEAM_BATTLE
            add = (die.dieType == Die.DieType.SixSided) ? (Dice6?.Count() < _teamNumD6) : (Dice20?.Count() < _teamNumD20);
#endif
            if (add)
            {
                battleDie = new BattleDie(die, TeamNumber, uiDie);
                _dice.Add(battleDie);
            }
            return(battleDie);
        }