public override bool Detach(bool updateGroup = true) { if (m_isAttached == false && m_welded == false) { return(false); } m_isAttached = false; if (m_constraint == null) { base.Detach(updateGroup); return(m_welded); } if (updateGroup) { m_rotorGrid.OnPhysicsChanged -= cubeGrid_OnPhysicsChanged; } Debug.Assert(m_motor != null); m_motor.Dispose(); base.Detach(updateGroup); return(true); }
protected override void DisposeConstraint() { if (m_constraint != null) { CubeGrid.Physics.RemoveConstraint(m_constraint); m_constraint.Dispose(); m_constraint = null; m_motor.Dispose(); } }
public override bool Detach(bool updateGroup = true, bool reattach = true) { m_isAttached = false; if (m_constraint == null) { return(false); } Debug.Assert(m_motor != null); m_motor.Dispose(); base.Detach(updateGroup, reattach); return(true); }