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

SetHeadToPhysic() public méthode

public SetHeadToPhysic ( bool active, bool delayPhysics = false ) : void
active bool
delayPhysics bool
Résultat void
        public void SetHeadToPhysic(bool active, bool delayPhysics = false)
        {
            if (active) {
              KAS_Shared.DebugLog("SetHeadToPhysic(Winch) - Create physical object");
              headPhysicModule = part.gameObject.GetComponent<KASModulePhysicChild>();
              if (!headPhysicModule) {
            KAS_Shared.DebugLog(
            "SetHeadToPhysic(Winch) - KASModulePhysicChild do not exist, adding it...");
            headPhysicModule = part.gameObject.AddComponent<KASModulePhysicChild>();
              }
              headPhysicModule.StartPhysics(headTransform.gameObject, headMass, delayPhysics: delayPhysics);
            } else {
              // Yes, it must be immediate. Otherwise, the further code will try to behave on the module.
              DestroyImmediate(headPhysicModule);
            }
        }