Unscaled Time#
Time / Unscaled Time
Can Read
Cannot Write
Description#
This is the time in seconds since the start of the game without taking into account time scale
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Unscaled Time")]
[Category("Time/Unscaled Time")]
[Description("This is the time in seconds since the start of the game without taking into account time scale")]
[Image(typeof(IconTimer), ColorTheme.Type.TextLight)]
[Keywords("Time, Clock, Tick")]
[Serializable]
public class TypeNumberTimeUnscaledTime : TypeNumber
{
public override double GetPreview(GameObject source) => Time.unscaledTimeAsDouble;
public override double Get(Args args)
{
return Time.unscaledTimeAsDouble;
}
public override string ToString()
{
return "Unscaled Time";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnUpdate;
}
}