docs.unity.cn
    Show / Hide Table of Contents

    Class RuntimeUtility

    An ad-hoc collection of helpers, used by Cinemachine or its editor tools in various places

    Inheritance
    Object
    RuntimeUtility
    Namespace: Unity.Cinemachine
    Syntax
    public static class RuntimeUtility

    Methods

    DestroyObject(Object)

    Convenience to destroy an object, using the appropriate method depending on whether the game is playing

    Declaration
    public static void DestroyObject(Object obj)
    Parameters
    Type Name Description
    Object obj

    The object to destroy

    IsPrefab(GameObject)

    Check whether a GameObject is a prefab.
    For editor only - some things are disallowed if prefab. In runtime, will always return false.

    Declaration
    public static bool IsPrefab(GameObject gameObject)
    Parameters
    Type Name Description
    GameObject gameObject

    the object to check

    Returns
    Type Description
    Boolean

    If editor, checks if object is a prefab or prefab instance.
    In runtime, returns false always

    NormalizeCurve(AnimationCurve, Boolean, Boolean)

    Normalize a curve so that its X and Y axes range from 0 to 1

    Declaration
    public static AnimationCurve NormalizeCurve(AnimationCurve curve, bool normalizeX, bool normalizeY)
    Parameters
    Type Name Description
    AnimationCurve curve

    Curve to normalize

    Boolean normalizeX

    If true, normalize the X axis

    Boolean normalizeY

    If true, normalize the Y axis

    Returns
    Type Description
    AnimationCurve

    The normalized curve

    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Saturday, May 6, 2023