FN_TurnOnLightsTask
FN_TurnOnLightsTask enables the warehouse lights and emissive materials, then marks the lighting task complete. It can run a red-light flicker sequence first.
Enabling the lights
private void EnableLights() {
FN_Sound_Manager.PlaySound(SoundType.Click, 1.5f);
foreach (GameObject go_light in go_pointLights)
go_light.SetActive(true);
ApplyEmissionColor(emissionColor * emissionIntensity);
foreach (MeshRenderer mr in mr_lightMeshes)
mat.SetColor("_EmissionColor", emissionColor * emissionIntensity);
MarkTaskComplete();
}
Enables the point lights and emission colour, then calls MarkTaskComplete().
Optional red-light flicker
private IEnumerator FlickerRedRoutine() {
for (int i = 0; i < 3; i++) {
SetLightColor(Color.red);
yield return new WaitForSeconds(0.2f);
SetLightColor(Color.black);
yield return new WaitForSeconds(0.2f);
}
EnableLights();
}
Flashes red and black three times before calling EnableLights().
Completing the task
public override void MarkTaskComplete() {
if (!bl_isCompleted) {
bl_isCompleted = true;
FN_Sound_Manager.PlaySound(SoundType.TaskComplete, 1f);
base.MarkTaskComplete();
}
}
The completion flag prevents this method from playing the task-complete sound twice.