docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method CreateGameObject

    CreateGameObject(string, params Type[])

    Creates gameObject and keeps track of it, so it is cleaned up properly at [TearDown]. Uses appropriate method depending on whether the test is playing.

    Declaration
    protected GameObject CreateGameObject(string name, params Type[] components)
    Parameters
    Type Name Description
    string name

    Name of the gameObject.

    Type[] components

    Components to add to the gameObject.

    Returns
    Type Description
    GameObject

    GameObject created.

    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)