Added heat exchanger building
This commit is contained in:
32
Assets/Scripts/Game/Buildings/HeatExchanger.cs
Normal file
32
Assets/Scripts/Game/Buildings/HeatExchanger.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using Fruitomation.Global;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Fruitomation.Game
|
||||
{
|
||||
public class HeatExchanger : Building
|
||||
{
|
||||
[Header("Heat Exchanger Specific Items")]
|
||||
[SerializeField] private Animator Animator;
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (GameStateController.Is(GameState.Simulation))
|
||||
{
|
||||
if (Animator.speed == 0)
|
||||
{
|
||||
Animator.Play(0, 0, 0f); // Play from beginning
|
||||
Animator.speed = 0.2f; // Playing
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if (Animator.speed != 0)
|
||||
{
|
||||
Animator.Play(0, 0, 0f); // Jump back to default frame
|
||||
Animator.speed = 0; // Paused
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Game/Buildings/HeatExchanger.cs.meta
Normal file
3
Assets/Scripts/Game/Buildings/HeatExchanger.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a40d30ecee1430c9a21ab42f4290132
|
||||
timeCreated: 1776951500
|
||||
Reference in New Issue
Block a user