Fixed Time#
Time / Fixed Time
Can Read
Cannot Write
Description#
The time in seconds since the start of the game in the Physics update
Code#
using System;
using UnityEngine;
using VisualScript.Icons;
namespace VisualScript.Runtime
{
[Get]
[Title("Fixed Time")]
[Category("Time/Fixed Time")]
[Description("The time in seconds since the start of the game in the Physics update")]
[Image(typeof(IconTimer), ColorTheme.Type.TextLight, typeof(BadgePhysics))]
[Keywords("Time", "Clock", "Tick", "Physics")]
[Serializable]
public class TypeNumberTimeFixedTime : TypeNumber
{
public override double GetPreview(GameObject source) => Time.fixedTimeAsDouble;
public override double Get(Args args)
{
return Time.fixedTimeAsDouble;
}
public override string ToString()
{
return "Fixed Time";
}
protected override SubscriptionMode Subscription => SubscriptionMode.OnFixedUpdate;
}
}