TargetDummyObject
ThaumielMapEditor.API.Blocks.ServerObjects
Overviewβ
Propertiesβ
| Name | Type | Access | Description |
|---|---|---|---|
Base | ShootingTarget | get | The instantiated AdminToys.ShootingTarget component for the spawned object. This value is null until ThaumielMapEditor.API.Blocks.ServerObjects.TargetDummyObject.SpawnObject(ThaumielMapEditor.API.Data.SchematicData,ThaumielMapEditor.API.Serialization.SerializableObject) is called. |
ObjectType | ObjectType | get set | Gets or sets the type of the object represented by this instance. |
Type | TargetType | get | The configured ThaumielMapEditor.API.Enums.TargetType for this target. Determined by parsing serialized data before spawning. |
Methodsβ
| Signature | Returns | Description |
|---|---|---|
GetPrefab(TargetType) | ShootingTarget | Returns the prefab AdminToys.ShootingTarget that corresponds to the provided `β¦ |
ParseValues(SerializableObject) | void | Parses and applies values from a `ThaumielMapEditor.API.Serialization.Serializab⦠|
SpawnObject(SchematicData, SerializableObject) | void | Spawns the specified ThaumielMapEditor.API.Blocks.ServerObject into the server⦠|
Propertiesβ
Baseβ
Type: ShootingTargetβAccess: get
The instantiated AdminToys.ShootingTarget component for the spawned object. This value is null until ThaumielMapEditor.API.Blocks.ServerObjects.TargetDummyObject.SpawnObject(ThaumielMapEditor.API.Data.SchematicData,ThaumielMapEditor.API.Serialization.SerializableObject) is called.
ObjectTypeβ
Type: ObjectTypeβAccess: get set
Gets or sets the type of the object represented by this instance.
Typeβ
Type: TargetTypeβAccess: get
The configured ThaumielMapEditor.API.Enums.TargetType for this target. Determined by parsing serialized data before spawning.
Methodsβ
GetPrefabβ
public ShootingTarget GetPrefab(TargetType type)
Returns the prefab AdminToys.ShootingTarget that corresponds to the provided type.
Parametersβ
| Name | Type | Description |
|---|---|---|
type | TargetType | The target variant to resolve a prefab for. |
Returnsβ
ShootingTarget β The matching AdminToys.ShootingTarget prefab.
Exceptionsβ
- ``System.InvalidOperationException
β Thrown when an unsupportedtypeis provided.
ParseValuesβ
public void ParseValues(SerializableObject serializable)
Parses and applies values from a ThaumielMapEditor.API.Serialization.SerializableObject to this instance. Validates that the serializable represents a target and extracts the ThaumielMapEditor.API.Enums.TargetType. Logs warnings when parsing fails or the object type does not match.
Parametersβ
| Name | Type | Description |
|---|---|---|
serializable | SerializableObject | The serialized object data to parse. |
SpawnObjectβ
public void SpawnObject(
SchematicData schematic,
SerializableObject serializable
)
Spawns the specified ThaumielMapEditor.API.Blocks.ServerObject into the server and adds it to the provided ThaumielMapEditor.API.Data.SchematicData's ThaumielMapEditor.API.Data.SchematicData.SpawnedServerObjects list.
Parametersβ
| Name | Type | Description |
|---|---|---|
schematic | SchematicData | |
serializable | SerializableObject |