-
Notifications
You must be signed in to change notification settings - Fork 2
ObjectReferences
Nathan Gill edited this page Sep 4, 2020
·
1 revision
This is a static class to make it easier to discover and get references to specific key game objects or components in a scene.
By default, there are a number of these references already included in WurstMod:
Field Name | Type | Description |
---|---|---|
ButtonDonor | FVRPointableButton | This is a reference to the first button in the scene. It is used to take font and sprite data to apply to custom buttons. |
BarrierDonor | TNH_DestructableBarrierPoint | Reference to a TNH Barrier. Used to make copies of for custom maps. |
ManagerDonor | TNH_Manager | Reference to the TNH Manager. |
HoldPointDonor | TNH_HoldPoint | Reference to a TNH Hold Point. Used for copying data to custom holds. |
GroundPanel | SosigTestingPanel1 | Reference to a Sosig Testing Panel. This is used to create custom ground menu panels. |
ReverbSystem | FVRReverbSystem | Reference to the Reverb System. |
ItemSpawnerDonor | GameObject | Reference to an Item Spawner. |
DestructobinDonor | GameObject | Reference to a Destructobin. |
SosigSpawnerDonor | GameObject | Reference to a SosigSpawner. |
WhizzBandADingerDonor | GameObject | Reference to a WhizzBangADinger. |
BangerDetonator | GameObject | Reference to a WhizzBandADinger Detonator. |
CameraRig | GameObject | Reference to the Camera Rig (you). |
FinalScore | GameObject | Reference to the TNH scoreboard. |
ResetPoint | GameObject | The position you enter the TNH score room at. |
You can also declare your own references by adding the ObjectReference
attribute onto any static field.
The attribute takes an optional string parameter to filter by GameObject name, and you can also filter to a specific component type.
Examples:
// This will be set to a reference of the first game object in the scene that has a name containing foo
[ObjectReference("foo")]
public static GameObject FooObject;
// This will be set to a reference of the first component of the matching type found in the scene
[ObjectReference]
public static MyComponent ComponentReference;
// This combines both a name filter and component filter.
[ObjectReference("bar")]
public static BarComponent FooBar;
Quick Start
Step-by-step Mapping Guides
- Setting up your environment
- Creating your first map
- Creating custom scripts
- Creating in-game menus
Mapping References