mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-18 09:33:55 +00:00
Added GTWeen
This commit is contained in:
parent
457998788e
commit
2036e4e748
152 changed files with 5889 additions and 7 deletions
53
GTweensGodot/GTweens/Source/TweenBehaviours/WaitTimeTween.cs
Normal file
53
GTweensGodot/GTweens/Source/TweenBehaviours/WaitTimeTween.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
using GTweens.Enums;
|
||||
|
||||
namespace GTweens.TweenBehaviours
|
||||
{
|
||||
public sealed class WaitTimeTweenBehaviour : TweenBehaviour
|
||||
{
|
||||
readonly float _durationSeconds;
|
||||
|
||||
float _elapsedSeconds;
|
||||
|
||||
public WaitTimeTweenBehaviour(float durationSeconds)
|
||||
{
|
||||
_durationSeconds = durationSeconds;
|
||||
}
|
||||
|
||||
public override void Start(bool isCompletingInstantly)
|
||||
{
|
||||
_elapsedSeconds = 0f;
|
||||
}
|
||||
|
||||
public override void Tick(float deltaTime)
|
||||
{
|
||||
_elapsedSeconds += deltaTime;
|
||||
|
||||
if (_elapsedSeconds >= _durationSeconds)
|
||||
{
|
||||
MarkFinished();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Complete()
|
||||
{
|
||||
_elapsedSeconds = _durationSeconds;
|
||||
MarkFinished();
|
||||
}
|
||||
|
||||
public override void Reset(bool kill, ResetMode loopResetMode)
|
||||
{
|
||||
_elapsedSeconds = 0f;
|
||||
MarkUnfinished();
|
||||
}
|
||||
|
||||
public override float GetDuration()
|
||||
{
|
||||
return _durationSeconds;
|
||||
}
|
||||
|
||||
public override float GetElapsed()
|
||||
{
|
||||
return _elapsedSeconds;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue