Beispiel #1
0
 private void Awake()
 {
     _stats    = GetComponent <ActorStats>();
     _gunShot  = GetComponent <AudioSource>();
     _canShoot = false;
     GameManager.GameStateChanged += OnGameStateChanged;
 }
Beispiel #2
0
        // defenderStats can be used if we give armor to actors
        // not implemented now, just for the demonstration of extensibility
        public Attack CreateAttack(ActorStats attackerStats, ActorStats defenderStats = null)
        {
            float damage = attackerStats.GetDamage();

            damage += baseDamage;

            bool isCritical = Random.value < criticalChance;

            if (isCritical)
            {
                damage *= criticalHitBuff;
            }

            return(new Attack((int)damage, isCritical));
        }
 private void Awake()
 {
     _actorStats = GetComponent <ActorStats>();
 }
Beispiel #4
0
 private void Awake()
 {
     _player     = FindObjectOfType <ShooterFromCamera>().gameObject;
     _actorStats = GetComponent <ActorStats>();
     GameManager.GameStateChanged += OnGameStateChanged;
 }