Exemplo n.º 1
0
        /// <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));
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Reenable wagon coupling
 /// </summary>
 private void ReenabledCoupling()
 {
     coupling = WagonCoupling.Enabled;
 }