![]() |
Feel 5.9.1
The best way to improve your game's feel and make it extra juicy
|
Add this class to a Rigidbody or Rigidbody2D to be able to edit its center of mass from the inspector directly. More...
Public Types | |
| enum | AutomaticSetModes { Awake , Start , ScriptOnly } |
| the possible modes this class can start on More... | |
Public Member Functions | |
| virtual void | SetCenterOfMass () |
| Sets the center of mass on the rigidbody or rigidbody2D. | |
Public Attributes | |
| Vector3 | CenterOfMassOffset |
| the offset to apply to the center of mass | |
| AutomaticSetModes | AutomaticSetMode = AutomaticSetModes.Awake |
| whether to set the center of mass on awake, start, or via script only | |
| bool | AutoDestroyComponentAfterSet = true |
| whether or not this component should auto destroy after a set | |
| float | GizmoPointSize = 0.05f |
| the size of the gizmo point to display at the center of mass | |
| bool | SetCenterOfMassButton |
| a button to test the set method | |
Protected Member Functions | |
| virtual void | Awake () |
| On Awake we grab our components and set our center of mass if needed. | |
| virtual void | Start () |
| On Start we set our center of mass if needed. | |
| virtual void | Initialization () |
| Grabs the rigidbody or rigidbody2D components. | |
| virtual void | OnDrawGizmosSelected () |
| On DrawGizmosSelected, we draw a yellow point at the position of our center of mass. | |
Protected Attributes | |
| Vector3 | _gizmoCenter |
| Rigidbody | _rigidbody |
Add this class to a Rigidbody or Rigidbody2D to be able to edit its center of mass from the inspector directly.
|
protectedvirtual |
On Awake we grab our components and set our center of mass if needed.
|
protectedvirtual |
Grabs the rigidbody or rigidbody2D components.
|
protectedvirtual |
On DrawGizmosSelected, we draw a yellow point at the position of our center of mass.
|
virtual |
Sets the center of mass on the rigidbody or rigidbody2D.
|
protectedvirtual |
On Start we set our center of mass if needed.
|
protected |
|
protected |
| bool MoreMountains.Tools.MMRigidbodyCenterOfMass.AutoDestroyComponentAfterSet = true |
whether or not this component should auto destroy after a set
| AutomaticSetModes MoreMountains.Tools.MMRigidbodyCenterOfMass.AutomaticSetMode = AutomaticSetModes.Awake |
whether to set the center of mass on awake, start, or via script only
| Vector3 MoreMountains.Tools.MMRigidbodyCenterOfMass.CenterOfMassOffset |
the offset to apply to the center of mass
| float MoreMountains.Tools.MMRigidbodyCenterOfMass.GizmoPointSize = 0.05f |
the size of the gizmo point to display at the center of mass
| bool MoreMountains.Tools.MMRigidbodyCenterOfMass.SetCenterOfMassButton |
a button to test the set method