docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Class LazyFollow

    Makes the GameObject this component is attached to follow a target with a delay and some other layout options.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    LazyFollow
    Inherited Members
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEngine.XR.Interaction.Toolkit.UI
    Assembly: solution.dll
    Syntax
    [AddComponentMenu("XR/Lazy Follow", 22)]
    [HelpURL("https://docs.unity.cn/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.UI.LazyFollow.html")]
    public class LazyFollow : MonoBehaviour

    Properties

    Name Description
    applyTargetInLocalSpace

    If true, apply the target offset in local space. If false, apply the target offset in world space.

    followInLocalSpace

    If true, read the local transform of the target to lazy follow, otherwise read the world transform. If using look at rotation follow modes, only world-space follow is supported.

    maxAngleAllowed

    Maximum angle offset (in degrees) from target before lazy follow targets, when time threshold is reached

    maxDistanceAllowed

    Maximum distance from target before lazy follow targets, when time threshold is reached.

    minAngleAllowed

    Minimum angle offset (in degrees) from target before which lazy follow starts.

    minDistanceAllowed

    Minimum distance from target before which a follow lazy follow starts.

    movementSpeed

    Movement speed used when smoothing to new target. Lower values mean the lazy follow lags further behind the target.

    movementSpeedVariancePercentage

    Adjust movement speed based on distance from the target using a tolerance percentage. 0% for constant speed. For example, with a variance of 25% (0.25), and a speed of 6, the upper bound is 7.5, which is reached as the target is approached. If the target is far from the object, the speed will trend toward the lower bound, which would be 4.5 in this case.

    positionFollowMode

    Determines the follow mode used to determine a new rotation.

    rotationFollowMode

    Determines the follow mode used to determine a new rotation.

    snapOnEnable

    Snap to target position when this component is enabled.

    target

    The object being followed. If not set, this will default to the main camera when this component is enabled.

    targetOffset

    The amount to offset the target's position when following. This position is relative/local to the target object.

    timeUntilThresholdReachesMaxAngle

    Time required to elapse (in seconds) before the max angle offset allowed goes from the min angle offset to the max.

    timeUntilThresholdReachesMaxDistance

    The time threshold (in seconds) where if max distance is reached the lazy follow capability will not be turned off.

    Methods

    Name Description
    Awake()

    See MonoBehaviour.

    LateUpdate()

    See MonoBehaviour.

    OnDestroy()

    See MonoBehaviour.

    OnDisable()

    See MonoBehaviour.

    OnEnable()

    See MonoBehaviour.

    OnValidate()

    See MonoBehaviour.

    TryGetThresholdTargetPosition(out Vector3)

    Determines if the new target position is within a dynamically determined threshold based on the time since the last update, and outputs the new target position if it meets the threshold.

    TryGetThresholdTargetRotation(out Quaternion)

    Determines if the new target rotation is within a dynamically determined threshold based on the time since the last update, and outputs the new target rotation if it meets the threshold.

    In This Article
    Back to top
    Copyright © 2023 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)