Esempio n. 1
0
 public void ResetTime()
 {
     timeRemaining = maxTime;
     time          = 0;
     OnTimeChanged?.Invoke(maxTime);
     pro.SetText(Math.Floor(timeRemaining).ToString());
 }
Esempio n. 2
0
 void VlcMediaPlayer_TimeChanged(object sender, EventArgs e)
 {
     if (OnTimeChanged != null)
     {
         OnTimeChanged.Invoke(this, EventArgs.Empty);
     }
 }
Esempio n. 3
0
 void OnTimeSet(string timeString)
 {
     if (float.TryParse(timeString, out float time))
     {
         OnTimeChanged?.Invoke(time);
     }
 }
Esempio n. 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();
            }
        }
    }
Esempio n. 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);
 }
Esempio n. 8
0
    private IEnumerator MeasureTime()
    {
        var delay = Yielder.WaitForSeconds(1f);

        while (true)
        {
            yield return(delay);

            elapsedSeconds++;
            OnTimeChanged?.Invoke(elapsedSeconds);
        }
    }
Esempio n. 9
0
        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);
            }
        }
Esempio n. 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
         }
     }
 }
Esempio n. 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();
        }
Esempio n. 13
0
 public void Next()
 {
     OnEndOfTurn?.Invoke();
     if (Now == Weeks.DecemberFourth)
     {
         Year++;
         Now = Weeks.JanuaryFirst;
     }
     else
     {
         Now++;
     }
     OnTimeChanged?.Invoke();
     OnStartTurn?.Invoke();
 }
Esempio n. 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();
                }
            }
        }
Esempio n. 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();
 }
Esempio n. 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();
        }
    }
Esempio n. 18
0
    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();
            }
        }
    }
Esempio n. 19
0
 internal void SystemEvents_TimeChanged(object sender, EventArgs e)
 {
     OnTimeChanged?.Invoke(sender, e);
 }
Esempio n. 20
0
    private void SetTime(int time)
    {
        Time.timeScale = time;

        OnTimeChanged?.Invoke(time);
    }
Esempio n. 21
0
 private void RefreshTime()
 {
     OnTimeChanged?.Invoke(this, new TimeEventArgs(CurrentTime));
 }
Esempio n. 22
0
 private void TimeChanged(object sender, double seconds)
 {
     OnTimeChanged?.Invoke(seconds);
     _appWebServer.OnTimeChanged?.Invoke(seconds);
 }