public void Start() { if (HighLogic.LoadedSceneIsFlight || HighLogic.LoadedSceneIsEditor) { fuelAmount = GetResourceAmount(FuelName); maxFuelAmount = GetMaxResourceAmount(FuelName); // Catchup } if (HighLogic.LoadedSceneIsFlight) { GameEvents.OnVesselRollout.Add(new EventData <ShipConstruct> .OnEvent(OnVesselRollout)); DoCatchup(); if (OnLightAnimatorName != "") { onAnimator = this.GetComponents <ModuleColorAnimator>().ToList().Find(x => x.moduleID == OnLightAnimatorName); } if (OffLightAnimatorName != "") { offAnimator = this.GetComponents <ModuleColorAnimator>().ToList().Find(x => x.moduleID == OffLightAnimatorName); } if (AlertLightAnimatorName != "") { alertAnimator = this.GetComponents <ModuleColorAnimator>().ToList().Find(x => x.moduleID == AlertLightAnimatorName); } } }
public void Start() { if (engineID != "") { //Utils.Log($"{engineID} , {this.GetComponents<ModuleEnginesFX>().ToList().Count}, {this.GetComponents<ModuleEnginesFX>().ToList().Find(x => x.engineID == engineID)}"); engine = this.GetComponents <ModuleEnginesFX>().ToList().Find(x => x.engineID == engineID); //Utils.Log($"{engineID} , {this.GetComponents<ModuleWaterfallFX>().ToList().Count}, {this.GetComponents<ModuleWaterfallFX>().ToList().Find(x => x.engineID == engineID)}"); waterfallEffect = this.GetComponents <ModuleWaterfallFX>().ToList().Find(x => x.engineID == engineID); } else { engine = this.GetComponents <ModuleEnginesFX>().ToList().First(); waterfallEffect = this.GetComponents <ModuleWaterfallFX>().ToList().First(); } savedThrust = engine.maxThrust; multiEngine = this.GetComponent <MultiModeEngine>(); emissiveAnimator = this.GetComponents <ModuleColorAnimator>().ToList().Find(x => x.moduleID == emissiveColorAnimatorID); // Set up animations if (PulseAnimation != "") { pulseStates = Utils.SetUpAnimation(PulseAnimation, part); foreach (AnimationState pulseState in pulseStates) { pulseState.layer = 1; } } SetupLight(); /// Reload nodes as needed if (HighLogic.LoadedSceneIsFlight || HighLogic.LoadedSceneIsEditor) { if (LaserAnimations && (laserFX == null || laserFX.Count == 0)) { ConfigNode node = GameDatabase.Instance.GetConfigs("PART"). Single(c => part.partInfo.name == c.name).config. GetNodes("MODULE").Single(n => n.GetValue("name") == moduleName && n.GetValue("engineID") == engineID); OnLoad(node); } } }