Rotatable

Allows rotating gameobject around its pivot.

Options

  • Interactable bool

    Allow users to change the rotation of the GameObject.

  • Rotate Directions Rotatable.Directions

    Allowed corners to apply the rotation.

  • Active Region float

    Distance from border where rotation allowed.

  • Limit Rotation bool

    Allows rotating objects only with the specified angles range.

    • Angle Min float

      Allowed value is in range [-180..180].

    • Angle Max float

      Allowed value is in range [-180..180].

  • Angle step float

    Allowed value is in range [0..180). Set 0 to disable.

  • Cursors Cursors

    Custom cursors to show the allowed rotation state.

Events

  • OnStartRotate UnityEvent<Rotatable>

  • OnRotate UnityEvent<Rotatable>

  • OnEndRotate UnityEvent<Rotatable>

  • OnTargetChanged UnityEvent<Rotatable>

Properties

  • Target RectTransform

    Target to rotate; the self is by default.