Skip to main content

ObjectHealth

class ThaumielMapEditor.API.Components.Tools

Overview​

Properties​

NameTypeAccessDescription
CenterOfMassVector3getGets the center of mass of the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance.
DespawnTimefloatget setGets or sets the amount of time in seconds that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance will have untill it despawns after being destroyed.
ForceVector3get setGets or sets the launch force of the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance that will be applied to the UnityEngine.Rigidbody if the ThaumielMapEditor.API.Components.Tools.ObjectHealth.State is ThaumielMapEditor.API.Components.Tools.ObjectHealth.DestroyState.ApplyPhysics.
Healthfloatget setGets or sets the current health that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance has.
HealthMaxfloatget setGets or sets the max health that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance has.
NetworkIdUInt32getGets the NetworkId. Required by IDestructible
StateDestroyStategetGets the ThaumielMapEditor.API.Components.Tools.ObjectHealth.DestroyState that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance will use when destroyed.
StateNamestringget setGets or sets the animation name that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance will play if the ThaumielMapEditor.API.Components.Tools.ObjectHealth.State is ThaumielMapEditor.API.Components.Tools.ObjectHealth.DestroyState.Animate.
TypeToolTypegetThe ThaumielMapEditor.API.Enums.ToolType this ThaumielMapEditor.API.Components.Tools.ToolBase instance uses.

Fields​

NameTypeDescription
AllowedDamageList<DamageType>Gets or sets the allowed ThaumielMapEditor.API.Enums.DamageTypes that the `Tha…

Methods​

SignatureReturnsDescription
Damage(float, DamageHandlerBase, Vector3)boolAttempts to damage the ThaumielMapEditor.API.Components.Tools.ObjectHealth ins…
Destroy()voidDestroys the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance and…
Init(ServerObject, SchematicData, Dictionary<string, object>)voidInitializes the component.

Properties​

CenterOfMass​

Type: Vector3 Access: get

Gets the center of mass of the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance.


DespawnTime​

Type: float Access: get set

Gets or sets the amount of time in seconds that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance will have untill it despawns after being destroyed.


Force​

Type: Vector3 Access: get set

Gets or sets the launch force of the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance that will be applied to the UnityEngine.Rigidbody if the ThaumielMapEditor.API.Components.Tools.ObjectHealth.State is ThaumielMapEditor.API.Components.Tools.ObjectHealth.DestroyState.ApplyPhysics.


Health​

Type: float Access: get set

Gets or sets the current health that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance has.


HealthMax​

Type: float Access: get set

Gets or sets the max health that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance has.


NetworkId​

Type: UInt32 Access: get

Gets the NetworkId. Required by IDestructible


State​

Type: DestroyState Access: get

Gets the ThaumielMapEditor.API.Components.Tools.ObjectHealth.DestroyState that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance will use when destroyed.


StateName​

Type: string Access: get set

Gets or sets the animation name that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance will play if the ThaumielMapEditor.API.Components.Tools.ObjectHealth.State is ThaumielMapEditor.API.Components.Tools.ObjectHealth.DestroyState.Animate.


Type​

Type: ToolType Access: get

The ThaumielMapEditor.API.Enums.ToolType this ThaumielMapEditor.API.Components.Tools.ToolBase instance uses.


Fields​

AllowedDamage​

Type: List<DamageType>

Gets or sets the allowed ThaumielMapEditor.API.Enums.DamageTypes that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance can be damaged by.


Methods​

Damage​

Damage
public bool Damage(
float damage,
DamageHandlerBase handler,
Vector3 exactHitPos
)

Attempts to damage the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance if the handler matches an allowed ThaumielMapEditor.API.Enums.DamageType.

Parameters​

NameTypeDescription
damagefloatThe amount of health to subtract from ThaumielMapEditor.API.Components.Tools.ObjectHealth.Health.
handlerDamageHandlerBaseThe source of the damage.
exactHitPosVector3The position of the hit.

Returns​

bool β€” true if the damage was applied otherwise false.


Destroy​

Destroy
public void Destroy()

Destroys the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance and applies the destroy state from ThaumielMapEditor.API.Components.Tools.ObjectHealth.State


Init​

Init
public void Init(
ServerObject obj,
SchematicData schem,
Dictionary<string, object> properties
)

Initializes the component.

Parameters​

NameTypeDescription
objServerObject
schemSchematicData
propertiesDictionary<string, object>