docs.unity.cn
Search Results for

    Show / Hide Table of Contents

    Method GetComponentsInScene

    GetComponentsInScene<T>(Scene, List<T>, bool)

    Retrieves all components of the given type in a scene

    Declaration
    public static void GetComponentsInScene<T>(Scene scene, List<T> components, bool includeInactive = false) where T : Component
    Parameters
    Type Name Description
    Scene scene

    The scene to search

    List<T> components

    List that will be filled out with components retrieved

    bool includeInactive

    Should Components on inactive GameObjects be included in the found set?

    Type Parameters
    Name Description
    T

    The type of components 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)