My Project
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties
Static Public Member Functions | List of all members
UniExtensions.TransformExtensionMethods Class Reference

Static Public Member Functions

static GameObject AddChild (this Transform tx, string name, params System.Type[] types)
 Resets local position and rotation to identity (zero) More...
 
static void Zero (this Transform tx)
 Resets local position and rotation to identity (zero) More...
 
static Vector3[] Positions (this IList< Transform > transforms)
 Returns the .position attributes from a list of transforms. More...
 
static Quaternion[] Rotations (this IList< Transform > transforms)
 Returns the .rotation attributes from a list of transforms. More...
 
static void MoveTo (this Transform tx, Vector3 position, float T, Space space)
 Smoothly move to a position over T seconds using world or local position. More...
 
static void MoveTo (this Transform tx, Vector3 position, float T)
 Smoothly move to a position over T seconds. More...
 
static void MoveTo (this Transform tx, Vector3 position, float T, System.Action OnFinish)
 Moves to a position of T seconds, then run an action. More...
 
static void MoveTo (this Transform tx, Vector3 position, float T, Space space, System.Action OnFinish)
 Moves to a position of T seconds, then run an action. More...
 
static void RotateTo (this Transform tx, Vector3 direction, float T)
 Smoothly rotate to face direction over T seconds. More...
 
static void RotateTo (this Transform tx, Vector3 direction, float T, System.Action OnFinish)
 Rotates to a direction over T seconds, then run an action. More...
 
static void RotateTo (this Transform tx, Vector3 direction, float T, Space space)
 Smoothly rotate to face direction over T seconds. More...
 
static void RotateTo (this Transform tx, Vector3 direction, float T, Space space, System.Action OnFinish)
 Rotates to a direction over T seconds, then run an action. More...
 
static void PivotTo (this Transform tx, float degrees, float T)
 Pivot on vertical axis to face a direction in degrees. More...
 
static void LookAt (this Transform tx, Vector3 position, float T)
 Smoothly rotate to look at a position over T seconds. More...
 
static void LookAt (this Transform tx, Transform target, float T)
 Smooth rotate to look at a target over T seconds. More...
 
static void PivotTo (this Transform tx, float degrees, float T, System.Action OnFinish)
 Pivots to a direction over T seconds, then run an action. More...
 
static void LookAt (this Transform tx, Vector3 position, float T, System.Action OnFinish)
 Looks at a direction over T seconds, then run an action. More...
 
static void LookAt (this Transform tx, Transform target, float T, System.Action OnFinish)
 Looks at a transform over T seconds, then run an action. More...
 
static Rect ScreenRect (this Transform tx, float width, float height)
 Returns a screen rect that is centred over this transform. More...
 
static Transform FindClosest (this Transform tx, IList< Transform > list)
 Returns the closest transform from a list of transforms. More...
 
static Transform FindFurthest (this Transform tx, IList< Transform > list)
 Returnts the furthest transform from a list of transforms. More...
 
static void MoveAlong (this Transform tx, IList< Vector3 > path, float T)
 Smoothly move along a path over T seconds. More...
 
static void MoveAlong (this Transform tx, IList< Vector3 > path, float T, Transform lookAt)
 Smoothly move along a path over T seconds, looking at a transform. More...
 
static void MoveAlong (this Transform tx, IList< Vector3 > path, float T, bool lookAlongPath)
 Smoothly move along a path over T seconds, optionaly looking forward along the path. More...
 
static void MoveAlong (this Transform tx, IList< Vector3 > path, float T, System.Action OnFinish)
 Smoothly move along a path over T seconds, then run an action. More...
 
static void MoveAlong (this Transform tx, IList< Vector3 > path, float T, Transform lookAt, System.Action OnFinish)
 Smoothly move along a path over T seconds, then run an action. More...
 
static void MoveAlong (this Transform tx, IList< Vector3 > path, float T, bool lookAlongPath, System.Action OnFinish)
 Smoothly move along a path over T seconds, then run an action. More...
 
static void Shake (this Transform tx, float amount, float T)
 Shake by amount units over T seconds. More...
 
static void Shiver (this Transform tx, float amount, float T)
 Shiver an object by amount degrees over T seconds. More...
 
static void PlaceOnPath (this Transform tx, IList< Transform > path, float P)
 Places the transform P (0-1) along path. More...
 
static void PlaceOnPath (this Transform tx, IList< Vector3 > path, float P)
 Place this transform P (0-1) along path. More...
 
static bool HasLineOfSightTo (this Transform tx, Transform other)
 Determines whether this instance has line of sight to another transform. More...
 
static float DistanceTo (this Transform tx, Vector3 position)
 Distances to point. More...
 
static Vector3 DirectionTo (this Transform tx, Vector3 position)
 Direction to point. More...
 
static bool IsNear (this Transform tx, Vector3 position, float threshold)
 Determines whether this instance is near the specified tx position + threshold. More...
 
static Transform[] Children (this Transform tx)
 Returns children of the transform. More...
 

Member Function Documentation

static GameObject UniExtensions.TransformExtensionMethods.AddChild ( this Transform  tx,
string  name,
params System.Type[]  types 
)
inlinestatic

Resets local position and rotation to identity (zero)

static Transform [] UniExtensions.TransformExtensionMethods.Children ( this Transform  tx)
inlinestatic

Returns children of the transform.

Parameters
txTx.
static Vector3 UniExtensions.TransformExtensionMethods.DirectionTo ( this Transform  tx,
Vector3  position 
)
inlinestatic

Direction to point.

Returns
The to.
Parameters
txTx.
positionPosition.
static float UniExtensions.TransformExtensionMethods.DistanceTo ( this Transform  tx,
Vector3  position 
)
inlinestatic

Distances to point.

Returns
The to.
Parameters
txTx.
positionPosition.
static Transform UniExtensions.TransformExtensionMethods.FindClosest ( this Transform  tx,
IList< Transform >  list 
)
inlinestatic

Returns the closest transform from a list of transforms.

Parameters
txA Transform
listA IList(Transform) The list of transforms to search through.
Returns
A Transform
static Transform UniExtensions.TransformExtensionMethods.FindFurthest ( this Transform  tx,
IList< Transform >  list 
)
inlinestatic

Returnts the furthest transform from a list of transforms.

Parameters
txA Transform
listA IList(Transform) The list of transforms to search through.
Returns
A Transform
static bool UniExtensions.TransformExtensionMethods.HasLineOfSightTo ( this Transform  tx,
Transform  other 
)
inlinestatic

Determines whether this instance has line of sight to another transform.

Returns
true if this instance has line of sight to the specified other; otherwise, false.
Parameters
txIf set to true tx.
otherIf set to true other.
static bool UniExtensions.TransformExtensionMethods.IsNear ( this Transform  tx,
Vector3  position,
float  threshold 
)
inlinestatic

Determines whether this instance is near the specified tx position + threshold.

Returns
true if this instance is near the specified position + threshold; otherwise, false.
Parameters
txIf set to true tx.
positionIf set to true position.
thresholdIf set to true threshold.
static void UniExtensions.TransformExtensionMethods.LookAt ( this Transform  tx,
Vector3  position,
float  T 
)
inlinestatic

Smoothly rotate to look at a position over T seconds.

Parameters
txA Transform
positionA Vector3 The target world space position to look at.
TA System.Single The time taken to rotate to look at the target.
static void UniExtensions.TransformExtensionMethods.LookAt ( this Transform  tx,
Transform  target,
float  T 
)
inlinestatic

Smooth rotate to look at a target over T seconds.

Parameters
txA Transform
targetA Transform The transform to look at.
TA System.Single The time taken to rotate to look at the target.
static void UniExtensions.TransformExtensionMethods.LookAt ( this Transform  tx,
Vector3  position,
float  T,
System.Action  OnFinish 
)
inlinestatic

Looks at a direction over T seconds, then run an action.

static void UniExtensions.TransformExtensionMethods.LookAt ( this Transform  tx,
Transform  target,
float  T,
System.Action  OnFinish 
)
inlinestatic

Looks at a transform over T seconds, then run an action.

static void UniExtensions.TransformExtensionMethods.MoveAlong ( this Transform  tx,
IList< Vector3 >  path,
float  T 
)
inlinestatic

Smoothly move along a path over T seconds.

Parameters
txA Transform
pathA IList(Transform) The list of transforms which make up the the path.
TThe time taken to move from start to finish. A System.Single
static void UniExtensions.TransformExtensionMethods.MoveAlong ( this Transform  tx,
IList< Vector3 >  path,
float  T,
Transform  lookAt 
)
inlinestatic

Smoothly move along a path over T seconds, looking at a transform.

Parameters
txA Transform
pathA IList(Transform) The list of transforms which make up the path.
TA System.Single The time taken to move from start to finish.
lookAtA Transform The transform to look at while moving.
static void UniExtensions.TransformExtensionMethods.MoveAlong ( this Transform  tx,
IList< Vector3 >  path,
float  T,
bool  lookAlongPath 
)
inlinestatic

Smoothly move along a path over T seconds, optionaly looking forward along the path.

Parameters
txA Transform
pathA IList(Transform) The list of transforms which make up the path.
TA System.Single The time taken to move from start to finish.
lookAlongPathA System.Boolean If true, always look in the direction of travel.
static void UniExtensions.TransformExtensionMethods.MoveAlong ( this Transform  tx,
IList< Vector3 >  path,
float  T,
System.Action  OnFinish 
)
inlinestatic

Smoothly move along a path over T seconds, then run an action.

static void UniExtensions.TransformExtensionMethods.MoveAlong ( this Transform  tx,
IList< Vector3 >  path,
float  T,
Transform  lookAt,
System.Action  OnFinish 
)
inlinestatic

Smoothly move along a path over T seconds, then run an action.

static void UniExtensions.TransformExtensionMethods.MoveAlong ( this Transform  tx,
IList< Vector3 >  path,
float  T,
bool  lookAlongPath,
System.Action  OnFinish 
)
inlinestatic

Smoothly move along a path over T seconds, then run an action.

static void UniExtensions.TransformExtensionMethods.MoveTo ( this Transform  tx,
Vector3  position,
float  T,
Space  space 
)
inlinestatic

Smoothly move to a position over T seconds using world or local position.

Parameters
txA Transform
positionA Vector3 The target position.
TA System.Single The time taken to move to the target.
spaceSpace to operate in, world or local.
static void UniExtensions.TransformExtensionMethods.MoveTo ( this Transform  tx,
Vector3  position,
float  T 
)
inlinestatic

Smoothly move to a position over T seconds.

Parameters
txA Transform
positionA Vector3 The target position.
TA System.Single The time taken to move to the target.
static void UniExtensions.TransformExtensionMethods.MoveTo ( this Transform  tx,
Vector3  position,
float  T,
System.Action  OnFinish 
)
inlinestatic

Moves to a position of T seconds, then run an action.

Parameters
txTx.
positionPosition.
TT.
OnFinishOn finish.
static void UniExtensions.TransformExtensionMethods.MoveTo ( this Transform  tx,
Vector3  position,
float  T,
Space  space,
System.Action  OnFinish 
)
inlinestatic

Moves to a position of T seconds, then run an action.

Parameters
txTx.
positionPosition.
TT.
OnFinishOn finish.
spaceSpace to operate in, world or local.
static void UniExtensions.TransformExtensionMethods.PivotTo ( this Transform  tx,
float  degrees,
float  T 
)
inlinestatic

Pivot on vertical axis to face a direction in degrees.

Parameters
txA Transform
degreesA System.Single The target degrees of the vertical axis.
TThe time taken to move to the target. A System.Single
static void UniExtensions.TransformExtensionMethods.PivotTo ( this Transform  tx,
float  degrees,
float  T,
System.Action  OnFinish 
)
inlinestatic

Pivots to a direction over T seconds, then run an action.

static void UniExtensions.TransformExtensionMethods.PlaceOnPath ( this Transform  tx,
IList< Transform >  path,
float  P 
)
inlinestatic

Places the transform P (0-1) along path.

Parameters
txTx.
pathPath.
PP.
static void UniExtensions.TransformExtensionMethods.PlaceOnPath ( this Transform  tx,
IList< Vector3 >  path,
float  P 
)
inlinestatic

Place this transform P (0-1) along path.

Parameters
txA Transform
pathA IList(Vector3) The list of transforms that make up the path.
PA System.Single The percentage value (0-1) along the path.
static Vector3 [] UniExtensions.TransformExtensionMethods.Positions ( this IList< Transform >  transforms)
inlinestatic

Returns the .position attributes from a list of transforms.

Parameters
transformsTransforms.
static void UniExtensions.TransformExtensionMethods.RotateTo ( this Transform  tx,
Vector3  direction,
float  T 
)
inlinestatic

Smoothly rotate to face direction over T seconds.

Parameters
txA Transform
directionA Vector3 The target forward direction.
TA System.Single The time taken to rotate to the target direction.
static void UniExtensions.TransformExtensionMethods.RotateTo ( this Transform  tx,
Vector3  direction,
float  T,
System.Action  OnFinish 
)
inlinestatic

Rotates to a direction over T seconds, then run an action.

Parameters
txTx.
directionDirection.
TT.
OnFinishOn finish.
static void UniExtensions.TransformExtensionMethods.RotateTo ( this Transform  tx,
Vector3  direction,
float  T,
Space  space 
)
inlinestatic

Smoothly rotate to face direction over T seconds.

Parameters
txA Transform
directionA Vector3 The target forward direction.
TA System.Single The time taken to rotate to the target direction.
spaceSpace to operate in, world or local.
static void UniExtensions.TransformExtensionMethods.RotateTo ( this Transform  tx,
Vector3  direction,
float  T,
Space  space,
System.Action  OnFinish 
)
inlinestatic

Rotates to a direction over T seconds, then run an action.

Parameters
txTx.
directionDirection.
TT.
OnFinishOn finish.
spaceSpace to operate in, world or local.
static Quaternion [] UniExtensions.TransformExtensionMethods.Rotations ( this IList< Transform >  transforms)
inlinestatic

Returns the .rotation attributes from a list of transforms.

Parameters
transformsTransforms.
static Rect UniExtensions.TransformExtensionMethods.ScreenRect ( this Transform  tx,
float  width,
float  height 
)
inlinestatic

Returns a screen rect that is centred over this transform.

Parameters
txA Transform
widthA System.Single The width of the rectangle.
heightA System.Single The height of the rectangle.
Returns
A Rect
static void UniExtensions.TransformExtensionMethods.Shake ( this Transform  tx,
float  amount,
float  T 
)
inlinestatic

Shake by amount units over T seconds.

Parameters
txA Transform
amountA System.Single Maximum amount of shake, in world space.
TShake for this amount of seconds. A System.Single
static void UniExtensions.TransformExtensionMethods.Shiver ( this Transform  tx,
float  amount,
float  T 
)
inlinestatic

Shiver an object by amount degrees over T seconds.

Parameters
txA Transform
amountA System.Single Maximum amount of shiver, in degrees.
TA System.Single Shiver for this amount of seconds.
static void UniExtensions.TransformExtensionMethods.Zero ( this Transform  tx)
inlinestatic

Resets local position and rotation to identity (zero)


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