示例#1
0
 public void ResetTime()
 {
     timeRemaining = maxTime;
     time          = 0;
     OnTimeChanged?.Invoke(maxTime);
     pro.SetText(Math.Floor(timeRemaining).ToString());
 }
示例#2
0
 void VlcMediaPlayer_TimeChanged(object sender, EventArgs e)
 {
     if (OnTimeChanged != null)
     {
         OnTimeChanged.Invoke(this, EventArgs.Empty);
     }
 }
示例#3
0
 void OnTimeSet(string timeString)
 {
     if (float.TryParse(timeString, out float time))
     {
         OnTimeChanged?.Invoke(time);
     }
 }
示例#4
0
    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();
            }
        }
    }
示例#5
0
 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);
 }
示例#8
0
文件: Timer.cs 项目: dave95b/Puzzles
    private IEnumerator MeasureTime()
    {
        var delay = Yielder.WaitForSeconds(1f);

        while (true)
        {
            yield return(delay);

            elapsedSeconds++;
            OnTimeChanged?.Invoke(elapsedSeconds);
        }
    }
示例#9
0
文件: Timer.cs 项目: MrHungerrr/EXaM
        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);
            }
        }
示例#11
0
 // 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
         }
     }
 }
示例#12
0
        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();
        }
示例#13
0
 public void Next()
 {
     OnEndOfTurn?.Invoke();
     if (Now == Weeks.DecemberFourth)
     {
         Year++;
         Now = Weeks.JanuaryFirst;
     }
     else
     {
         Now++;
     }
     OnTimeChanged?.Invoke();
     OnStartTurn?.Invoke();
 }
示例#14
0
        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();
                }
            }
        }
示例#15
0
    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();
 }
示例#17
0
    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();
        }
    }
示例#18
0
 internal void SystemEvents_TimeChanged(object sender, EventArgs e)
 {
     OnTimeChanged?.Invoke(sender, e);
 }
示例#19
0
    private void SetTime(int time)
    {
        Time.timeScale = time;

        OnTimeChanged?.Invoke(time);
    }
示例#20
0
 private void RefreshTime()
 {
     OnTimeChanged?.Invoke(this, new TimeEventArgs(CurrentTime));
 }
示例#21
0
 private void TimeChanged(object sender, double seconds)
 {
     OnTimeChanged?.Invoke(seconds);
     _appWebServer.OnTimeChanged?.Invoke(seconds);
 }