public void ResetTime() { timeRemaining = maxTime; time = 0; OnTimeChanged?.Invoke(maxTime); pro.SetText(Math.Floor(timeRemaining).ToString()); }
void VlcMediaPlayer_TimeChanged(object sender, EventArgs e) { if (OnTimeChanged != null) { OnTimeChanged.Invoke(this, EventArgs.Empty); } }
void OnTimeSet(string timeString) { if (float.TryParse(timeString, out float time)) { OnTimeChanged?.Invoke(time); } }
IEnumerator StartTimer() { while (_levelInProgress && _timeLeft > 0) { yield return(new WaitForSeconds(1)); _timeLeft -= 1; OnTimeChanged?.Invoke(_timeLeft); if (_nextWarningIndex < TimeLeftWhenWarningPlays.Count) { if (_nextWarningIndex > 0 && _timeLeft > TimeLeftWhenWarningPlays[_nextWarningIndex - 1]) { _nextWarningIndex--; } if (_timeLeft == TimeLeftWhenWarningPlays[_nextWarningIndex]) { OnWarning?.Invoke(_timeLeft); _nextWarningIndex++; } } if (_timeLeft == 0) { WhenTimeRunsOut(); } } }
private void StartLevelTimer() { _dialogSystem.StartSingleLine("Area02_start_timer"); _nextWarningIndex = 0; timerCoroutine = StartCoroutine(StartTimer()); TimerPanel.SetActive(true); OnTimeChanged?.Invoke(_timeLeft); }
public HorsifyVlcMediaController(string vlcPath) { _vlcPlayer = new VlcPlayer(vlcPath); _vlcPlayer.Init(); _isInitialized = true; _vlcPlayer.MediaFinished += () => OnMediaFinished?.Invoke(); _vlcPlayer.MediaLoaded += (x) => OnMediaLoaded?.Invoke(x); _vlcPlayer.TimeChanged += (x) => OnTimeChanged?.Invoke(x); }
private void EndTriAttack() { if(debugMarker != null) debugMarker.gameObject.SetActive(false); positions.Clear(); characterAfterImage.EndAfterImage(); characterMovement.OnCollisionWall -= CallWallCollision; isTriAttacking = false; characterMovement.EndMove(); characterAnimation.State = CharacterState.Idle; if (OnTimeChanged != null) OnTimeChanged.Invoke(0, 0); if (OnEndAction != null) OnEndAction.Invoke(idAttacker); }
private IEnumerator MeasureTime() { var delay = Yielder.WaitForSeconds(1f); while (true) { yield return(delay); elapsedSeconds++; OnTimeChanged?.Invoke(elapsedSeconds); } }
private void SecondDone() { ++_timePassed; _schedule.SecondDone(); OnTimeChanged?.Invoke(); if (_timePassed == _timeGeneral) { TimeDone(); } }
/// <summary> /// Todo. Crossfades / Two decks /// </summary> /// <param name="vlcPath"></param> /// <param name="dualmode"></param> public HorsifyVlcMediaController(string vlcPath, bool dualmode) : this(vlcPath) { if (dualmode) { _vlcPlayer2 = new VlcPlayer(vlcPath); _vlcPlayer2.Init(); _vlcPlayer2IsInitialized = true; _vlcPlayer2.MediaFinished += () => OnMediaFinished?.Invoke(); _vlcPlayer2.MediaLoaded += (x) => OnMediaLoaded?.Invoke(x); _vlcPlayer2.TimeChanged += (x) => OnTimeChanged?.Invoke(x); } }
// Update is called once per frame void Update() { if (curTime > 0 && _startTimer) { curTime -= Time.deltaTime; OnTimeChanged?.Invoke(this, new OnTimeChangedEventArgs { currentTime = (int)curTime }); //call event to change the text field content if (curTime <= 0) { OnStartSignal?.Invoke(this, EventArgs.Empty);//call event to activate movement } } }
public void ScrollTo(Weeks week, int year = -1) { if (year != -1) { this.Year = year; } else if ((int)week < (int)Now) { this.Year++; } Now = week; OnTimeChanged?.Invoke(); }
public void Next() { OnEndOfTurn?.Invoke(); if (Now == Weeks.DecemberFourth) { Year++; Now = Weeks.JanuaryFirst; } else { Now++; } OnTimeChanged?.Invoke(); OnStartTurn?.Invoke(); }
private void Update() { if (timer > 0 && !timeout) { timer -= Time.deltaTime; OnTimeChanged.Invoke(timer); } else if (timer < 0 && !timeout) { timeout = true; OnTimeout.Invoke(); if (loop) { StartTimer(); } } }
void Update() { if (startedTime && timer > 0) { timer -= Time.deltaTime; OnTimeChanged.Invoke(timer); SendReadableTime(); } else if (startedTime) { timer = 0; startedTime = false; OnTimeEnded.Invoke(); SendReadableTime(); } }
// U P D A T E private IEnumerator TriAttackCoroutine() { characterMovement.StartupMove(); t = 0f; while (t < time) { t += Time.deltaTime * characterAnimation.GetMotionSpeed(); if (isJumping == true) UpdateJumpTriAttack(); else UpdateMovement();// Pas framerate machin < ------------------ Il est là le problème if (OnTimeChanged != null) OnTimeChanged.Invoke(totalDistance - (currentDistance - (new Vector2(destination.x, destination.z) - PositionToVector2()).magnitude), totalDistance); CheckIntersection(); CheckCollision(); yield return null; } EndTriAttackCoroutine(); }
private void UpdateTimer() { if (pause) { return; } timeRemaining = (maxTime - time); pro.SetText(Math.Floor(timeRemaining).ToString()); time += Time.fixedDeltaTime; OnTimeChanged?.Invoke(timeRemaining); if (timeRemaining <= 0) { time = 0; outOfTime?.Invoke(); } }
IEnumerator TickClock() { while (timeActivated) { yield return(new WaitForSeconds(10f)); currentMinutes += 10; if (currentMinutes >= 60) { HandleHour(); if (currentHour == 12) { HandleTimeOfTheDay(); } if (currentHour > 12) { currentHour = 1; } } if (currentHour == 12 && currentTimeOfTheDay == TimeOfTheDay.AM) { currentHour = 0; SetDangerousTime(true); } if (currentHour == 2 && currentTimeOfTheDay == TimeOfTheDay.AM) { FinishDay(); } if (onTimeChangedCallback != null) { onTimeChangedCallback.Invoke(); } } }
internal void SystemEvents_TimeChanged(object sender, EventArgs e) { OnTimeChanged?.Invoke(sender, e); }
private void SetTime(int time) { Time.timeScale = time; OnTimeChanged?.Invoke(time); }
private void RefreshTime() { OnTimeChanged?.Invoke(this, new TimeEventArgs(CurrentTime)); }
private void TimeChanged(object sender, double seconds) { OnTimeChanged?.Invoke(seconds); _appWebServer.OnTimeChanged?.Invoke(seconds); }