Exemple #1
0
 /// <summary>
 /// Triggers the Roll Animation and set the stamina cost for this action
 /// </summary>
 public virtual void Roll()
 {
     OnRoll.Invoke();
     isRolling = true;
     animator.CrossFadeInFixedTime("Roll", rollTransition, baseLayer);
     ReduceStamina(rollStamina, false);
     currentStaminaRecoveryDelay = 2f;
 }
    IEnumerator RollAnimation()
    {
        yield return(new WaitForSeconds(1f));

        _animDice.SetBool("OnRoll", false);
        _animDice.enabled = false;
        _imgDice.sprite   = rollNumbers[diceNumber - 1];
        OnRoll?.Invoke(this, EventArgs.Empty);
    }
Exemple #3
0
        public void Start()
        {
            var rand = new Random();

            while (true)
            {
                var init = rand.Next(0, 36);
                OnRoll?.Invoke(init);
                Thread.Sleep(15000);
            }
        }
 protected void TriggerRoll(Vector3 direction) => OnRoll?.Invoke(direction);
Exemple #5
0
 public override void StartTurn()
 {
     OnRoll?.Invoke();
 }
Exemple #6
0
 protected void NotifySubscribers(RollResult result) => OnRoll?.Invoke(this, result);