namespace SM.Utility
{
///
/// A assistant to control the delta time.
///
public class Deltatime
{
///
/// Scaling of the delta time.
/// Default: 1
///
public float Scale;
///
/// If true, it uses , otherwise .
/// Default: false
///
public bool UseRender;
///
/// The current update delta time.
///
public static float UpdateDelta { get; internal set; }
public static float FixedUpdateDelta { get; set; }
///
/// The current render delta time.
///
public static float RenderDelta { get; internal set; }
///
/// The calculated delta time.
///
public float DeltaTime => (UseRender ? RenderDelta : UpdateDelta) * Scale;
///
/// Creates a delta time assistant.
///
/// The start scale for the delta time. Default: 1
///
/// If true, it uses , otherwise . Default:
/// false
///
public Deltatime(float scale = 1, bool useRender = false)
{
UseRender = useRender;
Scale = scale;
}
}
}