Exemplo n.º 1
0
    private void Update()
    {
        if (Input.GetKeyDown(KeyCode.A))
        {
            EventHeroDamaged data = new EventHeroDamaged(10, new Vector3(45, 45, 45));
            EventsManager.DispatchEvent(data);
        }

        if (Input.GetKeyDown(KeyCode.D))
        {
            EventHeroDead data = new EventHeroDead(10000, 2);
            EventsManager.DispatchEvent(data);
        }

        if (Input.GetKeyDown(KeyCode.H))
        {
            EventsManager.UnsubscribeToEvent <EventHeroDamaged>(HeroDamage);
        }

        if (Input.GetKeyDown(KeyCode.J))
        {
            EventsManager.UnsubscribeToEvent <EventHeroDead>(HeroDead);
        }
    }
Exemplo n.º 2
0
 private void HeroDead(EventHeroDead dataEvent)
 {
     Debug.Log(dataEvent.score);
     Debug.Log(dataEvent.continuesLeft);
 }