KAS.KASModuleWinch.UnplugHead C# (CSharp) Méthode

UnplugHead() public méthode

public UnplugHead ( bool fireSound = true ) : void
fireSound bool
Résultat void
        public void UnplugHead(bool fireSound = true)
        {
            if (headState == PlugState.Locked || headState == PlugState.Deployed)
              return;

            if (headState == PlugState.PlugUndocked && fireSound) {
              AudioSource.PlayClipAtPoint(
              GameDatabase.Instance.GetAudioClip(connectedPortInfo.module.plugSndPath),
              connectedPortInfo.module.part.transform.position);
            }
            if (headState == PlugState.PlugDocked) {
              Detach();
              if (fireSound) {
            AudioSource.PlayClipAtPoint(
            GameDatabase.Instance.GetAudioClip(connectedPortInfo.module.unplugDockedSndPath),
            connectedPortInfo.module.part.transform.position);
              }
            }
            SetHeadToPhysic(true);
            SetCableJointConnectedBody(headTransform.GetComponent<Rigidbody>());

            connectedPortInfo.module.winchConnected = null;
            connectedPortInfo.module.nodeConnectedPart = null;
            connectedPortInfo.module.plugged = false;
            connectedPortInfo.module = null;
            nodeConnectedPort = null;
            headState = PlugState.Deployed;
        }