Added slicer building prefab
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user