door (20)
This commit is contained in:
@@ -5,6 +5,9 @@ public partial class Principal : Control
|
||||
{
|
||||
[Export] Panel sub;
|
||||
[Export] Panel credit;
|
||||
[Export] AnimationPlayer anim;
|
||||
bool play_pressed = false;
|
||||
bool enter = false;
|
||||
|
||||
|
||||
Node parent;
|
||||
@@ -12,6 +15,7 @@ public partial class Principal : Control
|
||||
// Called when the node enters the scene tree for the first time.
|
||||
public override void _Ready()
|
||||
{
|
||||
GetTree().Paused = false;
|
||||
parent = GetParent();
|
||||
sub.Visible = false;
|
||||
}
|
||||
@@ -19,6 +23,16 @@ public partial class Principal : Control
|
||||
// Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
public override void _Process(double delta)
|
||||
{
|
||||
if(play_pressed && Input.IsActionJustPressed("valid") && !enter)
|
||||
{
|
||||
enter = true;
|
||||
anim.Play("play2");
|
||||
}else if (enter && Input.IsActionJustPressed("valid"))
|
||||
{
|
||||
//GetTree().Paused = false;
|
||||
parent.Call("ToCityFunc");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void EnterPressed()
|
||||
@@ -40,9 +54,13 @@ public partial class Principal : Control
|
||||
|
||||
public void PlayPressed()
|
||||
{
|
||||
parent.Call("ToCityFunc");
|
||||
//EmitSignal("ToCityEventHandler");
|
||||
//GetTree().ChangeSceneToPacked(play);
|
||||
if (!play_pressed)
|
||||
{
|
||||
play_pressed = true;
|
||||
anim.Play("play");
|
||||
}
|
||||
//parent.Call("ToCityFunc");
|
||||
|
||||
}
|
||||
|
||||
public void ExitGlobPressed()
|
||||
|
||||
Reference in New Issue
Block a user