//checks if the junction has lost the mushroom that was lighting it void Update() { if (isLit && !plant) { isLit = false; system.DisconnectJunction(); } }
void OnDestroy() { if (evil) { CircuitSystem cs = FindObjectOfType <CircuitSystem>(); cs.isLit = false; cs.DisconnectJunction(); } }