Class KaijuSensor
Base sensor class.
Inherited Members
Namespace: KaijuSolutions.Agents.Sensors
Syntax
public abstract class KaijuSensor : KaijuBehaviour
Fields
automatic
If this sensor should be run automatically.
Declaration
public bool automatic
Field Value
| Type | Description |
|---|---|
| System.Boolean |
Properties
Agent
The KaijuAgent this sensor is assigned to.
Declaration
public KaijuAgent Agent { get; }
Property Value
| Type | Description |
|---|---|
| KaijuAgent |
Methods
Cleanup()
Perform any needed resetting of the sensor.
Declaration
protected virtual void Cleanup()
EditorVisualize(Vector3)
Allow for visualizing in the editor. The position of the Agent.
Declaration
public virtual void EditorVisualize(Vector3 position)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | position |
Run()
Run the sensor.
Declaration
protected abstract void Run()
Sense()
Run the sensor. There is no point in manually calling this.
Declaration
public void Sense()
Events
OnDisabled
Callback for when this has finishing becoming disabled.
Declaration
public event KaijuAction OnDisabled
Event Type
| Type | Description |
|---|---|
| KaijuAction |
OnDisabledGlobal
Global callback for when this has finishing becoming disabled.
Declaration
public static event KaijuSensorAction OnDisabledGlobal
Event Type
| Type | Description |
|---|---|
| KaijuSensorAction |
OnEnabled
Callback for when this has finishing becoming enabled.
Declaration
public event KaijuAction OnEnabled
Event Type
| Type | Description |
|---|---|
| KaijuAction |
OnEnabledGlobal
Global callback for when this has finishing becoming enabled.
Declaration
public static event KaijuSensorAction OnEnabledGlobal
Event Type
| Type | Description |
|---|---|
| KaijuSensorAction |
OnSense
Callback for when this sensor has been run.
Declaration
public event KaijuAction OnSense
Event Type
| Type | Description |
|---|---|
| KaijuAction |
OnSenseGlobal
Global callback for when this sensor has been run.
Declaration
public static event KaijuSensorAction OnSenseGlobal
Event Type
| Type | Description |
|---|---|
| KaijuSensorAction |
Operators
Implicit(GameObject to KaijuSensor)
Implicit conversion from a GameObject.
Declaration
public static implicit operator KaijuSensor(GameObject o)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | o | The GameObject. |
Returns
| Type | Description |
|---|---|
| KaijuSensor | The sensor attached to the GameObject if there was one. |
Implicit(KaijuSensor to KaijuAgent)
Implicit conversion to a KaijuAgent.
Declaration
public static implicit operator KaijuAgent(KaijuSensor s)
Parameters
| Type | Name | Description |
|---|---|---|
| KaijuSensor | s | The sensor. |
Returns
| Type | Description |
|---|---|
| KaijuAgent | The KaijuAgent attached to the sensor if there was one. |
Implicit(Transform to KaijuSensor)
Implicit conversion from a transform.
Declaration
public static implicit operator KaijuSensor(Transform t)
Parameters
| Type | Name | Description |
|---|---|---|
| Transform | t | The transform. |
Returns
| Type | Description |
|---|---|
| KaijuSensor | The sensor attached to the transform if there was one. |