public partial class : MonoBehaviour
Forward and Backward Reaching Inverse Kinematics.
This class is marked 'partial' and can have its functionality extended.
Alternatively, this class can have its functionality extended.
[SerializeField] protected bool
bShowJoints
Should FABRIKLeg connections shown?
[SerializeField] protected float
JointGizmosRadius
How large should FABRIKLeg Joints be displayed?
[SerializeField] protected bool
bShowBiasPoint
Should the FABRIK bias points be shown?
BiasGizmosRadius
How large should the Bias Point be displayed?
[SerializeField] protected bool
bShowRays
Should the Rays that determine the FABRIK Target be shown?
[SerializeField] protected int
MaximumPasses
The maximum number of times FABRIK should run.
Higher increases accuracy, but is slower to compute.
[SerializeField] protected float
Tolerance
How close should the FABRIK Leg be to be considered reached?
This controls the accuracy for all Legs.
[SerializeField] protected float
MinLegUpHeight
The minimum height for the upward motion of the FABRIKLeg.
This functionality was purpose built for procedural Crawling Animations.
[SerializeField] protected float
MaxLegUpHeight
The maximum height for the upward motion of the FABRIKLeg.
This functionality was purpose built for procedural Crawling Animations.
[SerializeField] protected float
LegUpSpeed
How fast should the FABRIKLeg go upwards?
This functionality was purpose built for procedural Crawling Animations.
public List<FABRIKLeg>
Legs
The FABRIKLegs affected and controlled by FABRIK.
[SerializeField] protected float
SpringArmThreshold
The maximum SpringArm.Distance before FABRIK turns off.
[SerializeField] protected float
CameraDistanceThreshold
The maximum distance the Camera can be before FABRIK turns off.
Assumes that the MSpringArm objet is a Camera.
Will not work otherwise!
[SerializeField] protected bool
bLimitWithFramerate
Should FABRIK automatically turn off when the Frame Rate is too low?
[SerializeField] protected int
FrameCutoff
The minimum amount of Frames per Second FABRIK needs to run.
[SerializeField] protected bool
bAlwaysRunRegardless
Should FABRIK ignore optimisations?
protected virtual void
Summary:
Initialises MainSpringArmComponent.
Remarks:
Assumes that Camera.main has a SpringArm attached to it.
protected virtual void
Summary:
Runs FABRIK logic every frame, accounting for optimisations.
protected bool
Summary:
Checks whether this transform has rotated since the last frame.
Returns:
True if this transform has rotated by at least .1 on any axis since the last frame.
protected bool
Summary:
Checks whether this transform has rotated since the last frame.
Returns:
True if this transform has moved kEpsilon since the last frame.
protected virtual void
Summary:
Calculates how high Limbs, Knees or Toes should go.
Params:
Height:
The maximum height Limbs, Knee or Toes can go.
ClampedSine:
[Default] Height from Sine function.
ClampedCosine:
[Default] Height from Cosine function.
protected virtual void
Summary:
Assigns the height of the maximum height of the legs randomly.
Remarks:
This functionality was purpose built for procedural Crawling Animations.
It controls the random heights in GetCrawlingHeights() to mimic crawling legs.
protected void
Summary:
Computes FABRIK logic according to predefined settings and assigns Legs to their FABRIK-solved positions and rotations.
Params:
bSnapToTarget:
Should the FABRIK solver snap to the final position?
protected void
Summary:
The implementation of the FABRIK Solver.
Params:
Joints:
The Joints to consider when adjusting positions and rotations.
Root:
The position of the Joint that is directly conneected to the rest of the body.
Target:
The positions of Joints that FABRIK should solve towards.
RelativeBias:
THe Joints' Bias point. (Vector3.zero for no bias)
protected virtual void
Summary:
Calculates how rays should be shot to determine FABRIK Targets.
Params:
Leg:
The relative position to calculate the Origin of the Ray.
Origin:
The Origin of the ray to determine the FABRIK Target.
Direction:
The Direction the ray will travel to determine the FABRIK Target.
protected Vector3
Summary:
Gets the relative position of V whilst considering rotations.
Params:
V:
The vector to convert to local space.
Returns:
The coordinates of V, relative to this transform.
protected Vector3
Summary:
Gets the relative position of X, Y, and Z whilst considering rotations.
Params:
X:
The X-Axis value to convert to local space.
Y:
The Y-Axis value to convert to local space.
Z:
The Z-Axis value to convert to local space.
Returns:
The coordinates of X, Y, and Z, relative to this transform.
protected virtual void
Summary:
Determines how far is too far for the Camera.
Returns:
True if the distance between this and the Camera exceeds CameraDistanceThreshold.
[Serializable] public struct
Relevant information referencing how and what will be affected by FABRIK.
public Vector3
TargetRayOrigin
The position FABRIK should begin to searching for a FABRIK Target.
public List<Transform>
Limbs
Straight and unbendable transforms affected by FABRIK.
public List<Transform>
KneeOrToe
The Joints/positions between the Limbs for FABRIK Target angle corrections.
public float
Height
The random Height assigned by AssignLegHeights().
public Vector3
Bias
The positoin where Limbs, Knees, Toes should aim towards while adjusting to FABRIK.
public Vector3[]
Summary:
Gets the positions of all the Joints.
Returns:
The positions of all the Joints.
public struct
Inter-frame information recording utility.
public void
Summary:
Records an Interval.
Remarks:
Call before Mark.
Params:
Player:
The Player to record.
public void
Summary:
Marks the end of an Interval.
Params:
Player:
The Player to get interval information.
public void
Summary:
Marks the end of an interval.
Params:
Player:
The Player to get interval information.
LastInterval:
Outs the last interval information.
ThisInterval:
Outs the current interval information.
public LastIntervalInformation
Summary:
Get the information at the last recorded interval.
Returns:
The Last Interval Information from the last recorded interval.
public struct
Information about this Player on the previous record.
public MVector
Position
The Position of this Player on the previous record.
public MRotator
Rotation
The Rotation of this Player on the previous record.
public struct
Information about this Player on the current record.
public MVector
Position
The Position of this Player on the current record.
public MRotator
Rotation
The Position of this Player on the current record.
public MVector
Summary:
The difference in positions of This and Last.
Params:
Last:
The Last position.
Returns:
This.Position - Last.Position.
public MRotator
Summary:
The difference in rotations of This and Last.
Params:
Last:
The Last rotation.
Returns:
This.Rotation - Last.Rotation.
public float
Summary:
The time between the Last Interval and This Interval.
Params:
Last:
The Last recorded time.
Returns:
This.Time - Last.Time.
public void
Summary:
Get Deltas in all respects.
Params:
Last:
The Last recorded interval.
public class : MonoBehaviour
public MVector
Position
The world position of this player.
public MRotator
Rotation
The rotation of this player.
public MArray<Collider>
Summary:
Sets this transform's position to NewPosition or the first SweepInteraction if bDoSweep and bTeleportToPosition are true.
Params:
NewPosition:
The target destination to go to, or go towards in a straight-line.
bTeleportToPosition:
True to immediately teleport to the location, regardless of Sweep Interactions.
bDoSweep:
True to teleport to the first Sweeped interaction, rather than NewPosition, if this transform intercepted another GameObject within the referenced SweepInteraction's Radius.
Interactions:
Data containing how this transform interacts with other objects during Sweep.
Returns:
An MArray
public MArray<Collider2D>
Summary:
Sets this transform's position to NewPosition or the first SweepInteraction if bDoSweep and bTeleportToPosition are true.
Params:
NewPosition:
The target destination to go to, or go towards in a straight-line.
bTeleportToPosition:
True to immediately teleport to the location, regardless of Sweep Interactions.
bDoSweep:
True to teleport to the first Sweeped interaction, rather than NewPosition, if this transform intercepted another GameObject within the referenced SweepInteraction's Radius.
Interactions:
Data containing how this transform interacts with other objects during Sweep.
Returns:
An MArray
[RequireComponent<Rigidbody>] public class : PlayerBase
The base class of a Player in a three-dimensional world.
public override void
Summary:
The default implementation for movement input.
Params:
ForwardThrow:
Forward input. Default is Z axis.
RightThrow:
Right input. Default is X axis.
public virtual void
Summary:
Adds force upwards to this player. Default direction is MVector.Up.
Remarks:
Uses Rigidbody.AddForce(Vector3) to enforce jumping, by default.
Params:
Force:
The amount of force to apply.
public float
Summary:
The velocity of this Player, respective to attached Rigidbody.
Returns:
The speed in Unity-units per second.
public void
Summary:
Gets the speed and direction of this Player.
Params:
Speed:
Out float speed in Unity-units per second.
Direction:
Out MVector normalised direction this player is moving. Relative to the attached Rigidbody.
[RequireComponent<Rigidbody2D>, <SpriteRenderer>] public class : PlayerBase
The base class of a Player in a two-dimensional world. Extends PlayerBase.
[SerializeField] bool
bFlipSpriteOnInput
True to flip this Sprite Renderer over X when moving horizontally.
[SerializeField] bool
bSpriteIsFacingNegativeX
True if this sprite is defaulted to facing -X.
public override void
Summary:
Must call base.FixedUpdate().
Remarks:
Must call base.FixedUpdate().
public override void
Summary:
The default implementation for movement input.
Params:
UpwardThrow:
Upward input. Default is Y axis.
ForwardThrow:
Forward input. Default is X axis.
public void
Summary:
Flips SpriteRenderer according to a float.
Remarks:
bFlipOnSpriteInput needs to be true to execute.
Params:
FlipIndependentInput:
The input throw to determine a flip of the Sprite Renderer.
public SpriteRenderer
Summary:
This Player's SpriteRenderer.
Returns:
The SpriteRenderer attached to this Player.
public Rigidbody2D
Summary:
This Player's Rigidbody2D.
Returns:
The Rigidbody2D attached to this Player.
public static RaycastHit2D?
Summary:
Performs a raycast under the mouse.
Remarks:
ReferenceCamera must be orthographic, otherwise null is returned.
Params:
ReferenceCamera:
The Camera to shoot a ray from, screen-wise.
Distance:
The maximum distance of the ray to shoot.
LayerMask:
The layers this raycast will intercept.
Returns:
RaycastHit2D information about the raycast. Null if ReferenceCamera is not orthographic.
public class <T> where T : MonoBehaviour
Base class for any unique MonoBehaviour in a game.
public static T
Instance
A unique reference to T.
[SerializeField] bool
bMakePersistent
Sets this gameObject to DontDestroyOnLoad.
[SerializeField] bool
bSpawnNewOnDestroy
True to spawn a new unique instance when this is destroyed.
public virtual void
Summary:
Automatically sets the instance to this.
protected virtual void
Summary:
Sets the unique instance.
Params:
UniqueInstance:
The component to mark as the unique instance.
protected virtual void
Summary:
Will spawn a new GameObject if bSpawnNewOnDestroy is true.
public class : MonoBehaviour
The base class for MPlayer and MPlayer2D.
public Action<float, float>
OnTakeDamage
Called when damage is taken. First float is new Health, second is the inflicting damage.
public float
MovementSpeed
The movement speed of this Player.
public void
Summary:
Initialises this player's settings.
public void
Summary:
Sets MovementSpeed to NewMovementSpeed.
Remarks:
Also updates the default, InitialMovementSpeed. TemporaryMovementSpeed will revert to NewMovementSpeed.
Params:
NewMovementSpeed:
The new Movement Speed of this player.
public IEnumerator
Summary:
Temporarily modifies this player's MovementSpeed.
Remarks:
Calling StopCoroutine on the returned IEnumerator will not reset the player's MovementSpeed.
Params:
TemporaryMovementSpeed:
The temporary MovementSpeed.
Duration:
The time in seconds in which TemporaryMovementSpeed will be in effect.
Returns:
The IEnumerator that handles timing.
public void
Summary:
Set this player's MovementSpeed to InitialMovementSpeed.
public virtual void
Summary:
Registers movement from input.
Remarks:
Needs to be overridden from
Params:
ForwardThrow:
Horizontal input.
RightThrow:
Vertical input.
public void
Summary:
Set this Player's ability to receive MovementInput(float, float).
Params:
bStopReceivingInput:
True if this Player should stop receiving input.
public bool
Summary:
Whether or not this Player is allowed to receive MovementInput(float, float).
Returns:
True if this Player is not allowed to receive MovementInput(float, float).
public void
Summary:
Records this Player on this frame.
public MVector
Summary:
Gets the velocity of the Player, relative to the previous interval.
Returns:
The velocity of this Player, relative to the previous interval.
public float
Summary:
The rate of acceleration of this Player between FixedUpdate intervals.
Returns:
The rate of acceleration in metres per second, as per Time.fixedDeltaTime.
public MVector
Summary:
The G Force experienced by this Player between FixedUpdate intervals.
Params:
Gravity:
The force of gravity this Player experiences at a standstill.
Returns:
The G Force experience by this Player as an MVector.
public float
Summary:
The G Force experienced by this Player between FixedUpdate intervals.
Params:
Gravity:
The force of gravity this Player experiences at a standstill.
Returns:
The G Force experienced by this player.
public float
Summary:
Get this Player's Health.
Returns:
Current health.
public bool
Summary:
Deduct InDamage from this Player's Health.
Params:
InDamage:
The damage to inflict on this Player.
Returns:
True if this Player IsDead.
public bool
Summary:
Deduct InDamage from this Player's Health.
Params:
InDamage:
The damage to inflict on this Player.
HealthPercentageRemaining:
The percentage of health remaining after taking InDamage.
Returns:
True if this Player IsDead.
public bool
Summary:
If this Player's is considered dead.
Returns:
True if GetHealth <= 0.
public virtual void
Summary:
What should happen when this Player is removed from the game?
[Serializable] public class
A class defining how MBehaviours do Sweeps.
public const SweepInteraction
kNoInteraction
Constant null reference to mark No Interaction.
public static readonly SweepInteraction
Default
Default Sweep Interaction parameters.
public float
InteractingRadius
The radius of this Sweep's check for interactions.
public LayerMask
InteractingLayers
The layers this Sweep will consider for interactions.
public UnityEvent<GameObject>
Broadcast
What happens when the Sweep makes an interaction?
Summary:
Default Sweep Interaction parameters.
Summary:
Initialise Sweep Interaction parameters with a Radius only.
Params:
InteractingRadius:
The radius of this Sweep's check for interactions.
Summary:
Initialise Sweep Interaction parameters with a Radius and the interaction layer/s.
Params:
InteractingRadius:
The radius of this Sweep's check for interactions.
InteractingLayers:
The layers this Sweep will consider for interactions.
Summary:
Fully initialise a Sweep Interaction.
Params:
InteractingRadius:
The radius of this Sweep's check for interactions.
InteractingLayers:
The layers this Sweep will consider for interactions.
OnObjectsInteraction:
What happens when the Sweep makes an interaction?
public class <T> : MonoBehaviour
Generates a separate Tick function.
Summary:
Creates a new separate update loop.
Params:
Equation:
The Equation to use to Tick.
DurationInSeconds:
The duration of this update loop in seconds.
OnTick:
The method to call every tick. The executed T and interpolated Time is passed as a parameter.
StartInterpolation:
Where to begin interpolation.
EndInterpolation:
Where to end interpolation.
public void
Summary:
Sets the data for the next execution of OnTick.
Remarks:
All entries in Data will be executed linearly.
Params:
Data:
The data to set for the next OnTick.
public void
Summary:
Pauses this Tick from executing until this (TogglePauseTick) is called again.
Remarks:
This is a toggle.
public void
Summary:
Stop executing this Tick.
public TickInformation
Summary:
Information about the time and percentage complete on this Tick function.
Returns:
Information about the time and percentage complete on this Tick function.
public class : MUnique<VisualDebugger>
A custom utility class that assists in debugging game data.
public bool
bDisableGUI
True to disable GUI draws to the game screen.
public bool
bDisableLogs
True to disable VDebug Logs to the console.
[SerializeField] [Min(0)] float
GUIUpdateInterval
How often should GUI be updated in seconds?
0 is evert frame.
public void
Summary:
Log.Auto() Content with Verbosity in HexColour.
Params:
Content:
The string to log to the console.
HexColour:
The Colour to display Content in the console.
Verbosity:
The level of the log.
public void
Summary:
Draws a line to the editor screen.
Params:
Params:
Draw Parameters.
public void
Summary:
Draws text onto the game screen with OnGUI().
Params:
Content:
The string to display to the game screen.
Width:
The width of the Rect that will be drawn onto the screen.
Height:
The height of the Rect that will be drawn onto the screen.
public void
Summary:
Draws text onto the game screen with OnGUI().
Params:
Content:
The string to display to the game screen.
Colour:
The colour of Content.
Width:
The width of the Rect that will be drawn onto the screen.
Height:
The height of the Rect that will be drawn onto the screen.
public struct
Parameters controlling how lines are drawn to the screen.
public MVector
From
Where the line will originate.
public MVector
To
Where the line will terminate.
public Color
Colour
The colour of the line.
public float
Duration
How long the line will remain on screen in seconds.
Summary:
Define only From and To. Default Colour is white and Duration is a single frame.
Summary:
Define From, To and Colour. Default Duration is a single frame.
Summary:
Fully construct Draw Parameters.