Raise Event Question

Options
I'm sending an object array with multiple types (Vector3, int, byte, etc.) as the "content" when raising an event. Below is what I'm sending when I raise the event.

object[] eventContent = new object[] { (Vector3) this.position, this.hand.actor.photonView.viewID, (byte) this.hand.target, };

I know what information to expect the parameter to contain based on the event code. But I don't understand how I can parse that information out of the OnEvent content parameter. I would appreciate any help!

private void OnEvent (byte eventCode, object content, int senderId)

Best Answer

  • Nobrega
    Nobrega
    Answer ✓
    Options
    Nevermind, I figured it out.

    Just need to cast the content like below.

    object[] t = (object[]) content;

Answers

  • Nobrega
    Nobrega
    Answer ✓
    Options
    Nevermind, I figured it out.

    Just need to cast the content like below.

    object[] t = (object[]) content;