Sun, Shovel, Fastforward, GUI Improvements
This commit is contained in:
parent
26c3aeb7e9
commit
63935d5978
28 changed files with 546 additions and 45 deletions
31
scripts/components/gui/FastForwardButton.cs
Normal file
31
scripts/components/gui/FastForwardButton.cs
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class FastForwardButton : TextureButton
|
||||
{
|
||||
[Export] private Texture2D firstSpeed;
|
||||
[Export] private Texture2D secondSpeed;
|
||||
[Export] private Texture2D thirdSpeed;
|
||||
|
||||
private int speed = 1;
|
||||
|
||||
public void OnPressed()
|
||||
{
|
||||
speed = Mathf.Wrap(speed+1, 1, 4);
|
||||
|
||||
switch (speed)
|
||||
{
|
||||
case 1:
|
||||
TextureNormal = firstSpeed;
|
||||
break;
|
||||
case 2:
|
||||
TextureNormal = secondSpeed;
|
||||
break;
|
||||
case 3:
|
||||
TextureNormal = thirdSpeed;
|
||||
break;
|
||||
}
|
||||
|
||||
Engine.TimeScale = speed;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue