Sensors Receiver Component

Essentials.Core.Sensors namespace is needed for this.

The Sensors Receiver component is responsible for reacting in a certain way when the sensors cast from the Sensors component are detected.

It works together with the Sensors component, and is required for the Sensors system to work.

Sensors Receiver component properties

Configuring the callback type

Callback type property

The callback type determines what happens, when the sensors are detected.

By default, the callback type is set to Disable Renderer, which automatically disables the renderer when there are no sensors detected, and only enables it when it is being detected by the sensors.

Assigning custom callback type

If you want to have custom behavior instead of the default one, which is disabling the renderer, you can set the callback type to Custom. By switching to the custom option, you can subscribe to two UnityEvent properties: OnSensorsReceived and OnSensorsLost.

OnSensorsReceived event is fired once when the sensors are first detected. OnSensorsLost event is fired once when the sensors are no longer being detected.

Sensors Receiver custom callback type

Changing the check interval

Check interval property

Check interval property is defined in seconds.

By default, the receiver checks every second for any sensors being present at the moment. To optimize the performance, you can change the check interval to your needs.

Configuring the Sensors ID

Sensors Id property

The Sensors Id property can be configured to detect sensors fired only from a certain Sensors component that match by the ID. By default, this property is set to 0.

Last updated