Show / Hide Table of Contents

Method GetPrefab

| Edit this page View Source

GetPrefab(string)

Get a prefab by its name.

Search hierarchy:
  1. Custom prefab with the exact name
  2. Vanilla prefab with the exact name from ZNetScene if already instantiated
  3. Vanilla prefab from the prefab cache
Declaration
public GameObject GetPrefab(string name)
Parameters
Type Name Description
string name Name of the prefab to search for.
Returns
Type Description
GameObject The existing prefab, or null if none exists with given name
  • Edit this page
  • View Source
☀
☾
In this article
Back to top
Generated by DocFX
☀
☾