// Use this for initialization private void Awake() { cannons = GetComponentsInChildren <Transform>(); if (!bulletPrefab.GetComponent <Bullet>()) { bulletPrefab.gameObject.AddComponent <Bullet>(); } bulletPool = new Rigidbody[poolSize]; for (poolIt = 0; poolIt < poolSize; ++poolIt) { bulletPool[poolIt] = Instantiate <Rigidbody>(bulletPrefab); bulletPool[poolIt].GetComponent <Bullet>().OnHeadHit += onMannequinHeadHit; bulletPool[poolIt].gameObject.SetActive(false); } poolIt = 0; Intervalle cannonLimits = new Intervalle(); cannonLimits.Max = (float)cannons.Length; cannonLimits.Min = 0f; Intervalle timerLimits = new Intervalle(); timerLimits.Max = 2f; timerLimits.Min = 0.2f; }
public static System.Func <AFloatPairSequence> GetSequenceCtor(uint nbCannons) { switch (SHOTS_SEQUENCE_TYPE) { case Sequence.Type.Random: return(() => { Intervalle cannonLimits = new Intervalle(); cannonLimits.Max = (float)nbCannons; cannonLimits.Min = 0f; Intervalle timerLimits = new Intervalle(); timerLimits.Max = MAX_TIME_BETWEEN_SHOTS; timerLimits.Min = MIN_TIME_BETWEEN_SHOTS; return new RandomFloatPairSequence(cannonLimits, timerLimits); }); default: return(null); } }
public async void RefreshOffreSelectioned() { Region region = (Region)comboBoxRegion.SelectedItem; Contrat contrat = (Contrat)comboBoxContrat.SelectedItem; Poste poste = (Poste)comboBoxPoste.SelectedItem; Intervalle intervalle = new Intervalle(dateTimePickerCreationStart.NullableValue(), dateTimePickerCreationEnd.NullableValue()); // Fix Bug out of Range exception offreSource.DataSource = null; try { var t = controller.GetOffres(new FiltersOffreRequest(region, contrat, poste, intervalle)); await t; offreSource.DataSource = t.Result; } catch { } if (dataGridViewOffre.RowCount > 0) { this.dataGridViewOffre.Columns["Id"].Visible = false; } compteur.Text = dataGridViewOffre.RowCount.ToString(); }
public RandomFloatPairSequence(Intervalle firstValueIntervalle, Intervalle secondValueIntervalle) : base() { FirstValueIntervalle = firstValueIntervalle; SecondValueIntervalle = secondValueIntervalle; }