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)); }
static void Postfix(MapRoomCamera __instance, MapRoomCameraDocking dockingPoint) { if (dockingPoint?.GetComponentInParent <HabitatPlatform.Tag>()) { __instance.gameObject.ensureComponent <MapRoomCameraTransformFix>().init(__instance); } }
static void Postfix(MapRoomCamera __instance) { if (__instance.IsControlled() && GameInput.GetButtonUp(GameInput.Button.RightHand)) { var toggleLights = __instance.GetComponent <ToggleLights>(); toggleLights.SetLightsActive(!toggleLights.lightsActive); toggleLights.energyPerSecond = MapRoomSettings.mapRoomCameraLightEnergyConsumption; } }
static void Postfix(MapRoomCamera __instance) { var toggleLights = __instance.GetComponent <ToggleLights>(); if (toggleLights != null) { toggleLights.SetLightsActive(false); } }
static void Postfix(MapRoomCamera __instance, bool __state) { __instance.lightsParent.SetActive(__state); __instance.GetAllComponentsInChildren <VFXVolumetricLight>().ForEach(x => x.RestoreVolume()); var toggleLights = __instance.GetComponent <ToggleLights>(); toggleLights.lightsOnSound = null; toggleLights.lightsOffSound = null; var lights = toggleLights.lightsParent.GetComponentsInChildren <Light>(); foreach (var light in lights) { light.transform.localRotation = new Quaternion(0, -0.075f, 0, 1); } }
public static bool Prefix(MapRoomCamera __instance) { var mapLights = __instance.lightsParent.GetComponentsInChildren <Light>(); if (mapLights != null) { foreach (var allLights in mapLights) { allLights.spotAngle = MainPatch.spotAngle; allLights.intensity = MainPatch.Intensity; allLights.range = MainPatch.Range; } } return(true); }
public static bool Prefix(MapRoomCamera __instance) { var mapLights = __instance.lightsParent.GetComponentsInChildren <Light>(); if (mapLights != null) { foreach (var allLights in mapLights) { allLights.spotAngle = Config.MapspotAngle; //allLights.color = Config.MapRoomLights.ToColor(true); allLights.intensity = Config.MapIntensity; allLights.range = Config.MapRange; //break; } } return(true); }
static void Prefix(MapRoomCamera __instance, out bool __state) { __state = __instance.lightsParent.activeSelf; }
void Start() => _camera = GetComponent <MapRoomCamera>();
static void Postfix(MapRoomCamera __instance) { __instance.gameObject.EnsureComponent <Drone>(); __instance.gameObject.EnsureComponent <DronePickup>(); }
void init(MapRoomCamera camera) => this.camera = camera;