void EvaluateBarrel(GunBarrel barrel) { projectileSpawnPoints = barrel.projectileSpawnPoints; fireRate += barrel.fireRate; projectileSpeed += barrel.muzzleVelocity; damage += barrel.damage; }
public void Evaluate(GunBody body, GunBarrel barrel, Projectile projectile) { fireRate = 0; projectileSpeed = 0; damage = 0; EvaluateBody(body); EvaluateBarrel(barrel); EvaluateProjectile(projectile); }
void Awake() { player = GameManager.Instance.GetPlayerController(); // instantiate body and barrel instances as children // and also replace the prefabs with the actual instances body = Instantiate(body, transform) as GunBody; barrel = Instantiate(barrel, transform) as GunBarrel; stats = new EffectiveGunStats(); stats.Evaluate(body, barrel, projectile); }