public override void Fire(BaseWeaponViewModel baseWeapon) { base.Fire(baseWeapon); var laser = LaserBoltController.CreateLaserBolt(); baseWeapon.Projectiles.Add(laser); laser.Hit.Subscribe(_ => { baseWeapon.ParentPlayerShip.AsteroidsDestroyed++; }).DisposeWith(laser); laser.Destroy.Subscribe(_ => { baseWeapon.Projectiles.Remove(laser); }).DisposeWith(laser); baseWeapon.ParentPlayerShip.IsAliveProperty.Where(isAlive => !isAlive).Subscribe(_ => { laser.Destroy.Execute(null); }).DisposeWith(baseWeapon); }
public abstract void InitializeBaseWeapon(BaseWeaponViewModel baseWeapon);
public virtual void Fire(BaseWeaponViewModel baseWeapon) { }
protected override void InitializeViewModel(ViewModel viewModel) { BaseWeaponViewModel baseWeapon = ((BaseWeaponViewModel)(viewModel)); baseWeapon.FireRate = this._FireRate; }
public override void InitializeBaseWeapon(BaseWeaponViewModel baseWeapon) { }