void Fire(RocketGunComponentBehaviour gun, float rate) { if (rate >= 0.5f) { gun.Fire(damage, _distance, speed, radius); } }
protected override ComponentActivity[] GetActivities(ShipComponentBehaviour shipComponent) { RocketGunComponentBehaviour gun = (RocketGunComponentBehaviour)shipComponent; return(new ComponentActivity[] { new ContinuousComponentActivity <RocketGunComponentBehaviour>(gun, gun.IsDirecting, Direct), new TimerComponentActivity <RocketGunComponentBehaviour>(gun, .3f + .3f * shipClass, gun.IsFiring, Fire) }); }
void Direct(RocketGunComponentBehaviour master, float rate, float timeSpend) { master.Direct(rate * 45f * timeSpend); }