
Detailed Description
While the "regular" thrusters move only a specific GameObject, the Applied thrusters move all the objects, except the attached one.
The force is added each Physics frame (FixedUpdate) while all the conditions are met. It works with all GO that have a Collider and a Rigidbody, are in a specific layer (affectedOnlyLayer) and are located in a sphere of "radius" units (surrounding this GO).
The Sphere radius (affected zone) is drawed in Scene editor also, for debuging purposes. The vector force is drawed in Scene editor with a red line (when is applied).
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 3D environments (it uses Rigidbody and Collider components).
Member Data Documentation
◆ affectOnlyLayer
LayerMask BArtisan.Thrusters.Applied.BThrusterAppliedCollider.affectOnlyLayer = ~0 |
This thruster affects only GO that belong to the following layer.
◆ queryTriggerInteraction
QueryTriggerInteraction BArtisan.Thrusters.Applied.BThrusterAppliedCollider.queryTriggerInteraction = QueryTriggerInteraction.UseGlobal |
When a collider is found it can apply a 'trigger' on it. See the Unity docs for more details.
◆ radius
float BArtisan.Thrusters.Applied.BThrusterAppliedCollider.radius = 3 |
The affected sphere radius, this object's area of effect. It does NOT scale with the GO transform.
◆ ignoreAffectedMass
bool BArtisan.Thrusters.Applied.BThrusterAppliedCollider.ignoreAffectedMass = false |
If true the force applied will be ForceMode.Acceleration, otherwise ForceMode.Force.
◆ maxColliders
int BArtisan.Thrusters.Applied.BThrusterAppliedCollider.maxColliders = 10 |
The maximum amount of colliders allowed to interact each fixed frame. The rest will be ignored.
◆ forceTypeRange
|
inherited |
You can control the applied force strength based on the distance from the thruster. For more info see ForceAppliedTypeRange.
◆ force
|
inherited |
The strength of the force applied to the objects, is multiplied by the throttle.
◆ forceTypeDirection
|
inherited |
Do you want the affected GO to be pulled or pushed? For more info see ForceAppliedTypeDirection.
◆ accelerationThrottlePerFrame
|
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
|
inherited |
Enable to debug this component. Warning: it may result in CPU intensive debug messages (each frame).
Property Documentation
◆ MinThrottle
|
getsetinherited |
Minimum value (inclusive) of the throttle/engine power. Non-zero if you want the object never to be still.
◆ MaxThrottle
|
getsetinherited |
Maximum value (inclusive) of the throttle/engine power.
◆ IgnitionOn
|
getsetinherited |
Ignition state of the thruster. If on means the throttle can be applied (if no faults are present).
◆ NormalizedThrottle
|
getsetinherited |
Get the current throttle value as a value between 0-1 (based on the min/max/current throttle).
◆ Normalized100Throttle
|
getsetinherited |
Get the current throttle value as a value between 0-100 (based on min/max/current throttle).
◆ Throttle
|
getsetinherited |
The current raw value of the throttle. It is always clamped between min/max.
◆ acceleratedThisFrame
|
getinherited |
Flag used to keep track if any controller accelerated (at least once) during the current frame.
Member Function Documentation
◆ TurnOn()
|
virtualinherited |
Turn on the thruster (set the ignition on).
Referenced by BArtisan.Thrusters.Helpers.Controllers.BThrusterKeyController.Accelerate().
◆ TurnOff()
|
virtualinherited |
Turn off the thruster (set the ignition off).
Referenced by BArtisan.Thrusters.Helpers.Controllers.BThrusterKeyController.Accelerate().
◆ 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()
|
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()
|
virtualinherited |
The ignition is on, thruster is powered. It does NOT guarantee the thruster is working, see faults.
- Returns
◆ IsTurnedOff()
|
virtualinherited |
The ignition is off, thruster is not powered on.
- Returns
◆ HasFaults()
|
virtualinherited |
Checks if the thruster has any problems/faults.
- Returns
- true if the thruster is temporarily broken.
◆ IsFreeOfFaults()
|
virtualinherited |
Checks if the engine is free of problems/faults.
- Returns
◆ AddFault()
|
virtualinherited |
Add a new problem to this engine. It disables the engine until all the problems are removed.
- Parameters
-
faultUniqueID Each problem must have an unique string id.
Referenced by BArtisan.Thrusters.Helpers.Faults.BThrusterHelperFault.AddFault().
◆ RemoveFault()
|
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
-
faultUniqueID Each problem must have an unique string id.
Referenced by BArtisan.Thrusters.Helpers.Faults.BThrusterHelperFault.RemoveFault().
◆ RemoveAllFaults()
|
virtualinherited |
Remove all current faults, restoring the thruster to its original state.
◆ GetFaults()
|
virtualinherited |
Get a list of all current fault ID's.
- Returns
- fault list clone with ID's.
◆ 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()
|
virtualinherited |
Add (positive value) or substract (negative value) the throttle value. The new value is always clamped between min and max throttle values.
- Parameters
-
addValue Positive to increase, negative to decrease the throttle.
◆ 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()
|
virtualinherited |
Set a new value of the throttle. The new value is always clamped between min and max throttle values.
- Parameters
-
newValue
◆ SetThrottleNormalizedValue()
|
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
-
newNormalized 0 will set the throttle to the minimum value, 0.5f at half and 1f at maximum.
◆ SetThrottle100Value()
|
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
-
newNormalized 0 to set the minimum value, 50 to half and 100 to maximum.
◆ 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()
|
virtualinherited |
Set the throttle to it's maximum value (see MaxThrottle). Full speed ahead!
Referenced by BArtisan.Thrusters.Helpers.Controllers.BThrusterKeyController.Accelerate(), and BArtisan.Thrusters.Helpers.Controllers.BThrusterContinuousController.RestartCoroutine().
◆ GetThrottle()
|
virtualinherited |
Get the throttle raw value (absolute).
- Returns
◆ IsAtMinimumThrottle()
|
virtualinherited |
Easy check if the throttle value is equal to MinThrottle.
- Returns
- boolean
◆ IsAtMaximumThrottle()
|
virtualinherited |
Easy check if the throttle value is equal to MaxThrottle.
- Returns
- boolean