Ejemplo n.º 1
0
        protected void _updateCurrentVirtualTime()
        {
            TimeExpression currentRealTime = TimeExpression.createTimeOfDay();

            //Debug.Log(currentRealTime.TimeExp);
            if (!suspended)
            {
                //currentVirtualTime.TimeExp +=(currentRealTime.TimeExp-lastRealTimeCheck.TimeExp)*virtualTimeSpeedFactor;
                currentVirtualTime = currentRealTime;
            }

            lastRealTimeCheck = currentRealTime;
        }
Ejemplo n.º 2
0
        public void Awake()
        {
            suspended = false;
            cycle     = 0;
            virtualTimeSpeedFactor = 1.0;
            totalSuspendedRealTime = 0.00;

            TimeExpression currentRealTime = TimeExpression.createTimeOfDay();

            startRealTime      = currentRealTime;
            lastRealTimeCheck  = currentRealTime;
            startVirtualTime   = currentRealTime;
            currentVirtualTime = currentRealTime;
        }
Ejemplo n.º 3
0
        public void setSuspended(bool val)
        {
            TimeExpression currentRealTime = TimeExpression.createTimeOfDay();

            if (suspended && !val)
            {
                _updateCurrentVirtualTime();
                totalSuspendedRealTime += currentRealTime.TimeExp - startSuspendTime.TimeExp;
                suspended = false;
            }
            else if (suspended && val)
            {
                _updateCurrentVirtualTime();
                startSuspendTime = TimeExpression.createTimeOfDay();
                suspended        = true;
            }
        }
Ejemplo n.º 4
0
 public double getElapsedRealTime()
 {
     return(TimeExpression.createTimeOfDay().TimeExp - startRealTime.TimeExp - totalSuspendedRealTime);
 }