docs.unity3d.com
    Show / Hide Table of Contents

    Interface IPrefabFactory

    Prefab factories can be registered to AssetPacks to supplement their ability to instantiate prefabs

    Namespace: Unity.RuntimeSceneSerialization.Prefabs
    Syntax
    public interface IPrefabFactory

    Methods

    TryInstantiatePrefab(String, Transform)

    Try to instantiate a prefab with the given guid

    Declaration
    GameObject TryInstantiatePrefab(string guid, Transform parent = null)
    Parameters
    Type Name Description
    String guid

    The guid of the prefab that should be instantiated

    Transform parent

    The parent object to use when calling Instantiate

    Returns
    Type Description
    GameObject

    The prefab instance, if one was created

    Back to top
    Terms of use
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023