Show / Hide Table of Contents

Class SpawnedPrefab

This component should be on all saveable prefab objects (at root level) that weren't in the scene at edit-time (ergo spawned at runtime, like grenades, dropped items, etc...).

It can have a linked SaveableComponent to store/reconstruct the important data (use GetSaveableComponent() to access it).

Make sure it doesn't appear in the scene at edit-time but only and EXCLUSIVELY AT RUNTIME (via instantiation!).

The GlitchedPolygons.SavegameFramework.SpawnedPrefab.resourcePath is the local Resources path used to reconstruct (instantiate) this prefab object on load.

Inheritance
System.Object
SpawnedPrefab
Namespace: GlitchedPolygons.SavegameFramework
Assembly: UnityScriptsLibrary.dll
Syntax
public sealed class SpawnedPrefab : MonoBehaviour

Fields

| Improve this Doc View Source

SPAWNED_PREFABS

List of prefabs spawned at runtime that shall persist between game sessions.

Declaration
public static readonly List<SpawnedPrefab> SPAWNED_PREFABS
Field Value
Type Description
System.Collections.Generic.List<SpawnedPrefab>

Methods

| Improve this Doc View Source

GetResourcePath()

Get the GlitchedPolygons.SavegameFramework.SpawnedPrefab.resourcePath.

Declaration
public string GetResourcePath()
Returns
Type Description
System.String

The path used to reconstruct the prefab on load.

| Improve this Doc View Source

GetSaveableComponent()

Gets the linked GlitchedPolygons.SavegameFramework.SpawnedPrefab.saveableComponent.

Declaration
public SaveableComponent GetSaveableComponent()
Returns
Type Description
SaveableComponent

Optional SaveableComponent that can contain prefab data that you want to persist between game sessions.

  • Improve this Doc
  • View Source
Back to top Generated by DocFX