Table of Contents

Class ContainerTemplate

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

ScriptableObject template defining configuration for container interactables (chests, wardrobes, etc.).

[CreateAssetMenu(fileName = "New Container", menuName = "FishMMO/Character/Container/Container", order = 1)]
public class ContainerTemplate : CachedScriptableObject<ContainerTemplate>, ICachedObject
Inheritance
Object
ScriptableObject
ContainerTemplate
Implements
Inherited Members
ScriptableObject.SetDirty()
ScriptableObject.CreateInstance<T>()
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Fields

Description

public string Description

Field Value

string

DespawnWhenEmpty

When true, the container despawns after all items have been taken.

public bool DespawnWhenEmpty

Field Value

bool

IconReference

Addressable reference to the icon sprite for this container.

public AssetReferenceSprite IconReference

Field Value

AssetReferenceSprite

LootTable

What this container holds. Rolled once, on the server, each time it spawns.

[Tooltip("Loot table rolled into this container's slots each time it spawns. None = empty container.")]
public LootTableTemplate LootTable

Field Value

LootTableTemplate

Remarks

Without this a container had no way to contain anything. SlotCount slots were created empty on awake and nothing anywhere ever put an item in one, so every chest in the world opened bare, FilledSlots was always zero, and DespawnWhenEmpty described a condition that was true from the moment the object spawned.

The same LootTableTemplate a creature drops from, so a chest and a corpse are authored and balanced the same way. Currency is rolled but discarded: a container exposes item slots and has no currency channel in ContainerOpenBroadcast, so a table with a currency range on it is a content mistake worth leaving visible rather than silently inventing a place to put it.

SlotCount

Number of item slots this container provides.

public int SlotCount

Field Value

int

Properties

Icon

The icon for this container (loaded at runtime on client).

public Sprite Icon { get; }

Property Value

Sprite

Name

public string Name { get; }

Property Value

string

Methods

OnLoad(string, string, int)

Called when the container template is loaded into cache. Loads the icon on the client.

public override void OnLoad(string typeName, string resourceName, int resourceID)

Parameters

typeName string
resourceName string
resourceID int

OnUnload(string, string, int)

Called when the container template is unloaded from cache. Releases the icon on the client.

public override void OnUnload(string typeName, string resourceName, int resourceID)

Parameters

typeName string
resourceName string
resourceID int