Added slicer building prefab

This commit is contained in:
2026-04-18 14:20:53 +01:00
parent 88cf5b7ba9
commit bd2cc16572
10 changed files with 483 additions and 14 deletions

View File

@@ -1,7 +1,32 @@
namespace Fruitomation.Game
using Fruitomation.Global;
using UnityEngine;
namespace Fruitomation.Game
{
public class SlicerBuilding : Building
{
[Header("Slicer Specific Items")]
[SerializeField] private Animator SlicerAnimator;
private void Update()
{
if (GameStateController.Is(GameState.Simulation))
{
if (SlicerAnimator.speed == 0)
{
SlicerAnimator.Play(0, 0, 0f); // Play from beginning
SlicerAnimator.speed = 1; // Playing
}
}
else
{
if (SlicerAnimator.speed != 0)
{
SlicerAnimator.Play(0, 0, 0f); // Jump back to default frame
SlicerAnimator.speed = 0; // Paused
}
}
}
}
}