示例#1
0
        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));
        }
示例#2
0
 static void Postfix(MapRoomCamera __instance, MapRoomCameraDocking dockingPoint)
 {
     if (dockingPoint?.GetComponentInParent <HabitatPlatform.Tag>())
     {
         __instance.gameObject.ensureComponent <MapRoomCameraTransformFix>().init(__instance);
     }
 }
示例#3
0
 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;
     }
 }
示例#4
0
        static void Postfix(MapRoomCamera __instance)
        {
            var toggleLights = __instance.GetComponent <ToggleLights>();

            if (toggleLights != null)
            {
                toggleLights.SetLightsActive(false);
            }
        }
示例#5
0
        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);
            }
        }
示例#6
0
        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);
        }
示例#7
0
        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);
        }
示例#8
0
 static void Prefix(MapRoomCamera __instance, out bool __state)
 {
     __state = __instance.lightsParent.activeSelf;
 }
示例#9
0
 void Start() => _camera = GetComponent <MapRoomCamera>();
示例#10
0
 static void Postfix(MapRoomCamera __instance)
 {
     __instance.gameObject.EnsureComponent <Drone>();
     __instance.gameObject.EnsureComponent <DronePickup>();
 }
示例#11
0
 void init(MapRoomCamera camera) => this.camera = camera;