Bearbeiten

Freigeben über


ButtonBackgroundSizeOffset Class

Definition

Caution

This component is no longer supported

Scales an object relative the scale of the Anchor Transform Works best when using with Layout3DPixelSize, but not required - See LayoutPixelSize for more info Use Case: Create a button, then add another element who's size should maintain a consistent size relative to the Anchor. Like creating a button background using a Cube and ButtonSize. The add another Cube that is 40 pixels smaller than the background. Event if the background changes size, this element will remain 40 pixels smaller.

public ref class ButtonBackgroundSizeOffset : UnityEngine::MonoBehaviour
[System.Obsolete("This component is no longer supported", true)]
[UnityEngine.AddComponentMenu("Scripts/MRTK/Obsolete/ButtonBackgroundSizeOffset")]
[UnityEngine.ExecuteInEditMode]
public class ButtonBackgroundSizeOffset : UnityEngine.MonoBehaviour
[<System.Obsolete("This component is no longer supported", true)>]
[<UnityEngine.AddComponentMenu("Scripts/MRTK/Obsolete/ButtonBackgroundSizeOffset")>]
[<UnityEngine.ExecuteInEditMode>]
type ButtonBackgroundSizeOffset = class
    inherit MonoBehaviour
Public Class ButtonBackgroundSizeOffset
Inherits MonoBehaviour
Inheritance
UnityEngine.MonoBehaviour
ButtonBackgroundSizeOffset
Attributes
ObsoleteAttribute UnityEngine.AddComponentMenuAttribute UnityEngine.ExecuteInEditModeAttribute

Constructors

ButtonBackgroundSizeOffset()

Methods

GetScale()
GetSOffset()

Get the current offset value

SetOffset(Vector3)

Set a consistent offset value from the Anchor

SetScale(Vector3)

Set the objects scale relative to the Anchor

Applies to