Esempio n. 1
0
        public void ApplyDamage(int amount)
        {
            if (amount < _damageResistance)
            {
                return;
            }
            else
            {
                amount -= _damageResistance;
            }

            if (!_isTakingDamage && amount > 0)
            {
                ApplyDeduct(amount);
                if (Health.IsAlive)
                {
                    OnDamage();
                    OnActorDamaged.Raise(this);
                    _isTakingDamage = true;
                    Timekeeper.SetTimer(_damageInvulnerabilityDuration, () => _isTakingDamage = false);
                }
            }
        }
Esempio n. 2
0
 // Scene is completely active 1 from after the callback, so we will have our callback fire 1 frame after theirs
 private static void OnActiveSceneChangedCallback(Scene scene, LoadSceneMode mode)
 {
     SceneManager.sceneLoaded -= OnActiveSceneChangedCallback;
     Timekeeper.SetTimer(1, OnSceneIsReady.Raise);
 }
Esempio n. 3
0
 private void StartCooldown() => Timekeeper.SetTimer(_cooldown, () => _canFire = true);