docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Method InstantiateUI

    InstantiateUI(IInstantiateUI, GameObject, Transform, bool, Transform)

    Method provided by the system for instantiating UI

    Declaration
    public static GameObject InstantiateUI(this IInstantiateUI user, GameObject prefab, Transform parent = null, bool worldPositionStays = true, Transform rayOrigin = null)
    Parameters
    Type Name Description
    IInstantiateUI user

    The functionality user

    GameObject prefab

    The prefab to instantiate

    Transform parent

    (Optional) A parent transform to instantiate under

    bool worldPositionStays

    (Optional) If true, the parent-relative position, scale and rotation are modified

    Transform rayOrigin

    (Optional) RayOrigin override that will be used when connecting interfaces on this object such that the object keeps the same world space position, rotation and scale as before.

    Returns
    Type Description
    GameObject

    The instantiated GameObject

    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)