2020-09-08 04:10:07 -04:00
|
|
|
|
using UnityEngine;
|
2020-07-19 21:36:57 -04:00
|
|
|
|
|
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
|
2020-07-19 21:36:57 -04:00
|
|
|
|
{
|
|
|
|
|
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-07-19 21:36:57 -04:00
|
|
|
|
|
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()
|
2020-07-19 21:36:57 -04:00
|
|
|
|
{
|
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();
|
2020-07-19 21:36:57 -04:00
|
|
|
|
}
|
|
|
|
|
}
|