public void Execute(GunView gunView, PlayerView playerView) { var damage = gunView.GetDamage(); playerHealthDecrease.Execute(playerView, damage); gunView.DestroyView(); }
void Start() { UnaimedView = new GunView(m_transformAdjust.localPosition, m_transformAdjust.localRotation, Camera.main.fieldOfView); AimedView = new GunView(m_aimTransform.localPosition, m_aimTransform.localRotation, m_aimFOV); TargetView = UnaimedView; NBullets = m_bulletCapacity; NMagazines = m_magazineCapacity; ChangeState(new GunStateDraw()); }
public void Execute(GunView gunView, EnemyView enemyView) { var enemyViewModel = enemyView.GetModel(); enemyViewModel.Health = Mathf.Max(enemyViewModel.Health - 1, 0); if (enemyViewModel.Health.Equals(0)) { playerRepository.AddScore(enemyViewModel.ScorePoints); gunView.DestroyView(); enemyView.Explote(); } }
public override ActionResult Delete(int?id) { var entityViewModel = new GunViewModel(); using (var localService = this.service as IGunService) { var entity = localService.GetAll().OfType <Gun>().Where(b => b.Id == id).First(); var entityView = new GunView { CaliberViewName = entity.Caliber.Name, ManufacturerName = entity.Manufacturer.Name, GunTypeName = entity.GunType.Name, LengthUnitViewAbbreviation = entity.BarrelLengthUnit.Abbreviation }; entityViewModel.CanDelete = !(entity.GunImages.Any() || entity.ShootingSessions.Any()); entityViewModel.Entity = entity; entityViewModel.EntityView = entityView; } return(View(entityViewModel)); }
public static GunPresenter Provide(GunView view) { return(new GunPresenter(view, GameProvider.ProvideRemoveCollision())); }
public void SwitchGun(IPlayerController obj) { viewType += 1; myGunView.sprite = guns[(int)viewType]; anim.speed *= 2; }
public GunPresenter(GunView view, RemoveCollision removeCollision) { this.view = view; this.removeCollision = removeCollision; }