Quantum-Engineering/IronBlock.cs

26 lines
639 B
C#
Raw Normal View History

using UnityEngine;
2020-09-16 21:40:25 -05:00
//! This class is attached to all iron block prefabs.
2021-05-17 12:24:26 -05:00
public class IronBlock : Block
{
public string ID = "unassigned";
public string creationMethod;
public int address;
2020-09-19 20:29:43 -05:00
private StateManager stateManager;
//! Called by unity engine on start up to initialize variables.
public void Start()
{
stateManager = FindObjectOfType<StateManager>();
}
2020-09-16 21:40:25 -05:00
//! Called once per frame by unity engine.
2021-05-17 12:24:26 -05:00
public override void UpdateBlock()
{
2021-05-17 12:24:26 -05:00
if (ID == "unassigned" || stateManager.Busy())
2021-05-16 14:12:13 -05:00
return;
2021-05-17 12:24:26 -05:00
GetComponent<PhysicsHandler>().UpdatePhysics();
}
}