Quantum-Engineering/TurbineImpeller.cs
2020-09-19 20:29:43 -05:00

27 lines
653 B
C#

using UnityEngine;
//! This class handles animations for reactor turbines.
public class TurbineImpeller : MonoBehaviour
{
public GameObject turbine;
private StateManager stateManager;
//! Called by unity engine on start up to initialize variables.
void Start()
{
stateManager = FindObjectOfType<StateManager>();
}
//! Update is called once per frame.
void Update()
{
if (!stateManager.Busy())
{
if (turbine.GetComponent<AudioSource>().isPlaying == true)
{
transform.Rotate(-Vector3.forward * 600 * Time.deltaTime);
}
}
}
}