Class ShipInputHandler
Manages ship input by retrieving values from active ShipInputProviders and storing them in ShipInputStates. Automatically polls all registered input providers and combines their inputs. Can be disabled for manual input control via scripting or AI.
Namespace: NWH.DWP2.ShipController
Assembly: NWH.DWP2.dll
Syntax
[Serializable]
public class ShipInputHandler
Fields
| Edit this page View SourceautoSetInput
When enabled input will be auto-retrieved from the InputProviders present in the scene. Disable to manualy set the input through external scripts, i.e. AI controller.
Declaration
[Tooltip("When enabled input will be auto-retrieved from the InputProviders present in the scene.\r\nDisable to manualy set the input through external scripts, i.e. AI controller.")]
public bool autoSetInput
Field Value
| Type | Description |
|---|---|
| bool |
modifyInputCallback
Callback invoked after input is processed each frame. Use this to modify input values programmatically before they are used.
Declaration
public UnityEvent modifyInputCallback
Field Value
| Type | Description |
|---|---|
| UnityEvent |
states
All the input states of the vehicle. Can be used to set input through scripting or copy the inputs over from other vehicle, such as truck to trailer.
Declaration
[Tooltip("All the input states of the vehicle. Can be used to set input through scripting or copy the inputs\r\nover from other vehicle, such as truck to trailer.")]
public ShipInputStates states
Field Value
| Type | Description |
|---|---|
| ShipInputStates |
Properties
| Edit this page View SourceAnchor
Anchor toggle state. True for one frame when anchor input is pressed.
Declaration
public bool Anchor { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
BowThruster
Bow thruster input from -1 to 1.
Declaration
public float BowThruster { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
EngineStartStop
Engine start/stop toggle state. True for one frame when toggle input is pressed.
Declaration
public bool EngineStartStop { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
RotateSail
Sail rotation input for sailing vessels.
Declaration
public float RotateSail { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Steering
Steering input from -1 (port/left) to 1 (starboard/right).
Declaration
public float Steering { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
SternThruster
Stern thruster input from -1 to 1.
Declaration
public float SternThruster { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
SubmarineDepth
Submarine depth control from -1 (surface) to 1 (dive). Clamped to [-1, 1].
Declaration
public float SubmarineDepth { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Throttle
Primary throttle input from -1 (full reverse) to 1 (full forward).
Declaration
public float Throttle { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Throttle2
Secondary throttle for independent engine control.
Declaration
public float Throttle2 { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Throttle3
Tertiary throttle for independent engine control.
Declaration
public float Throttle3 { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Throttle4
Quaternary throttle for independent engine control.
Declaration
public float Throttle4 { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Methods
| Edit this page View SourceUpdate()
Updates all input values from registered input providers. Called automatically by AdvancedShipController.
Declaration
public void Update()