mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-18 23:03:48 +00:00
Added GTWeen
This commit is contained in:
parent
457998788e
commit
2036e4e748
152 changed files with 5889 additions and 7 deletions
|
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using GTweens.Enums;
|
||||
|
||||
namespace GTweens.TweenBehaviours
|
||||
{
|
||||
public sealed class CallbackTweenBehaviour : TweenBehaviour
|
||||
{
|
||||
readonly Action _action;
|
||||
readonly bool _callIfCompletingInstantly;
|
||||
|
||||
public CallbackTweenBehaviour(Action action, bool callIfCompletingInstantly)
|
||||
{
|
||||
_action = action;
|
||||
_callIfCompletingInstantly = callIfCompletingInstantly;
|
||||
}
|
||||
|
||||
public override void Start(bool isCompletingInstantly)
|
||||
{
|
||||
bool canCall = !isCompletingInstantly || _callIfCompletingInstantly;
|
||||
|
||||
if (canCall)
|
||||
{
|
||||
_action?.Invoke();
|
||||
}
|
||||
|
||||
MarkFinished();
|
||||
}
|
||||
|
||||
public override void Reset(bool kill, ResetMode loopResetMode)
|
||||
{
|
||||
MarkUnfinished();
|
||||
}
|
||||
|
||||
public override float GetDuration() => 0f;
|
||||
public override float GetElapsed() => 0f;
|
||||
public override bool GetLoopable() => false;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue