Class TrashManager
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
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
idstringThe ID of the trash item to create.
positionVector3The position to create the trash at.
rotationQuaternionThe rotation of the trash item.
initialVelocityVector3Optional initial velocity.
guidstringOptional 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
idstringThe ID of the trash prefab.
Returns
- GameObject
The trash prefab GameObject, or null if not found.