docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method GetComponentInActiveScene

    GetComponentInActiveScene<T>()

    Retrieves the first component of the given type in the active scene

    Declaration
    public static T GetComponentInActiveScene<T>() where T : Component
    Returns
    Type Description
    T

    The first component found in the active scene, or null if none exists

    Type Parameters
    Name Description
    T

    The type of component to retrieve

    In This Article
    Back to top
    Copyright © 2024 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)