InteractionObject
ThaumielMapEditor.API.Blocks.ServerObjects
Overviewβ
Propertiesβ
| Name | Type | Access | Description |
|---|---|---|---|
AllowedRoles | List<RoleTypeId> | get set | Gets or sets the PlayerRoles.RoleTypeIds that are allowed to interact with this. |
Base | InvisibleInteractableToy | get | The runtime instance of the underlying AdminToys.InvisibleInteractableToy. |
CanSearch | bool | get | Returns true if the underlying interactable toy can currently be searched by players. |
InteractionDuration | float | get set | How long (in seconds) a player must hold the interaction for held interactions. |
IsLocked | bool | get set | Whether the interactable is locked and cannot be searched by players. |
ObjectType | ObjectType | get set | The type of this server object. Always ThaumielMapEditor.API.Enums.ObjectType.Interactable. |
Permissions | DoorPermissionFlags | get set | The permissions required to interact with this ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject instance. |
Scale | Vector3 | get set | No description |
Shape | ColliderShape | get set | The collider shape used by the interactable toy. |
Methodsβ
| Signature | Returns | Description |
|---|---|---|
ParseValues(SerializableObject) | void | Parses configuration values from a `ThaumielMapEditor.API.Serialization.Serializ⦠|
SpawnObject(SchematicData, SerializableObject) | void | Spawns the specified ThaumielMapEditor.API.Blocks.ServerObject into the server⦠|
SpawnObject(SchematicData) | void | No description |
TryGetInteractionObject(InvisibleInteractableToy, InteractionObject&) | bool | Tries to get a ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject fr⦠|
Propertiesβ
AllowedRolesβ
Type: List<RoleTypeId>βAccess: get set
Gets or sets the PlayerRoles.RoleTypeIds that are allowed to interact with this.
Baseβ
Type: InvisibleInteractableToyβAccess: get
The runtime instance of the underlying AdminToys.InvisibleInteractableToy.
CanSearchβ
Type: boolβAccess: get
Returns true if the underlying interactable toy can currently be searched by players.
InteractionDurationβ
Type: floatβAccess: get set
How long (in seconds) a player must hold the interaction for held interactions.
Setting this property updates the underlying AdminToys.InvisibleInteractableToy.InteractionDuration. A value of 0 represents an instant interaction and will trigger ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject.OnInteracted.
IsLockedβ
Type: boolβAccess: get set
Whether the interactable is locked and cannot be searched by players.
Setting this property updates the underlying AdminToys.InvisibleInteractableToy.IsLocked.
ObjectTypeβ
Type: ObjectTypeβAccess: get set
The type of this server object. Always ThaumielMapEditor.API.Enums.ObjectType.Interactable.
Permissionsβ
Type: DoorPermissionFlagsβAccess: get set
The permissions required to interact with this ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject instance.
Scaleβ
Type: Vector3βAccess: get set
Shapeβ
Type: ColliderShapeβAccess: get set
The collider shape used by the interactable toy.
Setting this property updates the underlying AdminToys.InvisibleInteractableToy.Shape.
Methodsβ
ParseValuesβ
public void ParseValues(SerializableObject serializable)
Parses configuration values from a ThaumielMapEditor.API.Serialization.SerializableObject into this instance.
If the ThaumielMapEditor.API.Serialization.SerializableObject.ObjectType is not ThaumielMapEditor.API.Enums.ObjectType.Interactable, the method logs a warning. Each individual value is parsed via ThaumielMapEditor.API.Extensions.DictionaryExtensions.TryConvertValue``1(System.Collections.Generic.Dictionary{System.String,System.Object},System.String,``0@) and will log a warning and abort on failure to parse any expected value.
Parametersβ
| Name | Type | Description |
|---|---|---|
serializable | SerializableObject | Serializable object expected to have ObjectType = ThaumielMapEditor.API.Enums.ObjectType.Interactable and values for "Shape", "Duration", and "Locked". |
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 |
SpawnObjectβ
public void SpawnObject(SchematicData schematic)
Parametersβ
| Name | Type | Description |
|---|---|---|
schematic | SchematicData |
TryGetInteractionObjectβ
public bool TryGetInteractionObject(
InvisibleInteractableToy toy,
InteractionObject& interactionobj
)
Tries to get a ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject from a AdminToys.InvisibleInteractableToy
Parametersβ
| Name | Type | Description |
|---|---|---|
toy | InvisibleInteractableToy | The AdminToys.InvisibleInteractableToy to check for ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject |
interactionobj | InteractionObject& | The ThaumielMapEditor.API.Blocks.ServerObjects.InteractionObject if found. |
Returnsβ
bool β true if found else returns false if not found