4 namespace HKI.Core.GameSystems
13 [SerializeField]
Integer GameSpeed = null;
15 [SerializeField]
float[] GameSpeedFactors =
new float[] { 0.0f, 1.0f, 4.0f, 10.0f };
17 [SerializeField]
Float DeltaTime = null;
18 [SerializeField]
Float FixedDeltaTime = null;
19 [SerializeField]
Float UnscaledDeltaTime = null;
20 [SerializeField]
Float UnscaledFixedDeltaTime = null;
25 GameSpeed.OnValueChanged += UpdateTimeScale;
34 if(UnscaledDeltaTime != null)
35 UnscaledDeltaTime.
SetValue = Time.unscaledDeltaTime;
40 if (FixedDeltaTime != null)
41 FixedDeltaTime.
SetValue = Time.fixedTime;
43 if (UnscaledFixedDeltaTime != null)
44 UnscaledFixedDeltaTime.
SetValue = Time.fixedUnscaledDeltaTime;
49 GameSpeed.OnValueChanged -= UpdateTimeScale;
50 Time.timeScale = 1.0f;
56 Time.timeScale = GameSpeedFactors[GameSpeed.
Value];
This system stores all engine time values so that can be used by other systems without having to call...
Implementation of a float value as a HKIVar via HKIVarGeneric.
Implementation of a integer value as a HKIVar via HKIVarGeneric.