diff --git a/Source/KSPCommunityPartModules.csproj b/Source/KSPCommunityPartModules.csproj index 00c6e67..9b8fd37 100644 --- a/Source/KSPCommunityPartModules.csproj +++ b/Source/KSPCommunityPartModules.csproj @@ -40,7 +40,6 @@ - diff --git a/Source/Modules/ModuleCoPFollowTransform.cs b/Source/Modules/ModuleCoPFollowTransform.cs deleted file mode 100644 index 4a71d87..0000000 --- a/Source/Modules/ModuleCoPFollowTransform.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - Usecase: Making the Centre of Pressure follow a transform on the same part. - Example: BoringCrewServices Starliner main parachutes - Originally By: Sofie Brink - Originally For: KSPCommunityPartModules -*/ -using UnityEngine; - -namespace KSPCommunityPartModules.Modules -{ - public class ModuleCoPFollowTransform : PartModule - { - public const string MODULENAME = nameof(ModuleCoPFollowTransform); - - [KSPField] - public string transformName; - - [SerializeField] - private Transform followTransform; - - public override void OnLoad(ConfigNode node) - { - Debug.LogWarning($"[{MODULENAME}] This module is deprecated! please use ModuleCenterFollowTransform instead!"); - if (followTransform == null || followTransform.name != transformName) - { - if (transformName != null) followTransform = part.FindModelTransform(transformName); - if (followTransform == null) Debug.LogError($"[{MODULENAME}] transformName '{transformName}' was empty or does not exist on part '{part.partInfo?.name}'"); - } - - if (followTransform == null && part.partInfo != null) - { - // this may be important if someone is swapping out versions of this module with B9PS - // Note this probably isn't correct for parts that also have modules that mess with this field (e.g. ModuleProceduralFairing) - part.CoPOffset = part.partInfo.partPrefab.CoPOffset; - } - - // NOTE: isEnabled will be persisted to the save file, but we want to treat it purely as runtime state - this.isEnabled = followTransform != null; - this.enabled = followTransform != null && HighLogic.LoadedSceneIsFlight; - } - - public void FixedUpdate() - { - // Note that we shouldn't ever get here if the transform just didn't exist - // But it's certainly possible for *something* to delete it later - if (followTransform == null) - { - isEnabled = false; - enabled = false; - // should we reset CoPOffset here? Not sure. - } - else - { - part.CoPOffset = part.transform.InverseTransformPoint(followTransform.position); - } - } - } -}