// called in animation public void EmitCasings() { if (Casings != null) { WController.EmitCasings(Casings.position, Casings.rotation, AmmoType, AmmoConsumption); } }
private void UpdateForm(Forecast forecast) { PlaatsTextBox.Text = Plaatsnaam; IntervalTextBox.Text = Interval.ToString(); LocationLabel.Text = Plaatsnaam; DescriptionLabel.Text = forecast.weather.First().description; WeatherIconPictureBox.ImageLocation = "http://openweathermap.org/img/w/" + forecast.weather.First().icon + ".png"; TemperatuurLabel.Text = BuildTemperatureString(forecast.main.temp); LuchtvochtigheidLabel.Text = String.Format("Luchtvochtigheid: {0}%", forecast.main.humidity); WindLabel.Text = BuildWindString(forecast.wind.speed, forecast.wind.deg); DateTime LatestUpdate = forecast.datetime; LatestUpdateLabel.Text = String.Format("[Laatste update: {0}]", LatestUpdate); FillChart(WController.GetAvgTempPerDayByCity(City_Id)); TempToolStripTextBox.Text = BuildContextMenuTemperature(CalculateTemperature(forecast.main.temp, MetricSystem), MetricSystem); }
private void UpdateApiAndForm() { WController.QueryWeatherApi(City_Id, Language); // get latest forecast from DB, indepent of connection // if request was succesfull, latest forecast is already written to DB int MaxPK = WController.GetMaxPKFromDatabase(City_Id); WController.GetLatestForecastFromDatabase(MaxPK); try { UpdateForm(WController.forecast); } catch (ArgumentNullException) { MessageBox.Show("Er is iets mis gegaan :<("); } }
private void Update() { if (gMode == GameMode.Edit) { return; } if (WController == null) { return; } if (WController.GameResult == GameResult.Loose && !resultShowed) { resultShowed = true; MPlayer.AddLifes(-1); MGui.ShowLoss(); return; } if (WController.GameResult == GameResult.Win && !resultShowed) { resultShowed = true; MPlayer.PassLevel(); MGui.ShowVictory(); return; } WController.Update(Time.time); if (gState == GameState.Shooting) { Shooting(); } else if (gState == GameState.DisableTouch) { } }
protected void EmitTrail(Vector3 start, Vector3 direction, Vector3 end) { WController.ShowLine(start, direction, end, 0.06f); }
protected void PlayAudio(AudioClip clip) { WController.PlaySound(clip); }
private void Shooting() { // BubblesShooter.Instance.ShowSwapPath(); if (TouchManager.IsTouched && BubblesShooter.Instance.TouchInRange()) { BubblesShooter.Instance.ShowShootLine(); } else if (TouchManager.IsTouched && !BubblesShooter.Instance.TouchInRange()) { BubblesShooter.Instance.HideShootLine(); BubblesShooter.Instance.CleanTargets(); } else if (!TouchManager.IsTouched) { BubblesShooter.Instance.HideShootLine(); //Debug.Log("Can Shoot " + BubblesShooter.CanShoot); if (BubblesShooter.CanShoot) // shoot { GoToDTMode(); // diasable touch mainSeq = new TweenSeq(); mainSeq.Add((callBack) => // move bubble to free target, hit target, and check result { BubblesShooter.Instance.Shoot(callBack); }); mainSeq.Add((callBack) => // collect all bubbles in shootarea { BubblesShooter.Instance.ShootCollect(callBack); }); mainSeq.Add((callBack) => // collect all fall down objects { BubblesShooter.Instance.CleanTargets(); detCells = new CellsGroup(); detCells.AddRange(grid.GetDetacheCells()); detCells.FallDownCollect(BubblesShooter.Instance.BubbleScore, null); WController.CheckResult(false, false);// check shoot result grid.AddEmptyRow(); callBack(); }); if (WController.GameLevelType == LevelType.AnchorLevel) // update anchor path { mainSeq.Add((callBack) => { if (anchor && anchor.gameObject.activeSelf) { anchor.UpdatePath(); } WController.CheckResult(false, false);// check shoot result callBack(); }); } mainSeq.Add((callBack) => { grid.MoveToVisible(() => { if (WController.GameResult == GameResult.Win) { detCells = new CellsGroup(); detCells.AddRange(grid.GetNotEmptyCells()); detCells.FallDownCollect(BubblesShooter.Instance.BubbleScore, null); } WController.CheckResult(false, false);// check shoot result after falldown GoToShootMode(); callBack(); }); }); mainSeq.Start(); } } }