public void Connect(VirtualMagnetModule module) { connectedModule = module; connectedModule.transform.position = this.transform.position; connectedModule.transform.rotation = this.transform.rotation; (connectedModule.gameObject.AddComponent(typeof(FixedJoint)) as FixedJoint).connectedBody = parent; }
public void Disconnect() { Destroy(connectedModule.GetComponent <FixedJoint>()); connectedModule = null; }