日本語翻訳ドキュメントはサポートを終了しました

MRTK 2.6 以降のドキュメントについては、公式の Microsoft ドキュメント を参照してください。

    Show / Hide Table of Contents

    Class PressableButton

    A button that can be pushed via direct touch. You can use PhysicalPressEventRouter to route these events to Interactable.

    Inheritance
    Object
    PressableButton
    PressableButtonHoloLens2
    Implements
    IMixedRealityTouchHandler
    Namespace: Microsoft.MixedReality.Toolkit.UI
    Assembly: cs.temp.dll.dll
    Syntax
    public class PressableButton : MonoBehaviour, IMixedRealityTouchHandler

    Fields

    ButtonPressed

    Declaration
    public UnityEvent ButtonPressed
    Field Value
    Type Description
    UnityEvent

    ButtonReleased

    Declaration
    public UnityEvent ButtonReleased
    Field Value
    Type Description
    UnityEvent

    movingButtonVisuals

    The object that is being pushed.

    Declaration
    protected GameObject movingButtonVisuals
    Field Value
    Type Description
    GameObject

    startPushDistance

    Declaration
    protected float startPushDistance
    Field Value
    Type Description
    Single

    TouchBegin

    Declaration
    public UnityEvent TouchBegin
    Field Value
    Type Description
    UnityEvent

    TouchEnd

    Declaration
    public UnityEvent TouchEnd
    Field Value
    Type Description
    UnityEvent

    Properties

    CurrentPushDistance

    Current push distance relative to the start push plane.

    Declaration
    public float CurrentPushDistance { get; protected set; }
    Property Value
    Type Description
    Single

    DistanceSpaceMode

    Describes in which coordinate space the plane distances are stored and calculated

    Declaration
    public PressableButton.SpaceMode DistanceSpaceMode { get; set; }
    Property Value
    Type Description
    PressableButton.SpaceMode

    EnforceFrontPush

    Ensures that the button can only be pushed from the front. Touching the button from the back or side is prevented.

    Declaration
    public bool EnforceFrontPush { get; }
    Property Value
    Type Description
    Boolean

    IsPressing

    Represents the state of whether the button is currently being pressed.

    Declaration
    public bool IsPressing { get; }
    Property Value
    Type Description
    Boolean

    IsTouching

    Represents the state of whether or not a finger is currently touching this button.

    Declaration
    public bool IsTouching { get; }
    Property Value
    Type Description
    Boolean

    LocalToWorldScale

    Transform for local to world space in the world direction of a press Multiply local scale positions by this value to convert to world space

    Declaration
    public float LocalToWorldScale { get; }
    Property Value
    Type Description
    Single

    MaxPushDistance

    Maximum push distance. Distance is relative to the pivot of either the moving visuals if there's any or the button itself.

    Declaration
    public float MaxPushDistance { get; set; }
    Property Value
    Type Description
    Single

    PressDistance

    Distance the button must be pushed until it is considered pressed. Distance is relative to the pivot of either the moving visuals if there's any or the button itself.

    Declaration
    public float PressDistance { get; set; }
    Property Value
    Type Description
    Single

    ReleaseDistanceDelta

    Withdraw amount needed to transition from Pressed to Released.

    Declaration
    public float ReleaseDistanceDelta { get; set; }
    Property Value
    Type Description
    Single

    ReleaseOnTouchEnd

    Button will send the release event on touch end after successful press even if release plane hasn't been passed.

    Declaration
    public bool ReleaseOnTouchEnd { get; set; }
    Property Value
    Type Description
    Boolean

    StartPushDistance

    The offset at which pushing starts. Offset is relative to the pivot of either the moving visuals if there's any or the button itself.

    Declaration
    public float StartPushDistance { get; set; }
    Property Value
    Type Description
    Single

    Methods

    GetDistanceAlongPushDirection(Vector3)

    Returns the local distance along the push direction for the passed in world position

    Declaration
    public float GetDistanceAlongPushDirection(Vector3 positionWorldSpace)
    Parameters
    Type Name Description
    Vector3 positionWorldSpace
    Returns
    Type Description
    Single

    GetLocalPositionAlongPushDirection(Single)

    Returns local position along the push direction for the given local distance

    Declaration
    public Vector3 GetLocalPositionAlongPushDirection(float localDistance)
    Parameters
    Type Name Description
    Single localDistance
    Returns
    Type Description
    Vector3

    GetWorldPositionAlongPushDirection(Single)

    Returns world space position along the push direction for the given local distance

    Declaration
    public Vector3 GetWorldPositionAlongPushDirection(float localDistance)
    Parameters
    Type Name Description
    Single localDistance
    Returns
    Type Description
    Vector3

    Start()

    Declaration
    protected virtual void Start()

    UpdateMovingVisualsPosition()

    Declaration
    protected virtual void UpdateMovingVisualsPosition()

    Implements

    IMixedRealityTouchHandler
    Back to top Generated by DocFX