public void DestroyPlug(bool dontRemoveFromBlock = false) { if (wire != null) { WireManager.UnwirePlug(this, wire); } Debug.Assert(block != null); if (!dontRemoveFromBlock) { block.RemovePlug(this); } Destroy(this.gameObject); }
public void DestroyWire() { WireManager.UnwirePlug(begin, this, false); WireManager.UnwirePlug(end, this, false); Destroy(this.gameObject); }