Sun, Shovel, Fastforward, GUI Improvements

This commit is contained in:
Фёдор Веселов 2024-09-16 09:57:11 +05:00
commit 63935d5978
28 changed files with 546 additions and 45 deletions

View 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;
}
}