gui updated
This commit is contained in:
parent
c1f9f61b0c
commit
0c9ea6ed0f
14 changed files with 124 additions and 24 deletions
|
|
@ -1,12 +1,14 @@
|
|||
using Godot;
|
||||
using System;
|
||||
|
||||
public partial class FastForwardButton : TextureButton
|
||||
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()
|
||||
|
|
@ -16,16 +18,18 @@ public partial class FastForwardButton : TextureButton
|
|||
switch (speed)
|
||||
{
|
||||
case 1:
|
||||
TextureNormal = firstSpeed;
|
||||
Icon = firstSpeed;
|
||||
break;
|
||||
case 2:
|
||||
TextureNormal = secondSpeed;
|
||||
Icon = secondSpeed;
|
||||
break;
|
||||
case 3:
|
||||
TextureNormal = thirdSpeed;
|
||||
Icon = thirdSpeed;
|
||||
break;
|
||||
}
|
||||
|
||||
flashAnimator.Play("flash");
|
||||
|
||||
Engine.TimeScale = speed;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public partial class ShovelButton : TextureButton
|
|||
{
|
||||
if (LevelController.Instance.Pools.EntityField[i].TryGetValue(checkedPosition, out var entity) && entity is RuntimePlantData plantData)
|
||||
{
|
||||
plantData.Kill();
|
||||
plantData.Kill();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue