ObjectHealth
ThaumielMapEditor.API.Components.Tools
Overviewβ
Propertiesβ
| Name | Type | Access | Description |
|---|---|---|---|
CenterOfMass | Vector3 | get | Gets the center of mass of the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance. |
DespawnTime | float | 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 | Vector3 | 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 | float | get set | Gets or sets the current health that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance has. |
HealthMax | float | get set | Gets or sets the max health that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance has. |
NetworkId | UInt32 | get | Gets the NetworkId. Required by IDestructible |
State | DestroyState | get | Gets the ThaumielMapEditor.API.Components.Tools.ObjectHealth.DestroyState that the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance will use when destroyed. |
StateName | string | 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 | ToolType | get | The ThaumielMapEditor.API.Enums.ToolType this ThaumielMapEditor.API.Components.Tools.ToolBase instance uses. |
Fieldsβ
| Name | Type | Description |
|---|---|---|
AllowedDamage | List<DamageType> | Gets or sets the allowed ThaumielMapEditor.API.Enums.DamageTypes that the `Tha⦠|
Methodsβ
| Signature | Returns | Description |
|---|---|---|
Damage(float, DamageHandlerBase, Vector3) | bool | Attempts to damage the ThaumielMapEditor.API.Components.Tools.ObjectHealth ins⦠|
Destroy() | void | Destroys the ThaumielMapEditor.API.Components.Tools.ObjectHealth instance and⦠|
Init(ServerObject, SchematicData, Dictionary<string, object>) | void | Initializes 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β
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β
| Name | Type | Description |
|---|---|---|
damage | float | The amount of health to subtract from ThaumielMapEditor.API.Components.Tools.ObjectHealth.Health. |
handler | DamageHandlerBase | The source of the damage. |
exactHitPos | Vector3 | The position of the hit. |
Returnsβ
bool β true if the damage was applied otherwise false.
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β
public void Init(
ServerObject obj,
SchematicData schem,
Dictionary<string, object> properties
)
Initializes the component.
Parametersβ
| Name | Type | Description |
|---|---|---|
obj | ServerObject | |
schem | SchematicData | |
properties | Dictionary<string, object> |