void EvaluateBody(GunBody body) { fireMode = body.fireMode; burstCount = body.burstCount; fireRate += body.fireRate; projectileSpeed += body.muzzleVelocity; damage += body.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); }