rj-action-library/Runtime/Time/TimeLine.cs

64 lines
1.1 KiB
C#

using System.Diagnostics;
using System.Collections;
using System.Collections.Generic;
using System;
using Godot;
namespace Rokojori
{
[Tool]
[GlobalClass]
public partial class TimeLine:Resource
{
[Export]
public bool isLooping = false;
[Export]
public float loopStart = 0;
[Export]
public float loopEnd = 100000;
[Export]
public float startSpeed = 1;
[Export]
public bool autoStart = true;
public float delta
{
get
{
var tm = Unique<TimeLineManager>.Get();
return tm.GetRunner( this ).currentDelta;
}
}
public static TimeLine IfNull_ReplaceByGameTime( TimeLine other )
{
if ( other != null )
{
return other;
}
var tm = Unique<TimeLineManager>.Get();
return tm.gameTimeTimeLine;
}
public static TimeLine IfNull_ReplaceByRealTime( TimeLine other )
{
if ( other != null )
{
return other;
}
var tm = Unique<TimeLineManager>.Get();
return tm.realTimeTimeLine;
}
}
}