void Update() { if (!mechanism.On && mechanism.IsOn()) { if (working) { SetActivated(true); } } else if (mechanism.On && !mechanism.IsOn()) { SetActivated(false); } }
void Update() { sprite.color = mechanism.IsOn() ? Color.green : Color.red; }