public void Unplug() { m_target = null; m_joint.connectedBody = null; m_joint.connectedAnchor = Vector2.zero; m_joint.enabled = false; }
//public bool IsPlugged //{ // //get { return m_target != null || } //} public void PlugTo(Plugable plugable) { m_target = plugable; m_joint.connectedBody = plugable.Rigibody; m_joint.enabled = true; m_connectedAnchorPosition = TransformLocalAnchorToTarget(m_joint.anchor); m_connectedAnchorPositionVelocity = Vector2.zero; }