![]() |
Inventory Engine v4.2
|
Add this class to a GameObject to make it rotate on itself. More...
Inherits MonoBehaviour.
Public Types | |
enum | UpdateModes { Update , LateUpdate , FixedUpdate } |
Public Member Functions | |
virtual void | Rotate (bool status) |
Sets Rotating to true or false. | |
virtual void | Orbit (bool status) |
Sets Orbiting to true or false. |
Public Attributes | |
bool | Rotating = true |
whether or not this object should be rotating right now | |
Space | RotationSpace = Space.Self |
the space to apply the rotation in | |
UpdateModes | UpdateMode = UpdateModes.Update |
whether movement should happen at Update, FixedUpdate or LateUpdate | |
Vector3 | RotationSpeed = new Vector3(100f, 0f, 0f) |
The rotation speed. Positive means clockwise, negative means counter clockwise. | |
bool | RandomizeRotationSpeed = false |
Whether or not the rotation speed should be randomized. | |
Vector3 | RotationSpeedMin = new Vector3(100f, 0f, 0f) |
the minimum rotation speed to use if RandomizeRotationSpeed is true | |
Vector3 | RotationSpeedMax = new Vector3(300f, 0f, 0f) |
the maximum rotation speed to use if RandomizeRotationSpeed is true | |
Vector2 | RandomInitialDelay = Vector2.zero |
an offset, in seconds, to apply before starting the rotation, to allow for a delay | |
bool | Orbiting = false |
if this is true, the object will also move around a pivot (only the position is affected, not the rotation) | |
bool | AdditiveOrbitRotation = false |
if this is true, the orbit plane will rotate along with the parent | |
Transform | OrbitCenterTransform |
the pivot to rotate around (if left blank, will be the object itself | |
Vector3 | OrbitCenterOffset = Vector3.zero |
the pivot (relative to the object's position in local space) to rotate around | |
Vector3 | OrbitRotationAxis = new Vector3(0f, 1f, 0f) |
the axis around which the object should rotate (don't make it zero) | |
float | OrbitRotationSpeed = 10f |
the speed at which to rotate | |
float | OrbitRadius = 3f |
the radius at which to orbit | |
float | OrbitCorrectionSpeed = 10f |
the speed at which the object catches up when orbit radius or axis changes | |
bool | DrawGizmos = true |
if this is true, will draw gizmos to show the plane, orbit and direction | |
Color | OrbitPlaneColor = new Color(54f, 169f, 225f, 0.02f) |
the color of the orbit disc | |
Color | OrbitLineColor = new Color(225f, 225f, 225f, 0.1f) |
the color of the orbit line | |
Vector3 | _orbitCenter |
Vector3 | _worldRotationAxis |
Plane | _rotationPlane |
Vector3 | _snappedPosition |
Vector3 | _radius |
Protected Member Functions | |
virtual void | Start () |
On start, we initialize our plane. | |
virtual void | Update () |
Makes the object rotate on its center at Update. | |
virtual void | FixedUpdate () |
Makes the object rotate on its center at FixedUpdate. | |
virtual void | LateUpdate () |
Makes the object rotate on its center at LateUpdate. | |
virtual void | Rotate () |
Rotates the object. |
Protected Attributes | |
Quaternion | _newRotation |
Vector3 | _desiredOrbitPosition |
float | _initialDelay = 0f |
float | _startTime = 0f |
Add this class to a GameObject to make it rotate on itself.
|
protectedvirtual |
Makes the object rotate on its center at FixedUpdate.
|
protectedvirtual |
Makes the object rotate on its center at LateUpdate.
|
virtual |
Sets Orbiting to true or false.
status |
|
protectedvirtual |
Rotates the object.
|
virtual |
Sets Rotating to true or false.
status |
|
protectedvirtual |
On start, we initialize our plane.
|
protectedvirtual |
Makes the object rotate on its center at Update.
|
protected |
|
protected |
|
protected |
Vector3 MoreMountains.Tools.MMAutoRotate._orbitCenter |
Vector3 MoreMountains.Tools.MMAutoRotate._radius |
Plane MoreMountains.Tools.MMAutoRotate._rotationPlane |
Vector3 MoreMountains.Tools.MMAutoRotate._snappedPosition |
|
protected |
Vector3 MoreMountains.Tools.MMAutoRotate._worldRotationAxis |
bool MoreMountains.Tools.MMAutoRotate.AdditiveOrbitRotation = false |
if this is true, the orbit plane will rotate along with the parent
bool MoreMountains.Tools.MMAutoRotate.DrawGizmos = true |
if this is true, will draw gizmos to show the plane, orbit and direction
Vector3 MoreMountains.Tools.MMAutoRotate.OrbitCenterOffset = Vector3.zero |
the pivot (relative to the object's position in local space) to rotate around
Transform MoreMountains.Tools.MMAutoRotate.OrbitCenterTransform |
the pivot to rotate around (if left blank, will be the object itself
float MoreMountains.Tools.MMAutoRotate.OrbitCorrectionSpeed = 10f |
the speed at which the object catches up when orbit radius or axis changes
bool MoreMountains.Tools.MMAutoRotate.Orbiting = false |
if this is true, the object will also move around a pivot (only the position is affected, not the rotation)
Color MoreMountains.Tools.MMAutoRotate.OrbitLineColor = new Color(225f, 225f, 225f, 0.1f) |
the color of the orbit line
Color MoreMountains.Tools.MMAutoRotate.OrbitPlaneColor = new Color(54f, 169f, 225f, 0.02f) |
the color of the orbit disc
float MoreMountains.Tools.MMAutoRotate.OrbitRadius = 3f |
the radius at which to orbit
Vector3 MoreMountains.Tools.MMAutoRotate.OrbitRotationAxis = new Vector3(0f, 1f, 0f) |
the axis around which the object should rotate (don't make it zero)
float MoreMountains.Tools.MMAutoRotate.OrbitRotationSpeed = 10f |
the speed at which to rotate
Vector2 MoreMountains.Tools.MMAutoRotate.RandomInitialDelay = Vector2.zero |
an offset, in seconds, to apply before starting the rotation, to allow for a delay
bool MoreMountains.Tools.MMAutoRotate.RandomizeRotationSpeed = false |
Whether or not the rotation speed should be randomized.
bool MoreMountains.Tools.MMAutoRotate.Rotating = true |
whether or not this object should be rotating right now
Space MoreMountains.Tools.MMAutoRotate.RotationSpace = Space.Self |
the space to apply the rotation in
Vector3 MoreMountains.Tools.MMAutoRotate.RotationSpeed = new Vector3(100f, 0f, 0f) |
The rotation speed. Positive means clockwise, negative means counter clockwise.
Vector3 MoreMountains.Tools.MMAutoRotate.RotationSpeedMax = new Vector3(300f, 0f, 0f) |
the maximum rotation speed to use if RandomizeRotationSpeed is true
Vector3 MoreMountains.Tools.MMAutoRotate.RotationSpeedMin = new Vector3(100f, 0f, 0f) |
the minimum rotation speed to use if RandomizeRotationSpeed is true
UpdateModes MoreMountains.Tools.MMAutoRotate.UpdateMode = UpdateModes.Update |
whether movement should happen at Update, FixedUpdate or LateUpdate