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)); } }
public void Settings(HitArgs hit) { this.hit = hit; }
public HitBuilder() { args = new HitArgs(); }
private void GameOverWrapper(HitArgs obj) { StopCoroutine(SpawnWaves()); GameOver(); }