Table of Contents

Class TrashManager

Namespace
S1API.Trash
Assembly
S1API.dll

Provides management over trash items in the game.

public static class TrashManager
Inheritance
TrashManager
Inherited Members

Fields

TrashItemLimit

Maximum number of trash items allowed in the world (2000).

public const int TrashItemLimit = 2000

Field Value

int

Methods

CreateTrashItem(string, Vector3, Quaternion, Vector3, string)

Creates a trash item at the specified position.

public static GameObject? CreateTrashItem(string id, Vector3 position, Quaternion rotation, Vector3 initialVelocity = null, string guid = "")

Parameters

id string

The ID of the trash item to create.

position Vector3

The position to create the trash at.

rotation Quaternion

The rotation of the trash item.

initialVelocity Vector3

Optional initial velocity.

guid string

Optional GUID (auto-generated if empty).

Returns

GameObject

The created trash item GameObject, or null if creation failed.

DestroyAllTrash()

Destroys all trash items in the world. Only works if called on the server/host.

public static void DestroyAllTrash()

GetRandomTrashPrefab()

Gets a random trash prefab based on generation chances.

public static GameObject? GetRandomTrashPrefab()

Returns

GameObject

A random trash prefab GameObject.

GetTrashPrefab(string)

Gets a trash prefab by its ID.

public static GameObject? GetTrashPrefab(string id)

Parameters

id string

The ID of the trash prefab.

Returns

GameObject

The trash prefab GameObject, or null if not found.