BArtisan.Thrusters.Regular.BThrusterTransformMove Class Reference
+ Inheritance diagram for BArtisan.Thrusters.Regular.BThrusterTransformMove:

Detailed Description

A thruster that moves game objects using the Transform.position property. It does not require or use the Unity physics engine.

It is best used on GameObjects that do not have a RigidBody. Compared with PhysicsThrusters (like BThrusterForce) it provides an improved precision, considering that the GO are not affected by other forces (like collisions, gravity and so on).

It applies the force to the rigidBodyToPush in the current Up direction of this GameObject, this adds more flexibility as in you can attach the thruster to a different GO than the affected GO. To decide which direction to push you can rotate the thruster GO.

The position is updated (if the thruster works) each frame (Update), and it is based on the following params: this GameObject rotation, throttle and speedPerSecond.

Like all thrusters, it is compatible with most of the Thrusters.Helpers components, including but not limited to controllers (player or animation based) or special effects (Light, Audio and Particles).

The Thruster is built for objects with Transform (2D/3D but not UI elements).

Member Data Documentation

◆ transformToControl

Transform BArtisan.Thrusters.Regular.BThrusterTransformMove.transformToControl

The Game Object to move when the thruster is running. It will be moved in the thruster Green Axis (up) GO direction.

◆ speedPerSecond

float BArtisan.Thrusters.Regular.BThrusterTransformMove.speedPerSecond = 0.1f

How fast the object should move. Speed is multiplied with throttle and added each second as unity distance unit on transform.

◆ accelerationThrottlePerFrame

float BArtisan.Thrusters.BThrusterBase.accelerationThrottlePerFrame = 1f
inherited

Default throttle update value for each time the Accelerate() function is called. Save value is used for Decelerate() but with a negative sign.

◆ debugLog

bool BArtisan.Thrusters.BBaseMonobehaviour.debugLog = false
inherited

Enable to debug this component. Warning: it may result in CPU intensive debug messages (each frame).

Property Documentation

◆ distanceToMove

Vector3 BArtisan.Thrusters.Regular.BThrusterTransformMove.distanceToMove
get

Check how much the GO was moved, for debug purposes.

Returns
The distance (in unity units) that was added to the affected transform last frame.

◆ MinThrottle

float BArtisan.Thrusters.BThrusterBase.MinThrottle
getsetinherited

Minimum value (inclusive) of the throttle/engine power. Non-zero if you want the object never to be still.

◆ MaxThrottle

float BArtisan.Thrusters.BThrusterBase.MaxThrottle
getsetinherited

Maximum value (inclusive) of the throttle/engine power.

◆ IgnitionOn

bool BArtisan.Thrusters.BThrusterBase.IgnitionOn
getsetinherited

Ignition state of the thruster. If on means the throttle can be applied (if no faults are present).

◆ NormalizedThrottle

float BArtisan.Thrusters.BThrusterBase.NormalizedThrottle
getsetinherited

Get the current throttle value as a value between 0-1 (based on the min/max/current throttle).

◆ Normalized100Throttle

int BArtisan.Thrusters.BThrusterBase.Normalized100Throttle
getsetinherited

Get the current throttle value as a value between 0-100 (based on min/max/current throttle).

◆ Throttle

float BArtisan.Thrusters.BThrusterBase.Throttle
getsetinherited

The current raw value of the throttle. It is always clamped between min/max.

◆ acceleratedThisFrame

bool BArtisan.Thrusters.BThrusterBase.acceleratedThisFrame
getinherited

Flag used to keep track if any controller accelerated (at least once) during the current frame.

Member Function Documentation

◆ TurnOn()

virtual void BArtisan.Thrusters.BThrusterBase.TurnOn ( )
virtualinherited

Turn on the thruster (set the ignition on).

Referenced by BArtisan.Thrusters.Helpers.Controllers.BThrusterKeyController.Accelerate().

◆ TurnOff()

virtual void BArtisan.Thrusters.BThrusterBase.TurnOff ( )
virtualinherited

Turn off the thruster (set the ignition off).

Referenced by BArtisan.Thrusters.Helpers.Controllers.BThrusterKeyController.Accelerate().

◆ ToggleOnOff()

virtual void BArtisan.Thrusters.BThrusterBase.ToggleOnOff ( )
virtualinherited

Toggle the ignition, if it is On it will turn it off and viceversa.

Referenced by BArtisan.Thrusters.Helpers.Controllers.BThrusterKeyController.Accelerate().

◆ IsTurnedOnAndHasNoFaults()

virtual bool BArtisan.Thrusters.BThrusterBase.IsTurnedOnAndHasNoFaults ( )
virtualinherited

Checks if the engine is actually running. The ignition must be on and free of problems.

Returns
true if the engine is working and there are no faults

◆ IsTurnedOn()

virtual bool BArtisan.Thrusters.BThrusterBase.IsTurnedOn ( )
virtualinherited

The ignition is on, thruster is powered. It does NOT guarantee the thruster is working, see faults.

Returns

◆ IsTurnedOff()

virtual bool BArtisan.Thrusters.BThrusterBase.IsTurnedOff ( )
virtualinherited

The ignition is off, thruster is not powered on.

Returns

◆ HasFaults()

virtual bool BArtisan.Thrusters.BThrusterBase.HasFaults ( )
virtualinherited

Checks if the thruster has any problems/faults.

Returns
true if the thruster is temporarily broken.

◆ IsFreeOfFaults()

virtual bool BArtisan.Thrusters.BThrusterBase.IsFreeOfFaults ( )
virtualinherited

Checks if the engine is free of problems/faults.

Returns

◆ AddFault()

virtual void BArtisan.Thrusters.BThrusterBase.AddFault ( string  faultUniqueID)
virtualinherited

Add a new problem to this engine. It disables the engine until all the problems are removed.

Parameters
faultUniqueIDEach problem must have an unique string id.

Referenced by BArtisan.Thrusters.Helpers.Faults.BThrusterHelperFault.AddFault().

◆ RemoveFault()

virtual void BArtisan.Thrusters.BThrusterBase.RemoveFault ( string  faultUniqueID)
virtualinherited

Remove a fault (problem). If the fault was the last one (in the list), and the ignition is on the thruster will resume it's effect.

Parameters
faultUniqueIDEach problem must have an unique string id.

Referenced by BArtisan.Thrusters.Helpers.Faults.BThrusterHelperFault.RemoveFault().

◆ RemoveAllFaults()

virtual void BArtisan.Thrusters.BThrusterBase.RemoveAllFaults ( )
virtualinherited

Remove all current faults, restoring the thruster to its original state.

◆ GetFaults()

virtual List<string> BArtisan.Thrusters.BThrusterBase.GetFaults ( )
virtualinherited

Get a list of all current fault ID's.

Returns
fault list clone with ID's.

◆ Accelerate()

virtual void BArtisan.Thrusters.BThrusterBase.Accelerate ( )
virtualinherited

Increase the thruster throttle with the accelerationThrottlePerFrame. To modify the throttle with a specific value use AddThrottle(); The new value is always clamped between min and max throttle values.

Referenced by BArtisan.Thrusters.Helpers.Controllers.BThrusterKeyController.Accelerate().

◆ AddThrottle()

virtual void BArtisan.Thrusters.BThrusterBase.AddThrottle ( float  addValue)
virtualinherited

Add (positive value) or substract (negative value) the throttle value. The new value is always clamped between min and max throttle values.

Parameters
addValuePositive to increase, negative to decrease the throttle.

◆ Decelerate()

virtual void BArtisan.Thrusters.BThrusterBase.Decelerate ( )
virtualinherited

Decrease the thruster throttle with the accelerationThrottlePerFrame. To modify the throttle with a specific value use AddThrottle();

Referenced by BArtisan.Thrusters.Helpers.Controllers.BThrusterKeyController.Accelerate().

◆ SetThrottle()

virtual void BArtisan.Thrusters.BThrusterBase.SetThrottle ( float  newValue)
virtualinherited

Set a new value of the throttle. The new value is always clamped between min and max throttle values.

Parameters
newValue

◆ SetThrottleNormalizedValue()

virtual void BArtisan.Thrusters.BThrusterBase.SetThrottleNormalizedValue ( float  newNormalized)
virtualinherited

Set a new value of the throttle, based on a percent unit interval 0-1. The throttle value will be relative of min/max.

Parameters
newNormalized0 will set the throttle to the minimum value, 0.5f at half and 1f at maximum.

◆ SetThrottle100Value()

virtual void BArtisan.Thrusters.BThrusterBase.SetThrottle100Value ( int  newNormalized)
virtualinherited

Set a new value of the throttle, based on a percent interval 0-100. /// The throttle value will be relative of min/max.

Parameters
newNormalized0 to set the minimum value, 50 to half and 100 to maximum.

◆ SetMinimumThrottle()

virtual void BArtisan.Thrusters.BThrusterBase.SetMinimumThrottle ( )
virtualinherited

Set the throttle to it's minimum value (see MinThrottle). Usually min is 0 and this command is used for Stop.

Referenced by BArtisan.Thrusters.Helpers.Controllers.BThrusterKeyController.Accelerate(), and BArtisan.Thrusters.Helpers.Controllers.BThrusterContinuousController.RestartCoroutine().

◆ SetMaximumThrottle()

virtual void BArtisan.Thrusters.BThrusterBase.SetMaximumThrottle ( )
virtualinherited

◆ GetThrottle()

virtual float BArtisan.Thrusters.BThrusterBase.GetThrottle ( )
virtualinherited

Get the throttle raw value (absolute).

Returns

◆ IsAtMinimumThrottle()

virtual bool BArtisan.Thrusters.BThrusterBase.IsAtMinimumThrottle ( )
virtualinherited

Easy check if the throttle value is equal to MinThrottle.

Returns
boolean

◆ IsAtMaximumThrottle()

virtual bool BArtisan.Thrusters.BThrusterBase.IsAtMaximumThrottle ( )
virtualinherited

Easy check if the throttle value is equal to MaxThrottle.

Returns
boolean