This shows you the differences between two versions of the page.
pjv:laboratoare:2024:a02 [2024/10/21 13:39] alexandru.gradinaru |
pjv:laboratoare:2024:a02 [2024/10/23 08:45] (current) maria_anca.balutoiu [Sisteme de evenimente] |
||
---|---|---|---|
Line 248: | Line 248: | ||
| | ||
// Unsubscribe from the event (stop listening). | // Unsubscribe from the event (stop listening). | ||
- | private void OnDisable() => player.OnPlayerHealthChanged += HandlePlayerHealthChanged; | + | private void OnDisable() => player.OnPlayerHealthChanged -= HandlePlayerHealthChanged; |
// Method which is called on event invocation | // Method which is called on event invocation | ||
Line 317: | Line 317: | ||
fileName = "PlayerEventSO", | fileName = "PlayerEventSO", | ||
menuName = "Player/PlayerEventSO")] | menuName = "Player/PlayerEventSO")] | ||
- | public class PlayerEventSO : MonoBehaviour | + | public class PlayerEventSO : ScriptableObject |
{ | { | ||
// Unity event. | // Unity event. |