Class PrefabManager
Handles all logic to do with managing custom prefabs added into the game.
Namespace: JotunnLib.Managers
Assembly: JotunnLib.dll
Syntax
public class PrefabManager : Manager
Properties
| Improve this Doc View SourceInstance
Declaration
public static PrefabManager Instance { get; }
Property Value
Type | Description |
---|---|
PrefabManager |
Methods
| Improve this Doc View SourceCreatePrefab(String)
Registers a new prefab that's an empty primitive, with just a ZNetView component
Declaration
public GameObject CreatePrefab(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
GameObject |
CreatePrefab(String, String)
Registers a new prefab that's a copy of given base.
Declaration
public GameObject CreatePrefab(string name, string baseName)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | New prefab name |
System.String | baseName | Base prefab name |
Returns
Type | Description |
---|---|
GameObject | New prefab object |
GetPrefab(String)
Returns an existing prefab with given name, or null if none exist.
Declaration
public GameObject GetPrefab(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the prefab to search for |
Returns
Type | Description |
---|---|
GameObject |
RegisterPrefab(GameObject, String)
Register an existing GameObject as a prefab
Declaration
public void RegisterPrefab(GameObject prefab, string name = null)
Parameters
Type | Name | Description |
---|---|---|
GameObject | prefab | The GameObject to register as a prefab |
System.String | name | The name for the prefab. If not provided, will use name of GameObject |
RegisterPrefab(PrefabConfig)
Registers a new prefab from given PrefabConfig instance
Declaration
public void RegisterPrefab(PrefabConfig prefabConfig)
Parameters
Type | Name | Description |
---|---|---|
PrefabConfig | prefabConfig | Prefab configuration |
Events
| Improve this Doc View SourcePrefabRegister
Declaration
public event EventHandler PrefabRegister
Event Type
Type | Description |
---|---|
System.EventHandler |
PrefabsLoaded
Declaration
public event EventHandler PrefabsLoaded
Event Type
Type | Description |
---|---|
System.EventHandler |