Class DamageUI
Handle all the UI related to damage number appearing above object/character when they get damaged. Manage the pool of UI text and activating, placing and fading them out across time.
Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
DamageUI
Namespace: CreatorKitCodeInternal
Assembly: Assembly-CSharp.dll
Syntax
public class DamageUI : MonoBehaviour
Fields
DamageTextPrefab
Declaration
public Text DamageTextPrefab
Field Value
Type | Description |
---|---|
UnityEngine.UI.Text |
Properties
Instance
Declaration
public static DamageUI Instance { get; }
Property Value
Type | Description |
---|---|
DamageUI |
Methods
NewDamage(Int32, Vector3)
Called by the CharacterData system when a new damage is made. This will take care of grabbing a text from the pool and place it properly, then register it as an active text so its position and opacity is updated by the system.
Declaration
public void NewDamage(int amount, Vector3 worldPos)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | amount | The amount of damage to display |
UnityEngine.Vector3 | worldPos | The position is the world where the damage text should appear (e.g. character head) |