public override void OnStart(StartState state) { base.OnStart(state); vessel_spawner.Init(part); SpawnManager.Init(part); SpawnManager.SetupSensor(); animator = part.GetAnimator(AnimatorID); damper = ATMagneticDamper.GetDamper(part, DamperID); if (animator != null) { StartCoroutine(Utils.SlowUpdate(spawn_space_keeper)); } if (Kit && !Kit.Empty) { can_construct_in_situ = CanConstruct(Kit); } }
public override void OnStart(StartState state) { base.OnStart(state); #if DEBUG this.Debug( $"prefab model tree: {DebugUtils.formatTransformTree(part.partInfo.partPrefab.transform)}"); #endif loadingDamper = ATMagneticDamper.GetDamper(part, LoadingDamperID); if (loadingDamper == null) { this.ConfigurationInvalid($"Unable to find loading damper with ID {LoadingDamperID}"); return; } launchingDamper = ATMagneticDamper.GetDamper(part, LaunchingDamperID) as ExtensibleMagneticDamper; if (launchingDamper == null) { this.ConfigurationInvalid($"Unable to find launching damper with ID {LoadingDamperID}"); return; } if (!updateSegments((int)numSegments) || !updateScaffold(DeploymentProgress)) { this.ConfigurationInvalid("Unable to initialize dynamic model components"); } setupNumSegmentsControls(); Fields[nameof(ShowUI)].OnValueModified += showUI; Fields[nameof(ShowConstructionUI)].OnValueModified += showConstructionUI; axisController = new AxisAttitudeController(this); UI = new AcceleratorWindow(this); if (ShowUI) { UI.Show(this); } cUI = new ConstructionWindow(this); if (ShowConstructionUI) { cUI.Show(this); } fixConstructionState(); updateWorkforce(); UpdateParams(); UpdateSegmentCost(); }