Ejemplo n.º 1
0
 public void SetTimeBound(TimeBound timebound)
 {
     this.lBound       = timebound.lBound;
     this.lBoundStrict = timebound.lBoundStrict;
     this.uBound       = timebound.uBound;
     this.uBoundStrict = timebound.uBoundStrict;
 }
Ejemplo n.º 2
0
        int ConvertBound(TimeBound span)
        {
            // todo not the safest...
            // todo issue warning if division is not an integer
            var value = (int)Math.Ceiling(span.Bound.TotalMilliseconds / MonitoringDelay.TotalMilliseconds);

            logger.Trace("Convertion of {0} to {1}", span.Bound.ToString(), value);
            logger.Trace("Monitoring Delay : {0}", MonitoringDelay);
            return(value);
        }
Ejemplo n.º 3
0
    private void OnTriggerEnterEvent(Collider2D col)
    {
        if (col.CompareTag("TimeSector"))
        {
            canManipulate = true;
            TimeBound colTimeBound = col.GetComponent <TimeBound>();
            StartCoroutine(_timeBarManager.IncreaseTime(colTimeBound.sectionTime));
            //Having a higher functioning machine leads to a disadvantage as time is decreased per frame. Fixed framerate of 120fps now
            //StartCoroutine(_timeBarManager.IncreaseTime(Mathf.FloorToInt(colTimeBound.sectionTime / (Time.smoothDeltaTime * 30))));
            colTimeBound.SetBound();
            boundTrek.Add(colTimeBound);

            if (colTimeBound.usePopText)
            {
                StartCoroutine(DisplayText(colTimeBound.popText));
                colTimeBound.usePopText = false;
            }

            StartCoroutine(CameraZoom(colTimeBound.cameraSize));
        }

        if (col.CompareTag("Collectable"))
        {
            PositionLogger collectableLogger = col.GetComponent <PositionLogger>();
            if (!collectableLogger.collected)
            {
                StartCoroutine(_timeBarManager.IncreaseTime(_timeBarManager.CurrentTime + collectableLogger.collectableTime));
                collectableLogger.collected = true;
                col.GetComponent <MeshRenderer>().enabled = false;
            }
        }

        if (col.CompareTag("Checkpoint"))
        {
            currentCheckpoint = col.transform;
            boundTrek.Clear();
            StartCoroutine(FadeRestartText());
        }
    }