Cannot recognise certain types from the RaiseEvent documentation

Options
I am trying to implement and test some of the code of the RaiseEvent documentation, but for some reason my code does not recognize all of the types that are used in the documentation, even tho I am using Photon.Pun and Photon.Realtime in that code.

For example this code:
byte evCode = 1; // Custom Event 1: Used as "MoveUnitsToTargetPosition" event
object[] content = new object[] { new Vector3(10.0f, 2.0f, 5.0f), 1, 2, 5, 10 }; // Array contains the target position and the IDs of the selected units
RaiseEventOptions raiseEventOptions = new RaiseEventOptions { Receivers = ReceiverGroup.All }; // You would have to set the Receivers to All in order to receive this event on the local client as well
SendOptions sendOptions = new SendOptions { Reliability = true };
PhotonNetwork.RaiseEvent(evCode, content, raiseEventOptions, sendOptions);

It recognizes everything, except the SendOptions type.

Also, in the OnEvent callback handler, the documentation passes a variable of the EventData type, but that one is also not recognized.

Microsoft Visual Studio gives as a solution to add "using ExitGames.Client.Photon", is this the proper solution, or am I just doing something else wrong?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @JesseWeCan,

    Thank you for choosing Photon!
    Microsoft Visual Studio gives as a solution to add "using ExitGames.Client.Photon", is this the proper solution, or am I just doing something else wrong?
    Yes that's correct. You can trust Visual Studio or your IDE :smile:

    We will update the snippet on the documentation to avoid such issues in the future.

    Thank you for your understanding!