Hi Guys, I'm using the OnDeath Event following the documentation
I can get the PhotonNetwork.LocalPlayer... that send the event (the attacker) but I want to know also the PhotonNetwork...(ID,Nickname ecc..) of the player who is death.....
What is the right way?
I can get the PhotonNetwork.LocalPlayer... that send the event (the attacker) but I want to know also the PhotonNetwork...(ID,Nickname ecc..) of the player who is death.....
What is the right way?
C#:
public class EventOnDeath : MonoBehaviour
{
public void Awake()
{
EventHandler.RegisterEvent<Vector3, Vector3, GameObject>(gameObject, "OnDeath", OnDeath);
}
private void OnDeath(Vector3 position, Vector3 force, GameObject attacker)
{
Debug.Log("Attacker Info: "+PhotonNetwork.LocalPlayer.NickName +" : "+PhotonNetwork.LocalPlayer.UserId);
Debug.Log("Death Info: "+PhotonNetwork.... +" : "+PhotonNetwork.....);
}
public void OnDestroy()
{
EventHandler.UnregisterEvent<Vector3, Vector3, GameObject>(gameObject, "OnDeath", OnDeath);
}
}