示例#1
0
 private void AddScore(HitArgs hitArgs)
 {
     if (hitArgs.Attacker && hitArgs.Attacker.GetComponent <PlayerController>())
     {
         Hazard hazard = hitArgs.Victim.GetComponent <Hazard>();
         if (hazard)
         {
             Score += hazard.Reward;
         }
     }
 }
        IEnumerator Fire()
        {
            yield return(new WaitForSeconds(delay));

            while (true)
            {
                Transform  currentMuzzle = weaponMuzzles[Random.Range(0, weaponMuzzles.Length)];
                Projectile bolt          = Instantiate(boltPrefab, currentMuzzle.position, currentMuzzle.rotation);
                HitArgs    hit           = HitArgs.CreateBuilder().SetAttacker(gameObject).SetDamage(damage);
                bolt.Settings(hit);

                audio.Play();
                yield return(new WaitForSeconds(fireRate));
            }
        }
示例#3
0
 public void Settings(HitArgs hit)
 {
     this.hit = hit;
 }
示例#4
0
 public HitBuilder()
 {
     args = new HitArgs();
 }
示例#5
0
 private void GameOverWrapper(HitArgs obj)
 {
     StopCoroutine(SpawnWaves());
     GameOver();
 }