Files
Fruitomation/Assets/Scripts/Game/Buildings/SlicerBuilding.cs
2026-04-18 14:20:53 +01:00

32 lines
865 B
C#

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