Nano Brain for Unity v0.1
Loading...
Searching...
No Matches
Public Attributes | Protected Member Functions | Properties | List of all members
Sensor Class Reference

Description

A non-directional sensor.

The sensor has a field of view, but the signal returned does not include a direction

Inheritance diagram for Sensor:
LightSensor TouchSensor

Public Attributes

float sensorRange = 10f
 Maximum distance the sensor detects anything.
 
float sampleInterval = 0.1f
 Time between samples in seconds.
 
LayerMask senseLayer
 Unity Layer for the light objects.
 
Neuron sensoryNeuron
 The NanoBrain::Neuron which is stimulated by this sensor.
 

Protected Member Functions

virtual void Awake ()
 Unity calls Awake when loading an instance of a script component.
 
virtual float SampleSensor ()
 Performs a sampling function to retrieve a new sensor output value.
 

Properties

float output [get, protected set]
 Output value of the sensor.
 

Member Function Documentation

◆ SampleSensor()

virtual float SampleSensor ( )
protectedvirtual

Performs a sampling function to retrieve a new sensor output value.

Returns
0.0

This is a dummy implementation which always returns 0.0 because this component is an abstract sensor

Reimplemented in LightSensor, and TouchSensor.

Member Data Documentation

◆ senseLayer

LayerMask senseLayer

Unity Layer for the light objects.

This is used to improve performance