You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-7Lines changed: 13 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,30 +4,35 @@
4
4
## How To Use
5
5
### Dealing Damage
6
6
To deal damage call the `Damage(int amount)` function. When damage is taken all events in the `OnDamage` UnityEvent will be invoked and if health is <= 0 then `OnDeath` will be invoked aswell.
7
-
>[!NOTE]
7
+
>[!IMPORTANT]
8
8
>OnDeath is invoked AFTER OnDamage and not instead of.
9
9
10
+
Implimentation in [Health.cs/Damage(int amount)](https://github.com/Mateo-Jimenez76/Unity-Health-Script/blob/a4a69911970ceddeb410e8de71320b76d3fd5b3a/Runtime/Health.cs#L39-L60)
11
+
10
12
### Healing
11
-
To heal call the `Heal(int amount)` function. This function will invoke all events in the `OnHealth UnityEvent`.
13
+
To heal call the `Heal(int amount)` function. This function will also invoke all events in the `OnHealth` UnityEvent.
14
+
15
+
Implimentation in [Health.cs/Heal(int amount)](https://github.com/Mateo-Jimenez76/Unity-Health-Script/blob/a4a69911970ceddeb410e8de71320b76d3fd5b3a/Runtime/Health.cs#L61-L85)
12
16
### Subscribing / Unsubscribing From Events
13
17
If you would like to subscribe to the events through scripts you can call `SubscribeTo...(UnityAction action)` followed by the name of the corresponding Unity Event. Ex: `SubscribeToOnDeath(UnityAction action)`. To unsubscribe is the same process but instead you call `UnsubscribeFrom...(UnityAction action)` with the UnityAction you wish to remove from the Event.
14
18
15
19
# Health Displayer
16
20
17
-
## How To Use
18
-
19
21
### Prerequisites
20
22
A Health script is required to be on the same object as the HealthDisplayer.
21
23
If one is not already on it then one will be created for you due to the effect of `[RequireComponent(typeof(Health))]`\
A TextMeshProUGUI is required as a refenced to display the text. While displaying as a number there are several formats to chose from which go as follows.
35
+
A `TextMeshProUGUI` is required. While displaying as a number there are several formats to chose from which go as follows.
31
36
32
37
### Number Display Options
33
38
@@ -41,4 +46,5 @@ A TextMeshProUGUI is required as a refenced to display the text. While displayin
0 commit comments