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.

  • CursorTopLeftTexture Texture2D optional

    Cursor texture for the enabled rotation in the top right corner.

  • CursorTopLeftHotSpot Vector2

    The offset from the top left of the CursorTopLeftTexture to use as the target point (must be within the bounds of the cursor).

  • CursorTopRightTexture Texture2D optional

    Cursor texture for the enabled rotation in the top right corner.

  • CursorTopRightHotSpot Vector2

    The offset from the top left of the CursorTopRightHotSpot to use as the target point (must be within the bounds of the cursor).

  • CursorBottomLeftTexture Texture2D optional

    Cursor texture for the enabled rotation in the top right corner.

  • CursorBottomLeftHotSpot Vector2

    The offset from the top left of the CursorBottomLeftHotSpot to use as the target point (must be within the bounds of the cursor).

  • CursorBottomRightTexture Texture2D optional

    Cursor texture for the enabled rotation in the top right corner.

  • CursorBottomRightHotSpot Vector2

    The offset from the top left of the CursorBottomRightHotSpot to use as the target point (must be within the bounds of the cursor).

  • DefaultCursorTexture Texture2D optional

    Default cursor texture.

  • DefaultCursorHotSpot Vector2

    The offset from the top left of the DefaultCursorTexture to use as the target point (must be within the bounds of the cursor).

Events

  • OnStartRotate UnityEvent<Rotatable>

  • OnRotate UnityEvent<Rotatable>

  • OnEndRotate UnityEvent<Rotatable>

Properties

  • Target RectTransform

    Target to rotate; the self is by default.