Highroad Engine v1.3
Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Properties | List of all members
MoreMountains.HighroadEngine.BaseController Class Reference

Base class controller. Must be used by vehicles specific controllers. Manages Score and input management. More...

Inheritance diagram for MoreMountains.HighroadEngine.BaseController:
MoreMountains.HighroadEngine.IActorInput MoreMountains.HighroadEngine.AirCarController MoreMountains.HighroadEngine.CarController MoreMountains.HighroadEngine.SolidController

Public Member Functions

virtual bool HasJustFinished (int finalRankPosition)
 Gets a value indicating whether this vehicle has just finished the race. This property will return true only once. More...
 
virtual void MainActionPressed ()
 Button Main Action is being pressed More...
 
virtual void MainActionDown ()
 Button Main Action is pressed down More...
 
virtual void MainActionReleased ()
 Button Main Action is released More...
 
virtual void AltActionPressed ()
 Button Alt Action is being pressed More...
 
virtual void AltActionDown ()
 Button Alt Action is pressed down More...
 
virtual void AltActionReleased ()
 Button Alt Action is released More...
 
virtual void RespawnActionPressed ()
 Button Respawn Action is being pressed More...
 
virtual void RespawnActionDown ()
 Button Respawn Action is pressed down More...
 
virtual void RespawnActionReleased ()
 Button Respawn Action is released More...
 
virtual void LeftPressed ()
 Button Left is being pressed More...
 
virtual void RightPressed ()
 Button Right is being pressed More...
 
virtual void UpPressed ()
 Button Up is being pressed More...
 
virtual void DownPressed ()
 Button Down is being pressed More...
 
virtual void MobileJoystickPosition (Vector2 value)
 Update of the mobile joystick position More...
 
virtual void HorizontalPosition (float value)
 Update of the horizontal value (from -1 to 1) More...
 
virtual void VerticalPosition (float value)
 Update of the vertical value (from -1 to 1) More...
 
virtual void LeftReleased ()
 Button Left is released More...
 
virtual void RightReleased ()
 Button Right is released More...
 
virtual void UpReleased ()
 Button Up is released More...
 
virtual void DownReleased ()
 Button Down is released More...
 
virtual void Respawn ()
 This method triggers the respawn of the vehicle to its last checkpoint More...
 
virtual void OnTriggerEnter (Collider other)
 Describes what happens when the object starts colliding with something Used for checkpoint interaction More...
 
virtual void OnTriggerStay (Collider other)
 Describes what happens when something is colliding with our object Used to apply a boost force to the vehicle while staying in a boost zone. More...
 
virtual void OnTriggerExit (Collider other)
 Describes what happens when the collision ends Removes "boost" state when the vehicle exits a boost zone More...
 
virtual void EnableControls (int controllerId)
 Enables the controls. More...
 
virtual void DisableControls ()
 Disables the controls. More...
 

Public Attributes

float BoostForce = 1f
 the force applied when the vehicle is in a boost zone More...
 
float RigidBodyDragInLoop = 1f
 The temporary value of rigidbody.drag when the vehicle is inside a loop zone. This allows for better movement inside the loop. More...
 
float SteeringSpeed = 100f
 the speed at which the car steers More...
 
bool AutoForward = false
 Set this to true if you want the vehicle to accelerate forever. More...
 

Protected Types

enum  Zones { SpeedBoost , JumpBoost , LoopZone }
 

Protected Member Functions

virtual void Awake ()
 Initializes various references More...
 
virtual void Start ()
 Initializes checkpoints More...
 

Protected Attributes

Rigidbody _rigidbody
 
Collider _collider
 
RaceManager _raceManager
 
Transform[] _checkpoints
 
int _currentWaypoint = 0
 
int _lastWaypointCrossed = -1
 
float _defaultDrag
 
int _controllerId = -1
 
int _finisherPosition = 0
 Ẁhen > 0, vehicle has finished the race. This is it final rank. More...
 
float _currentGasPedalAmount
 

Properties

int CurrentLap [getprotected set]
 Returns the current lap. More...
 
float CurrentSteeringAmount [getset]
 Gets or sets the current steering amount from -1 (full left) to 1 (full right). 0 when none. More...
 
float? CurrentGasPedalAmount [getset]
 Gets or sets the current gas pedal amount. 1 for full acceleration. -1 for full brake or reverse. 0 for nothing. More...
 
virtual bool IsPlaying [getprotected set]
 Gets or sets a value indicating whether this user is playing. More...
 
virtual bool IsGrounded [getprotected set]
 Gets or sets a value indicating whether this instance is grounded. More...
 
virtual bool IsOnSpeedBoost [getprotected set]
 Gets or sets a value indicating whether this instance is on speed boost. More...
 
virtual float Speed [get]
 Gets the vehicle speed. More...
 
virtual int Score [get]
 Gets the player score. More...
 
virtual float DistanceToNextWaypoint [get]
 Gets the distance to the next waypoint. More...
 
int FinalRank [get]
 Gets the final rank. 0 if vehicle has not ended. More...
 

Detailed Description

Base class controller. Must be used by vehicles specific controllers. Manages Score and input management.

Member Enumeration Documentation

◆ Zones

Enumerator
SpeedBoost 
JumpBoost 
LoopZone 

Member Function Documentation

◆ AltActionDown()

virtual void MoreMountains.HighroadEngine.BaseController.AltActionDown ( )
virtual

Button Alt Action is pressed down

Implements MoreMountains.HighroadEngine.IActorInput.

◆ AltActionPressed()

virtual void MoreMountains.HighroadEngine.BaseController.AltActionPressed ( )
virtual

Button Alt Action is being pressed

Implements MoreMountains.HighroadEngine.IActorInput.

◆ AltActionReleased()

virtual void MoreMountains.HighroadEngine.BaseController.AltActionReleased ( )
virtual

Button Alt Action is released

Implements MoreMountains.HighroadEngine.IActorInput.

◆ Awake()

virtual void MoreMountains.HighroadEngine.BaseController.Awake ( )
protectedvirtual

◆ DisableControls()

virtual void MoreMountains.HighroadEngine.BaseController.DisableControls ( )
virtual

Disables the controls.

◆ DownPressed()

virtual void MoreMountains.HighroadEngine.BaseController.DownPressed ( )
virtual

Button Down is being pressed

Implements MoreMountains.HighroadEngine.IActorInput.

◆ DownReleased()

virtual void MoreMountains.HighroadEngine.BaseController.DownReleased ( )
virtual

Button Down is released

Implements MoreMountains.HighroadEngine.IActorInput.

◆ EnableControls()

virtual void MoreMountains.HighroadEngine.BaseController.EnableControls ( int  controllerId)
virtual

Enables the controls.

Parameters
controllerIdController identifier.

◆ HasJustFinished()

virtual bool MoreMountains.HighroadEngine.BaseController.HasJustFinished ( int  finalRankPosition)
virtual

Gets a value indicating whether this vehicle has just finished the race. This property will return true only once.

Parameters
finalRankPositionThe rank of this vehicle when going throught endline. This value will be stored and can be returned by FinalRank propery.

true if this vehicle has finished; otherwise, false.

◆ HorizontalPosition()

virtual void MoreMountains.HighroadEngine.BaseController.HorizontalPosition ( float  value)
virtual

Update of the horizontal value (from -1 to 1)

Parameters
valueValue.

Implements MoreMountains.HighroadEngine.IActorInput.

◆ LeftPressed()

virtual void MoreMountains.HighroadEngine.BaseController.LeftPressed ( )
virtual

Button Left is being pressed

Implements MoreMountains.HighroadEngine.IActorInput.

◆ LeftReleased()

virtual void MoreMountains.HighroadEngine.BaseController.LeftReleased ( )
virtual

Button Left is released

Implements MoreMountains.HighroadEngine.IActorInput.

◆ MainActionDown()

virtual void MoreMountains.HighroadEngine.BaseController.MainActionDown ( )
virtual

Button Main Action is pressed down

Implements MoreMountains.HighroadEngine.IActorInput.

◆ MainActionPressed()

virtual void MoreMountains.HighroadEngine.BaseController.MainActionPressed ( )
virtual

Button Main Action is being pressed

Implements MoreMountains.HighroadEngine.IActorInput.

◆ MainActionReleased()

virtual void MoreMountains.HighroadEngine.BaseController.MainActionReleased ( )
virtual

Button Main Action is released

Implements MoreMountains.HighroadEngine.IActorInput.

◆ MobileJoystickPosition()

virtual void MoreMountains.HighroadEngine.BaseController.MobileJoystickPosition ( Vector2  value)
virtual

Update of the mobile joystick position

Parameters
valueValue.

Implements MoreMountains.HighroadEngine.IActorInput.

◆ OnTriggerEnter()

virtual void MoreMountains.HighroadEngine.BaseController.OnTriggerEnter ( Collider  other)
virtual

Describes what happens when the object starts colliding with something Used for checkpoint interaction

Parameters
otherOther.

◆ OnTriggerExit()

virtual void MoreMountains.HighroadEngine.BaseController.OnTriggerExit ( Collider  other)
virtual

Describes what happens when the collision ends Removes "boost" state when the vehicle exits a boost zone

Parameters
otherOther.

◆ OnTriggerStay()

virtual void MoreMountains.HighroadEngine.BaseController.OnTriggerStay ( Collider  other)
virtual

Describes what happens when something is colliding with our object Used to apply a boost force to the vehicle while staying in a boost zone.

Parameters
otherOther.

◆ Respawn()

virtual void MoreMountains.HighroadEngine.BaseController.Respawn ( )
virtual

This method triggers the respawn of the vehicle to its last checkpoint

Reimplemented in MoreMountains.HighroadEngine.SolidController.

◆ RespawnActionDown()

virtual void MoreMountains.HighroadEngine.BaseController.RespawnActionDown ( )
virtual

Button Respawn Action is pressed down

Implements MoreMountains.HighroadEngine.IActorInput.

◆ RespawnActionPressed()

virtual void MoreMountains.HighroadEngine.BaseController.RespawnActionPressed ( )
virtual

Button Respawn Action is being pressed

Implements MoreMountains.HighroadEngine.IActorInput.

◆ RespawnActionReleased()

virtual void MoreMountains.HighroadEngine.BaseController.RespawnActionReleased ( )
virtual

Button Respawn Action is released

Implements MoreMountains.HighroadEngine.IActorInput.

◆ RightPressed()

virtual void MoreMountains.HighroadEngine.BaseController.RightPressed ( )
virtual

Button Right is being pressed

Implements MoreMountains.HighroadEngine.IActorInput.

◆ RightReleased()

virtual void MoreMountains.HighroadEngine.BaseController.RightReleased ( )
virtual

Button Right is released

Implements MoreMountains.HighroadEngine.IActorInput.

◆ Start()

virtual void MoreMountains.HighroadEngine.BaseController.Start ( )
protectedvirtual

Initializes checkpoints

Reimplemented in MoreMountains.HighroadEngine.SolidController.

◆ UpPressed()

virtual void MoreMountains.HighroadEngine.BaseController.UpPressed ( )
virtual

Button Up is being pressed

Implements MoreMountains.HighroadEngine.IActorInput.

◆ UpReleased()

virtual void MoreMountains.HighroadEngine.BaseController.UpReleased ( )
virtual

Button Up is released

Implements MoreMountains.HighroadEngine.IActorInput.

◆ VerticalPosition()

virtual void MoreMountains.HighroadEngine.BaseController.VerticalPosition ( float  value)
virtual

Update of the vertical value (from -1 to 1)

Parameters
valueValue.

Implements MoreMountains.HighroadEngine.IActorInput.

Member Data Documentation

◆ _checkpoints

Transform [] MoreMountains.HighroadEngine.BaseController._checkpoints
protected

◆ _collider

Collider MoreMountains.HighroadEngine.BaseController._collider
protected

◆ _controllerId

int MoreMountains.HighroadEngine.BaseController._controllerId = -1
protected

◆ _currentGasPedalAmount

float MoreMountains.HighroadEngine.BaseController._currentGasPedalAmount
protected

◆ _currentWaypoint

int MoreMountains.HighroadEngine.BaseController._currentWaypoint = 0
protected

◆ _defaultDrag

float MoreMountains.HighroadEngine.BaseController._defaultDrag
protected

◆ _finisherPosition

int MoreMountains.HighroadEngine.BaseController._finisherPosition = 0
protected

Ẁhen > 0, vehicle has finished the race. This is it final rank.

◆ _lastWaypointCrossed

int MoreMountains.HighroadEngine.BaseController._lastWaypointCrossed = -1
protected

◆ _raceManager

RaceManager MoreMountains.HighroadEngine.BaseController._raceManager
protected

◆ _rigidbody

Rigidbody MoreMountains.HighroadEngine.BaseController._rigidbody
protected

◆ AutoForward

bool MoreMountains.HighroadEngine.BaseController.AutoForward = false

Set this to true if you want the vehicle to accelerate forever.

◆ BoostForce

float MoreMountains.HighroadEngine.BaseController.BoostForce = 1f

the force applied when the vehicle is in a boost zone

◆ RigidBodyDragInLoop

float MoreMountains.HighroadEngine.BaseController.RigidBodyDragInLoop = 1f

The temporary value of rigidbody.drag when the vehicle is inside a loop zone. This allows for better movement inside the loop.

◆ SteeringSpeed

float MoreMountains.HighroadEngine.BaseController.SteeringSpeed = 100f

the speed at which the car steers

Property Documentation

◆ CurrentGasPedalAmount

float? MoreMountains.HighroadEngine.BaseController.CurrentGasPedalAmount
getset

Gets or sets the current gas pedal amount. 1 for full acceleration. -1 for full brake or reverse. 0 for nothing.

The current gas pedal amount.

◆ CurrentLap

int MoreMountains.HighroadEngine.BaseController.CurrentLap
getprotected set

Returns the current lap.

◆ CurrentSteeringAmount

float MoreMountains.HighroadEngine.BaseController.CurrentSteeringAmount
getset

Gets or sets the current steering amount from -1 (full left) to 1 (full right). 0 when none.

The current steering amount.

◆ DistanceToNextWaypoint

virtual float MoreMountains.HighroadEngine.BaseController.DistanceToNextWaypoint
get

Gets the distance to the next waypoint.

The distance to next waypoint.

◆ FinalRank

int MoreMountains.HighroadEngine.BaseController.FinalRank
get

Gets the final rank. 0 if vehicle has not ended.

The final rank.

◆ IsGrounded

virtual bool MoreMountains.HighroadEngine.BaseController.IsGrounded
getprotected set

Gets or sets a value indicating whether this instance is grounded.

true if this instance is grounded; otherwise, false.

◆ IsOnSpeedBoost

virtual bool MoreMountains.HighroadEngine.BaseController.IsOnSpeedBoost
getprotected set

Gets or sets a value indicating whether this instance is on speed boost.

true if this instance is on speed boost; otherwise, false.

◆ IsPlaying

virtual bool MoreMountains.HighroadEngine.BaseController.IsPlaying
getprotected set

Gets or sets a value indicating whether this user is playing.

true if this instance is playing; otherwise, false.

◆ Score

virtual int MoreMountains.HighroadEngine.BaseController.Score
get

Gets the player score.

The score.

◆ Speed

virtual float MoreMountains.HighroadEngine.BaseController.Speed
get

Gets the vehicle speed.

The speed.


The documentation for this class was generated from the following file: