-
Notifications
You must be signed in to change notification settings - Fork 16
SKGLightLaserComponent
The purpose of this component is to offer a simple to use flashlight and laser whether it be handheld or a firearm attachment. You do not need to setup both a flashlight and a laser, one or the other can be used such as only a flashlight or only a laser or both.

There are two data assets used for this component, SKGPDALightLaserInitialize and SKGPDALightLaserSettings. To setup the component, create these data assets and assign them to your SKGLightLaserComponent in the details panel. The images down below are before the change to the data assets was made, but it makes it easier to show in the screenshots what I'm referring to for the settings.

- Light Component Name: This is the name of the light component. In the example it is a spotlight.
- Laser Mesh Component Name: This is the name of the laser mesh to be used.
- Laser Dot Component Name: This is the name of the laser dot to be used.
- Has Infrared Mode: If this is true, this light/laser can go in/out of infrared mode (for use with night vision).


- Max Laser Distance: This is the furthest distance the laser can go. If it goes beyond this range it essentially becomes invisible.
- Laser Scale Factor: This depends on the length of the mesh used as the laser. In the example the laser mesh is 20cm long, so a value of 20 is used for the scale factor. If it was 10cm long, a value of 10 would be used.
- Laser: This is the material the laser will switch to when infrared mode is enabled.
- Laser Dot: This is the material the laser dot will switch to when infrared mode is enabled.

-
Light Strobe Interval: This is how delay between strobes when the light is set to be in strobe mode.
-
Light Intensities: This is an array of light brightness's that can be cycles through.
-
Light Intensities Infrared: This is an array of light brightness's that can be cycles through when in infrared mode.
-
Light Laser Cycle Modes: If you want a tarkov like system where you have a set series of modes to cycle through rather an individual control, you would use this as you can define the modes/features for the user to cycle through.

- SetInfraredMode: This function sets the infrared mode on or off based on if you pass in True or False as a parameter.
- CycleLightLaserMode: This function will cycle your light/laser through the various states defined in Light Laser Cycle Modes.
- SetLaserMode: This function lets you set the laser mode, such as turning it on or off.
- GetLaserMode: This function returns the lasers current mode such as on or off
- IsLaserOn: This function returns a simple true/false for easier use with branches. True if the laser is on, False if it is off.
- SetLightMode: This function will set the light mode based on what you pass in such as on, off, or strobe.
- GetLightMode: This function will return the current light mode such as on, off, or strobe.
- IsLightOn: This function returns a simple true/false for easier use with branches. True if the light is on or strobe, False if it is off.
- SetLightIntensityIndex: This function will set the flashlights brightness intensity based on the given index setup in Light Intensities. If you are in infrared mode it will use the Light Intensities Infrared.
- CycleLightIntensity: This function will iterate over each Light Intensities. If you are in infrared mode it will use the Light Intensities Infrared.
- GetLightSoure: This function returns the light source found from Light Component Name.
- GetLaserMesh: This function returns the laser found from Laser Mesh Component Name.
- GetLaserDot: This function returns the laser dot found from Laser Dot Component Name.
- IsInInfraredMode: This function returns true if the device is currently in infrared mode, false if not.
- OnLaserStateChanged: This event will fire each time the laser state is changed and pass in the new laser state.
- OnLightModeChanged: This event will fire each time the light state is changed and pass in the new light state.
- OnInfraredModeChanged: This event will fire each time infrared mode is changed and pass in the new infrared mode.
- OnLightStrobed: This event will fire each time the light is strobed on/off and will pass in the state of on/off.
- OnLaserImpact: This event will fire each time the laser makes am impact and will pass in the resulting hit information as well as whether or not a valid hit was made.