Quantum-Engineering/TurbineImpeller.cs

27 lines
653 B
C#
Raw Normal View History

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