public ActionResult GoSleep() { var username = HttpContext.User.Identity.Name; var user = db.User.Where(x => x.Username == username).FirstOrDefault(); ReloadTimer reloadTimer; if (user.SleepTemporary.Any()) { var sTemp = user.SleepTemporary.LastOrDefault(); //if start sleep time remembered if (!sTemp.StartSleep.Equals(DateTime.MinValue)) //jeśli jest wypełnione { var amountOfSLeep = DateTime.Now - sTemp.StartSleep; reloadTimer = new ReloadTimer { RememberTimer = true, Hours = amountOfSLeep.Hours, Minutes = amountOfSLeep.Minutes, Seconds = amountOfSLeep.Seconds }; } else { throw new Exception(); } } else { reloadTimer = new ReloadTimer { RememberTimer = false } }; return(View(reloadTimer)); }
private void ReloadBtn_Click(object sender, EventArgs e) { if (ReloadTimer.Enabled == false) { if (ShootTimer.Enabled == false) { ReloadTimer.Start(); Reload++; //counts reloads Cap *= 0; //gets rid of excess ammo to simulate a maximum clip Cap += Ammo * 5; //Finds if ammo upgrades have been purchased then sets it #region Reload Sound //////////////////////////////////////////////////////////////////////// try { SoundPlayer sndplayr = new SoundPlayer(ClickingGame.Properties.Resources.Mush_Appear); sndplayr.Play(); } //Plays Reload sound catch (Exception ex) { MessageBox.Show(ex.Message + ": " + ex.StackTrace.ToString(), "Error"); } /////////////////////////////////////////////////////////////////////// #endregion //everything below refresh's the label txt to reflect its current value. ReloadNum.Text = Convert.ToString(Reload); label3.Text = Convert.ToString(Cap); label5.Text = Convert.ToString(Shoot); label7.Text = Convert.ToString(coin); //end } } }
public void Start() { GameStateManager.OnGameEventChanged += CheckEvent; timer = gameObject.AddComponent <ReloadTimer>(); timer.Setup(timeToExpire, true); SetPrefabToCurrentUpgrade(); }
public static void dbReload_OnCommand(CommandEventArgs e) { SpeechData.blockRequests = true; // 2 second pause for pending requests to clear ReloadTimer t = new ReloadTimer(e.Mobile); t.Start(); }
protected override void Awake() { base.Awake(); _targets = new List <Collider>(); AttackAnimationEvent.OnEnd += () => { ReloadTimer.Start(); }; }
public AutoReloader(Action <string> action) { ReloadAction = action; Watcher.Changed += Watcher_Changed; ReloadTimer = new Timer((state) => { ReloadTimer.Change(Timeout.Infinite, Timeout.Infinite); ReloadAction.Invoke(File); }); }
public void Setup(DamageData data) { this.damageData = data; gameObject.name = "Shooter"; enemyOnRangeChecker = gameObject.AddComponent <EnemyOnRangeNoCollider>(); enemyOnRangeChecker.Setup(damageData); weapon = gameObject.AddComponent <Weapon>(); transform.localPosition = Vector3.zero; reloadTimer = gameObject.AddComponent <ReloadTimer>(); reloadTimer.Setup(damageData.reloadTime); }
private void Start() { AttackAnimationEvent.OnStart += () => { _ammo.Reduce(); }; AttackAnimationEvent.OnEnd += () => { if (_ammo.CurrentCount <= 0) { ReloadTimer.Start(); } }; }
public void Start() { this.damageData = GetComponentInParent <DamageData>(); gameObject.name = "Shooter"; animator = GetComponent <Animator>(); enemyOnRangeChecker = gameObject.AddComponent <EnemyOnRangeNoCollider>(); enemyOnRangeChecker.Setup(damageData); weapon = gameObject.AddComponent <Weapon>(); //transform.localPosition = Vector3.zero; reloadTimer = gameObject.AddComponent <ReloadTimer>(); reloadTimer.Setup(damageData.reloadTime); }
// Use this for initialization void Start() { timer = gameObject.AddComponent <ReloadTimer>(); timer.Setup(timeToExpire); timer.Start(); }
private void Start() { reloadTime = GetComponent <ReloadTimer>(); }
void Start() { health = GetComponent <Health>(); timer = gameObject.AddComponent <ReloadTimer>(); timer.Setup(health.timeToResuscitate); }
void Start() { health = GetComponent <Health>(); reloadTimer = gameObject.AddComponent <ReloadTimer>(); reloadTimer.Setup(1f); }
private void Awake() { ReloadTimer = Reload.GetComponentInChildren <ReloadTimer>(); RecoverTimer = Recover.GetComponentInChildren <RecoverTimer>(); }