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

Description

A sensor which can detect contacts with static GameObjects or Rigidbodies.

Inheritance diagram for TouchSensor:
Sensor

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

override float SampleSensor ()
 Returns the current touching state.
 
virtual void Awake ()
 Unity calls Awake when loading an instance of a script component.
 

Properties

bool touching [get, protected set]
 Is the sensor touching something?
 
float output [get, protected set]
 Output value of the sensor.
 

Member Function Documentation

◆ SampleSensor()

override float SampleSensor ( )
protectedvirtual

Returns the current touching state.

Returns
1.0 when touching something, 0.0 otherwise

Reimplemented from Sensor.

Member Data Documentation

◆ senseLayer

LayerMask senseLayer
inherited

Unity Layer for the light objects.

This is used to improve performance