mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-22 01:23:48 +00:00
Added GTWeen
This commit is contained in:
parent
457998788e
commit
2036e4e748
152 changed files with 5889 additions and 7 deletions
25
GTweensGodot/Godot/Source/Contexts/GodotGTweensContext.cs
Normal file
25
GTweensGodot/Godot/Source/Contexts/GodotGTweensContext.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
using GTweens.Contexts;
|
||||
|
||||
namespace GTweensGodot.Contexts;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a context for managing tweens in the Godot environment.
|
||||
/// </summary>
|
||||
public class GodotGTweensContext
|
||||
{
|
||||
public static readonly GodotGTweensContext Instance = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the unpausable context for managing tweens. This context is always running, even when GetTree().Paused
|
||||
/// is set to true.
|
||||
/// </summary>
|
||||
public GTweensContext UnpausableContext { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the pausable context for managing tweens. This context is stops running when GetTree().Paused
|
||||
/// is set to true.
|
||||
/// </summary>
|
||||
public GTweensContext PausableContext { get; } = new();
|
||||
|
||||
GodotGTweensContext() { }
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://di15j01ica1hi
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
using Godot;
|
||||
|
||||
namespace GTweensGodot.Contexts;
|
||||
|
||||
public partial class GodotGTweensContextNode : Node
|
||||
{
|
||||
public sealed override void _Ready()
|
||||
{
|
||||
ProcessMode = ProcessModeEnum.Always;
|
||||
}
|
||||
|
||||
public sealed override void _Process(double delta)
|
||||
{
|
||||
float floatDelta = (float)delta;
|
||||
|
||||
if (!GetTree().Paused)
|
||||
{
|
||||
GodotGTweensContext.Instance.PausableContext.Tick(floatDelta);
|
||||
}
|
||||
|
||||
GodotGTweensContext.Instance.UnpausableContext.Tick(floatDelta);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
uid://b51ltpwp3fkt0
|
||||
Loading…
Add table
Add a link
Reference in a new issue