44 lines
1.4 KiB
C#

using UnityEngine;
namespace NanoBrain.Unity.Braitenberg {
/// <summary>
/// A Braitenberg style vehicle with two sensors and two motors, powered by a Nanobrain
/// </summary>
[RequireComponent(typeof(Rigidbody))]
[HelpURL("https://passer.life/documentation/nanobrain/Documentation/html/class_nano_brain_1_1_unity_1_1_braitenberg_1_1_vehicle.html")]
public class Vehicle : MonoBehaviour {
/// <summary>
/// The NanoBrain::Cluster controlling the vehicle
/// </summary>
[Tooltip("The NanoBrain Cluster controlling the vehicle")]
public Cluster brain;
[Header("Motors")]
/// <summary>
/// The left motor
/// </summary>
[Tooltip("The left motor")]
public Motor motorLeft;
/// <summary>
/// The right motor
/// </summary>
[Tooltip("The right motor")]
public Motor motorRight;
[Header("Sensors")]
/// <summary>
/// The front-left sensor
/// </summary>
/// When the vehicle has only one sensor, this can be used as the single sensor
[Tooltip("The front-left sensor")]
public Sensor sensorLeft;
/// <summary>
/// The front-right sensor
/// </summary>
/// When the vehicle has only one sensor, this can be set to null
[Tooltip("The front-right sensor")]
public Sensor sensorRight;
}
}