/// <summary> /// Disconnect wagon from train /// </summary> public void Disconnect(bool disconnectJoint) { if (disconnectJoint) { _carJoint.connectedBody = jointAnchor; } _locomotive = null; if (_sfx.wagonConnectionSFX != null) { _sfx.wagonConnectionSFX.Play(); } coupling = WagonCoupling.Disabled; if (decouplingSettings == WagonDecouplingSettings.AllowRecoupling) { Invoke("ReenabledCoupling", Mathf.Abs(recouplingTimeout)); } }
/// <summary> /// Reenable wagon coupling /// </summary> private void ReenabledCoupling() { coupling = WagonCoupling.Enabled; }