// ╔════════════════════════════════════════════════════════════════╗
// ║ Copyright © 2025 NWH Coding d.o.o. All rights reserved. ║
// ║ Licensed under Unity Asset Store Terms of Service: ║
// ║ https://unity.com/legal/as-terms ║
// ║ Use permitted only in compliance with the License. ║
// ║ Distributed "AS IS", without warranty of any kind. ║
// ╚════════════════════════════════════════════════════════════════╝
#region
using NWH.Common.Input;
using UnityEngine;
#endregion
namespace NWH.DWP2.ShipController
{
///
/// Base class for all ship input providers.
/// Inherit from this to create custom input systems for ship controls.
/// Provides virtual methods for all ship control inputs including throttle, steering, thrusters, and submarine depth control.
///
public abstract class ShipInputProvider : InputProvider
{
///
/// Horizontal steering input from -1 (port/left) to 1 (starboard/right).
///
/// Steering input value.
public virtual float Steering()
{
return 0f;
}
///
/// Primary throttle input from -1 (full reverse) to 1 (full forward).
///
/// Throttle input value.
public virtual float Throttle()
{
return 0f;
}
///
/// Secondary throttle input for independent engine control.
///
/// Throttle2 input value.
public virtual float Throttle2()
{
return 0f;
}
///
/// Tertiary throttle input for independent engine control.
///
/// Throttle3 input value.
public virtual float Throttle3()
{
return 0f;
}
///
/// Quaternary throttle input for independent engine control.
///
/// Throttle4 input value.
public virtual float Throttle4()
{
return 0f;
}
///
/// Stern thruster input from -1 to 1 for lateral movement at the rear.
///
/// Stern thruster input value.
public virtual float SternThruster()
{
return 0f;
}
///
/// Bow thruster input from -1 to 1 for lateral movement at the front.
///
/// Bow thruster input value.
public virtual float BowThruster()
{
return 0f;
}
///
/// Submarine depth control from -1 (surface) to 1 (dive).
///
/// Submarine depth input value.
public virtual float SubmarineDepth()
{
return 0f;
}
///
/// Toggle engine start/stop state.
///
/// True if engine start/stop was triggered this frame.
public virtual bool EngineStartStop()
{
return false;
}
///
/// Toggle anchor drop/weigh state.
///
/// True if anchor toggle was triggered this frame.
public virtual bool Anchor()
{
return false;
}
///
/// Sail rotation input for sailing vessels.
///
/// Sail rotation input value.
public virtual float RotateSail()
{
return 0f;
}
///
/// Mouse or touch position for object dragging in demo scenes.
///
/// Drag position delta.
public virtual Vector2 DragObjectPosition()
{
return Vector2.zero;
}
///
/// Modifier key for object dragging.
///
/// True if drag modifier is held.
public virtual bool DragObjectModifier()
{
return false;
}
}
}