blob: 7abb88d7d3434ebcbd69daf6d9f2843924e9d3de (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
using System;
using UnityEngine;
using UnityEngine.Events;
public class RespawnEvent : MonoBehaviour
{
public UnityEvent reviveEvent;
private void Start()
{
HealthHandler healthHandler = GetComponentInParent<Player>().data.healthHandler;
healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(DoEvent));
}
public void DoEvent()
{
reviveEvent.Invoke();
}
}
|