namespace Passer.RoboidControl { /// /// A sensor which can detect touches /// public class TouchSensor : Thing { /// /// Value which is true when the sensor is touching something, false otherwise /// public bool touchedSomething = false; /// /// Create a touch sensor /// /// The participant for with the sensor is needed /// True when the creation should trigger an event public TouchSensor(RemoteParticipant participant, bool invokeEvent = true) : base(participant, invokeEvent) { touchedSomething = false; } #if UNITY_5_3_OR_NEWER /// @copydoc Passer::RoboidControl::Thing::CreateComponent public override void CreateComponent() { this.component = Unity.TouchSensor.Create(this); this.component.core = this; } #endif } }