Hi,
I am probably missing something simple - My understanding with Raise Event is that the object raising the event and the one receiving it do not need to have a PhotonView component?
I am not 100% that this is correct... Here is how I am trying to set this up. Any help is appreciated.
This is the code I have on my receiving object:
void OnEnable()
{
PhotonNetwork.OnEventCall += this.OnEvent;
}
void OnDisable()
{
PhotonNetwork.OnEventCall -= this.OnEvent;
}
// handle custom events:
void OnEvent(byte eventcode, object content, int senderid)
{
Debug.Log("event"); // never fires
}
And the sending object:
// raise event
byte evCode = 0;
float tempVar = 1.0f;
float[] content = new float[] { tempVar };
bool reliable = true;
PhotonNetwork.RaiseEvent(evCode, content, reliable, null);
I am probably missing something simple - My understanding with Raise Event is that the object raising the event and the one receiving it do not need to have a PhotonView component?
I am not 100% that this is correct... Here is how I am trying to set this up. Any help is appreciated.
This is the code I have on my receiving object:
void OnEnable()
{
PhotonNetwork.OnEventCall += this.OnEvent;
}
void OnDisable()
{
PhotonNetwork.OnEventCall -= this.OnEvent;
}
// handle custom events:
void OnEvent(byte eventcode, object content, int senderid)
{
Debug.Log("event"); // never fires
}
And the sending object:
// raise event
byte evCode = 0;
float tempVar = 1.0f;
float[] content = new float[] { tempVar };
bool reliable = true;
PhotonNetwork.RaiseEvent(evCode, content, reliable, null);