Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pjv:laboratoare:2024:a02 [2024/10/21 13:38]
alexandru.gradinaru
pjv:laboratoare:2024:a02 [2024/10/23 08:45] (current)
maria_anca.balutoiu [Sisteme de evenimente]
Line 47: Line 47:
     * Inamicii realizeaza actiuni random     * Inamicii realizeaza actiuni random
  
-Pentru simplitate, toate interactiunile se pot realiza prin butoane de comanda.+Pentru simplitate, toate interactiunile se pot realiza prin butoane de comanda, dar este necesar sa folositi un sistem de evenimente pentru decuplarea responsabilitatilor (la alegere).
  
 Bonusuri: Bonusuri:
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.
pjv/laboratoare/2024/a02.1729507123.txt.gz ยท Last modified: 2024/10/21 13:38 by alexandru.gradinaru
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0