mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:35:34 +00:00
39 lines
No EOL
881 B
C#
39 lines
No EOL
881 B
C#
using System.Threading.Tasks;
|
|
using Godot;
|
|
|
|
namespace Cirno.Scripts.UI;
|
|
|
|
public partial class IntroLogos : CanvasLayer
|
|
{
|
|
[Export]
|
|
public float TransitionTime = 4f;
|
|
|
|
[Export]
|
|
public StringName IntroScenePath;
|
|
|
|
private bool _isTransitioning = false;
|
|
|
|
public override void _Ready()
|
|
{
|
|
OptionsMenu.LoadSettings();
|
|
_ = AutoTransition();
|
|
}
|
|
|
|
public override void _Process(double delta)
|
|
{
|
|
if (_isTransitioning) return;
|
|
if (Input.IsAnythingPressed())
|
|
{
|
|
_isTransitioning = true;
|
|
GlobalState.Instance.GotoScene(IntroScenePath);
|
|
}
|
|
}
|
|
|
|
private async Task AutoTransition()
|
|
{
|
|
await Task.Delay((int)(TransitionTime * 1000));
|
|
if (_isTransitioning) return;
|
|
_isTransitioning = true;
|
|
GlobalState.Instance.GotoScene(IntroScenePath);
|
|
}
|
|
} |