mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 11:15:33 +00:00
Intro player
This commit is contained in:
parent
ceef19e6c9
commit
39fc403219
22 changed files with 531 additions and 3 deletions
35
Scripts/IntroManager.cs
Normal file
35
Scripts/IntroManager.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts;
|
||||
|
||||
public partial class IntroManager : Node
|
||||
{
|
||||
[Export] public string TimelineName { get; set; }
|
||||
[Export] public string NextMap { get; set; }
|
||||
private Node _dialogic;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
_dialogic = this.GetNode("/root/Dialogic");
|
||||
|
||||
_dialogic.Connect("timeline_ended", Callable.From(OnTimelineEnded));
|
||||
|
||||
_dialogic.Call("start", TimelineName);
|
||||
}
|
||||
|
||||
private void OnTimelineEnded()
|
||||
{
|
||||
if (_dialogic.IsConnected("timeline_ended", Callable.From(OnTimelineEnded)))
|
||||
{
|
||||
_dialogic.Disconnect("timeline_ended", Callable.From(OnTimelineEnded));
|
||||
}
|
||||
|
||||
DialogueEndAction();
|
||||
}
|
||||
|
||||
private void DialogueEndAction()
|
||||
{
|
||||
GetTree().ChangeSceneToFile(NextMap);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue