public override void OnFixedUpdate() { if (count == 0) { if (alarmLight == null) { initPartObjects(); } MEP_Module lab = part.GetComponent <MEP_Module>(); if (lab.MEPlabState == MEPLabStatus.ERROR_ON_START || lab.MEPlabState == MEPLabStatus.ERROR_ON_STOP) { animateAlarmLight(); playSoundFX(); } else { if (curIntensity > 0.01f) { curIntensity = 0f; alarmLight.intensity = curIntensity; lightMat.SetColor(EMISSIVE_COLOR, new Color(0, 0, 0, 1)); } stopSoundFX(); } } count = (count + 1) % 2; }
public override void OnUpdate() { base.OnUpdate(); if (lastUpdate + refreshInterval < Time.time) { lastUpdate = Time.time; MEP_Module lab = part.GetComponent <MEP_Module>(); if (lab.MEPlabState != lastLabStatus) { GameDatabase.TextureInfo newTexture = getTextureForState(lab.MEPlabState); if (newTexture != null) { changeTexture(newTexture); } else { NE_Helper.logError("New Texture null"); } lastLabStatus = lab.MEPlabState; } } }
public override void OnStart(PartModule.StartState state) { base.OnStart(state); if (state == StartState.Editor) { return; } lab = gameObject.GetComponent <MEP_Module>(); foreach (Light child in gameObject.GetComponentsInChildren(typeof(Light))) { if (child.name == "rotationLight") { warnLight = child; } else if (child.name == "WarnPointLlight") { warnPointLight = child; } } }
public override void OnStart(PartModule.StartState state) { base.OnStart(state); if (state == StartState.Editor) { return; } lab = gameObject.GetComponent <MEP_Module>(); if (lab == null) { NE_Helper.logError("MEP_Animation: MEP_Module not found!"); return; } var lights = gameObject.GetComponentsInChildren(typeof(Light)) as Light[]; if (lights == null) { NE_Helper.logError("MEP_Animation: No lights found in MEP_Module!"); return; } for (int idx = 0, count = lights.Length; idx < count; idx++) { var light = lights[idx]; if (light.name == "rotationLight") { warnLight = light; } else if (light.name == "WarnPointLlight") { warnPointLight = light; } } }
public override void OnUpdate() { base.OnUpdate(); if (lastUpdate + refreshInterval < Time.time) { lastUpdate = Time.time; MEP_Module lab = part.GetComponent <MEP_Module>(); string currentExperiment = lab.getExposureSlot().getExperiment().getAbbreviation(); if (currentExperiment != lastExpName) { GameDatabase.TextureInfo newTexture = getTextureForState(currentExperiment); if (newTexture != null) { changeTexture(newTexture); } else { NE_Helper.logError("New Texture null, Exp Name: " + currentExperiment); } lastExpName = currentExperiment; } } }
public override void OnStart(PartModule.StartState state) { base.OnStart(state); if (state == StartState.Editor) { return; } lab = gameObject.GetComponent<MEP_Module>(); foreach (Light child in gameObject.GetComponentsInChildren(typeof(Light))) { if (child.name == "rotationLight") { warnLight = child; } else if (child.name == "WarnPointLlight") { warnPointLight = child; } } }