static void Postfix(MapRoomCamera __instance) { var toggleLights = __instance.GetComponent <ToggleLights>(); if (toggleLights == null) { toggleLights = __instance.gameObject.AddComponent <ToggleLights>(); } toggleLights.lightsParent = __instance.lightsParent; toggleLights.energyMixin = __instance.energyMixin; toggleLights.SetLightsActive(false); var seaMothTemplate = SeaMothTemplate.Get(); var seaMothToggleLights = seaMothTemplate.toggleLights; MapRoomCamera_ControlCamera_Patch.lightsOnSound = seaMothToggleLights.lightsOnSound; MapRoomCamera_ControlCamera_Patch.lightsOffSound = seaMothToggleLights.lightsOffSound; toggleLights.onSound = seaMothToggleLights.onSound; toggleLights.offSound = seaMothToggleLights.offSound; var lights = toggleLights.lightsParent.GetComponentsInChildren <Light>(); foreach (var light in lights) { light.gameObject.SetActive(true); light.intensity = 0.8f; light.range = 40f; light.transform.localRotation = new Quaternion(0, -0.075f, 0, 1); } CustomVolumetricLight.CreateVolumetricLight(lights[0], seaMothTemplate, new Vector3(0.032f, -0.027f, -0.05f)); CustomVolumetricLight.CreateVolumetricLight(lights[1], seaMothTemplate, new Vector3(-0.058f, 0.049f, -0.05f)); }
public ExosuitCustomLight() { lightsParent = this.transform.Find("lights_parent").gameObject; energyInterface = GetComponentInParent <EnergyInterface>(); var lights = lightsParent.GetComponentsInChildren <Light>(); lightLeft = lights[0]; lightRight = lights[1]; SeaMoth seaMothTemplate = SeaMothTemplate.Get(); CreateToggleLights(seaMothTemplate); var offset = new Vector3(0, 0.41f, -0.37f); CustomVolumetricLight.CreateVolumetricLight(lightLeft, seaMothTemplate, offset); CustomVolumetricLight.CreateVolumetricLight(lightRight, seaMothTemplate, offset); }