Added slicer building prefab

This commit is contained in:
Pasha committed 2026-04-18 14:20:53 +01:00
1 parent 88cf5b7ba9
commit bd2cc16572
10 files changed
+483 -14

No files matched your search

@@ -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
}
}
}
}
}