UnityEssentials
Small but useful tools and features for Unity
|
Extensions for the Transform component More...
Static Public Member Functions | |
static void | ResetTransform (this Transform self) |
Sets the transform position, rotation and scale to the default values. Position = (0,0,0), Rotation = Quaternion.identity, Scale = (1,1,1). More... | |
static void | SetProperties (this Transform self, Transform properties) |
Sets the transform position, rotation and scale to the same values in the given transform. More... | |
static void | SetProperties (this Transform self, Vector3 position, Quaternion rotation, Vector3 scale) |
Sets the transform position, rotation and scale to the given values. More... | |
static void | SetProperties (this Transform self, Quaternion rotation, Vector3 scale) |
Sets the transform rotation and scale to the given values. More... | |
static void | SetProperties (this Transform self, Vector3 position, Vector3 scale) |
Sets the transform position and scale to the given values. More... | |
static void | SetProperties (this Transform self, Vector3 position, Quaternion rotation) |
Sets the transform position and rotation to the given values. More... | |
static Quaternion | GetLookAtRotation (this Transform self, Vector3 target) |
Find the rotation to look at a target. More... | |
static Quaternion | GetLookAtRotation (this Transform self, Transform target) |
Find the rotation to look at a target. More... | |
static void | LookAway (this Transform self, Vector3 target) |
Instantly look in the opposite direction of the target. More... | |
static void | LookAway (this Transform self, Transform target) |
Instantly look in the opposite direction of the target. More... | |
static Quaternion | GetLookAwayRotation (this Transform self, Vector3 target) |
Find the rotation to look in the opposite direction of the target. More... | |
static Quaternion | GetLookAwayRotation (this Transform self, Transform target) |
Find the rotation to look away from a target transform. More... | |
static void | SetLerp (this Transform self, Transform a, Transform b, float t) |
Linearly interpolates between two transforms. More... | |
static void | DestroyImmediateAllChildren (this Transform self, IEnumerable< Transform > exceptions=null) |
Destroys immediately the children of a transform. More... | |
static void | DestroyAllChildren (this Transform self, IEnumerable< Transform > exceptions=null) |
Destroys the children of a transform. More... | |
Extensions for the Transform component
Definition at line 9 of file TransformExtensions.cs.
|
static |
Destroys the children of a transform.
exceptions | Transforms that must not be destroyed. |
Definition at line 154 of file TransformExtensions.cs.
|
static |
Destroys immediately the children of a transform.
This method is not recommended to use. Instead use 'DestroyAllChildren'."
exceptions | Transforms that must not be destroyed. |
Definition at line 140 of file TransformExtensions.cs.
|
static |
Find the rotation to look at a target.
target | The thing to look at. |
Definition at line 84 of file TransformExtensions.cs.
|
static |
Find the rotation to look at a target.
target | The thing to look at. |
Definition at line 75 of file TransformExtensions.cs.
|
static |
Find the rotation to look away from a target transform.
target | The thing to look away from. |
Definition at line 121 of file TransformExtensions.cs.
|
static |
Find the rotation to look in the opposite direction of the target.
target | The thing to look away from. |
Definition at line 111 of file TransformExtensions.cs.
|
static |
Instantly look in the opposite direction of the target.
target | The thing to look away from. |
Definition at line 101 of file TransformExtensions.cs.
|
static |
Instantly look in the opposite direction of the target.
target | The thing to look away from |
Definition at line 93 of file TransformExtensions.cs.
|
static |
Sets the transform position, rotation and scale to the default values. Position = (0,0,0), Rotation = Quaternion.identity, Scale = (1,1,1).
Definition at line 14 of file TransformExtensions.cs.
|
static |
Linearly interpolates between two transforms.
When t = 0 returns a. When t = 1 returns b. When t = 0.5 returns the point midway between a and b.
Definition at line 130 of file TransformExtensions.cs.
|
static |
Sets the transform rotation and scale to the given values.
rotation | The rotation to be set in the transform. |
scale | The scale to be set in the transform. |
Definition at line 44 of file TransformExtensions.cs.
|
static |
Sets the transform position, rotation and scale to the same values in the given transform.
properties | The transform from which the position, rotation and scale will be copied. |
Definition at line 23 of file TransformExtensions.cs.
|
static |
Sets the transform position and rotation to the given values.
position | The position to be set in the transform. |
rotation | The rotation to be set in the transform. |
Definition at line 64 of file TransformExtensions.cs.
|
static |
Sets the transform position, rotation and scale to the given values.
position | The position to be set in the transform. |
rotation | The rotation to be set in the transform. |
scale | The scale to be set in the transform. |
Definition at line 33 of file TransformExtensions.cs.
|
static |
Sets the transform position and scale to the given values.
position | The position to be set in the transform. |
scale | The scale to be set in the transform. |
Definition at line 54 of file TransformExtensions.cs.