file refactor
This commit is contained in:
parent
da5a3e874b
commit
bffb012a26
175 changed files with 1086 additions and 1107 deletions
36
scripts/gui/FastForwardButton.cs
Normal file
36
scripts/gui/FastForwardButton.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using Godot;
|
||||
|
||||
namespace Newlon.Components.GUI;
|
||||
|
||||
public partial class FastForwardButton : Button
|
||||
{
|
||||
[Export] private Texture2D firstSpeed;
|
||||
[Export] private Texture2D secondSpeed;
|
||||
[Export] private Texture2D thirdSpeed;
|
||||
|
||||
[Export] private AnimationPlayer flashAnimator;
|
||||
|
||||
private int speed = 1;
|
||||
|
||||
public void OnPressed()
|
||||
{
|
||||
speed = Mathf.Wrap(speed+1, 1, 4);
|
||||
|
||||
switch (speed)
|
||||
{
|
||||
case 1:
|
||||
Icon = firstSpeed;
|
||||
break;
|
||||
case 2:
|
||||
Icon = secondSpeed;
|
||||
break;
|
||||
case 3:
|
||||
Icon = thirdSpeed;
|
||||
break;
|
||||
}
|
||||
|
||||
flashAnimator.Play("flash");
|
||||
|
||||
Engine.TimeScale = speed;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue