public void onAnimationStateChange(ROLAnimState newState) { if (newState == ROLAnimState.STOPPED_END && HighLogic.LoadedSceneIsFlight) { engineModule.Activate(); } }
public void ActionActivate(KSPActionParam param) { if (!currentModuleEngine.getIgnitionState) { currentModuleEngine.Activate(); } currentEngineState = currentModuleEngine.getIgnitionState; //Debug.Log("Action currentModuleEngine.Activate(): " + ChooseOption + " new state is: " + currentEngineState); }
public void deployEngineEvent() { AnimState state = animationControl.getAnimationState(); if (state != AnimState.STOPPED_END) { setAnimationState(AnimState.PLAYING_FORWARD); } else { engineModule.Activate(); } setupGuiFields(animationControl.getAnimationState(), engineModule.EngineIgnited); }
public override void OnUpdate() { base.OnUpdate(); if (Input.GetKeyDown(KeyCode.Z) && engineActivated == false) { engine.Activate(); engine.currentThrottle = 1.0f; engineActivated = true; } if (engineActivated) { engine.currentThrottle = 1.0f; } if (Input.GetKeyDown(KeyCode.X)) { engine.currentThrottle = 0f; engine.Shutdown(); engineActivated = false; } if (Input.GetKey(KeyCode.T)) { part.vessel.ActionGroups.SetGroup(KSPActionGroup.SAS, true); } }
public void SetupEngine(int engineIndex, bool isInFlight) { ModuleEnginesFX previousEngine = currentEngine; //Get the new current engine currentEngineIndex = engineIndex; currentEngine = engineList[currentEngineIndex]; currentEngineID = currentEngine.engineID; int count = engineList.Count; for (int index = 0; index < count; index++) { engineList[index].manuallyOverridden = true; engineList[index].isEnabled = false; engineList[index].Shutdown(); } //In-flight stuff if (isInFlight) { currentEngine.Activate(); currentEngine.currentThrottle = previousEngine.currentThrottle; } //Enable current engine currentEngine.manuallyOverridden = false; currentEngine.isEnabled = true; }
public void SetupEngine(int engineIndex, bool isInFlight) { ModuleEnginesFX previousEngine = currentEngine; //Get the new current engine currentEngineIndex = engineIndex; currentEngine = engineList[currentEngineIndex]; currentEngineID = currentEngine.engineID; //In-flight stuff if (isInFlight) { currentEngine.Activate(); currentEngine.currentThrottle = previousEngine.currentThrottle; previousEngine.Shutdown(); } //Disable previous engine previousEngine.manuallyOverridden = true; previousEngine.isEnabled = false; //Enable current engine currentEngine.manuallyOverridden = false; currentEngine.isEnabled = true; }
internal void Abort() { if (_pitchEngine != null) { _pitchEngine.Activate(); Debug.Log(string.Format("{0} Pitch control engine fired!", _myModTag)); } }
internal void Abort() { if (_escapeEngine != null) { _escapeEngine.Activate(); Debug.Log(string.Format("{0} Escape motor fired!", _myModTag)); } }
public override void OnUpdate() { if (!engineIsFX) { engineIsOn = modEng.EngineIgnited; } else { engineIsOn = modEngFX.EngineIgnited; } foreach (var anim in engineStates) { if (engineIsOn && anim.normalizedTime < WaitForAnimation) { anim.speed = 1; if (engineIsFX) { modEngFX.Shutdown(); } else { modEng.Shutdown(); } } if (anim.normalizedTime >= WaitForAnimation && anim.speed > 0) { if (engineIsFX) { modEngFX.Activate(); } else { modEng.Activate(); } } if (anim.normalizedTime >= 1) { anim.speed = 0; anim.normalizedTime = 1; } if (anim.normalizedTime >= 1 && !engineIsOn) { anim.speed = -1; } if (anim.normalizedTime < 0) { anim.speed = 0; anim.normalizedTime = 0; } } }
internal void Jettison() { if (_jettisonEngine != null) { // fire the jettison motor _jettisonEngine.Activate(); Debug.Log(string.Format("{0} LES jettison engine fired!", _myModTag)); } }
/// <summary> /// Tells the controller to start the engine. /// </summary> public virtual void StartEngine() { getCurrentEngine(); if (engine == null) { return; } engine.Activate(); }
public override void OnActive() { if (animationModule.animState == ROLAnimState.STOPPED_END) { engineModule?.Activate(); } else { DeployEngineEvent(); if (engineModule && engineModule.EngineIgnited) { engineModule.Shutdown(); } } }
public void Activate() { switch (engineType) { case EngineType.Engine: engineModule.Activate(); break; case EngineType.EngineFx: engineModuleFx.Activate(); break; default: throw new ArgumentOutOfRangeException(); } }
public void Timelon(float tiempo) { timer += Time.deltaTime; if (timer < tiempo) { deployed = false; motor.Shutdown(); } if (timer >= tiempo) { motor.Activate(); deployed = true; sale = true; enespera = false; timer = 0; } }
private void activateEngine() { if (engineSwitch != null) { engineSwitch.Events["ModeEvent"].Invoke(); String id = engineSwitch.secondaryEngineID; ModuleEnginesFX engFx = null; foreach (PartModule module in part.Modules) { engFx = module as ModuleEnginesFX; if (engFx != null && engFx.engineID == id) { engFx.Activate(); } } } }
public override void RepairPart() { engine = part.FindModuleImplementing <ModuleEngines>(); if (engine == null) { engineFX = part.FindModuleImplementing <ModuleEnginesFX>(); } switch (failureType) { case "Fuel Flow Failure": if (engine != null) { engine.Activate(); } else { engineFX.Activate(); } Debug.Log("[UPFM]: Re-activated " + SYP.ID); break; case "Underthrust": if (engine != null) { engine.thrustPercentage = 100; } else { engineFX.thrustPercentage = 100; } Debug.Log("[UPFM]: Reset Thrust on " + SYP.ID); break; case "Gimbal Failure": gimbal.gimbalLock = false; break; case "Fuel Line Leak": CancelInvoke("LeakFuel"); break; default: return; } }
private bool SetEngineFxSuffix(string suffixName, object value, ModuleEnginesFX moduleEnginesFx) { switch (suffixName) { case "ACTIVE": var activate = Convert.ToBoolean(value); if (activate) { moduleEnginesFx.Activate(); } else { moduleEnginesFx.Shutdown(); } return(true); case "THRUSTLIMIT": var throttlePercent = (float)Convert.ToDouble(value); moduleEnginesFx.thrustPercentage = throttlePercent; return(true); } return(base.SetSuffix(suffixName, value)); }
public void ActivateAction(KSPActionParam param) { currentEngine.Activate(); }
private bool SetEngineFxSuffix(string suffixName, object value, ModuleEnginesFX moduleEnginesFx) { switch (suffixName) { case "ACTIVE": var activate = (bool) value; if (activate) { moduleEnginesFx.Activate(); } else { moduleEnginesFx.Shutdown(); } return true; case "THRUSTLIMIT": var throttlePercent = (float) value; moduleEnginesFx.thrustPercentage = throttlePercent; return false; } return base.SetSuffix(suffixName, value); }