Enums.cs 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. // ----------------------------------------------------------------------------
  2. // <copyright file="Enums.cs" company="Exit Games GmbH">
  3. // PhotonNetwork Framework for Unity - Copyright (C) 2018 Exit Games GmbH
  4. // </copyright>
  5. // <summary>
  6. // Wraps up several enumerations for PUN.
  7. // </summary>
  8. // <author>developer@exitgames.com</author>
  9. // ----------------------------------------------------------------------------
  10. namespace Photon.Pun
  11. {
  12. /// <summary>Which PhotonNetwork method was called to connect (which influences the regions we want pinged).</summary>
  13. /// <remarks>PhotonNetwork.ConnectUsingSettings will call either ConnectToMaster, ConnectToRegion or ConnectToBest, depending on the settings.</remarks>
  14. public enum ConnectMethod { NotCalled, ConnectToMaster, ConnectToRegion, ConnectToBest }
  15. /// <summary>Used to define the level of logging output created by the PUN classes. Either log errors, info (some more) or full.</summary>
  16. /// \ingroup publicApi
  17. public enum PunLogLevel
  18. {
  19. /// <summary>Show only errors. Minimal output. Note: Some might be "runtime errors" which you have to expect.</summary>
  20. ErrorsOnly,
  21. /// <summary>Logs some of the workflow, calls and results.</summary>
  22. Informational,
  23. /// <summary>Every available log call gets into the console/log. Only use for debugging.</summary>
  24. Full
  25. }
  26. /// <summary>Enum of "target" options for RPCs. These define which remote clients get your RPC call. </summary>
  27. /// \ingroup publicApi
  28. public enum RpcTarget
  29. {
  30. /// <summary>Sends the RPC to everyone else and executes it immediately on this client. Player who join later will not execute this RPC.</summary>
  31. All,
  32. /// <summary>Sends the RPC to everyone else. This client does not execute the RPC. Player who join later will not execute this RPC.</summary>
  33. Others,
  34. /// <summary>Sends the RPC to MasterClient only. Careful: The MasterClient might disconnect before it executes the RPC and that might cause dropped RPCs.</summary>
  35. MasterClient,
  36. /// <summary>Sends the RPC to everyone else and executes it immediately on this client. New players get the RPC when they join as it's buffered (until this client leaves).</summary>
  37. AllBuffered,
  38. /// <summary>Sends the RPC to everyone. This client does not execute the RPC. New players get the RPC when they join as it's buffered (until this client leaves).</summary>
  39. OthersBuffered,
  40. /// <summary>Sends the RPC to everyone (including this client) through the server.</summary>
  41. /// <remarks>
  42. /// This client executes the RPC like any other when it received it from the server.
  43. /// Benefit: The server's order of sending the RPCs is the same on all clients.
  44. /// </remarks>
  45. AllViaServer,
  46. /// <summary>Sends the RPC to everyone (including this client) through the server and buffers it for players joining later.</summary>
  47. /// <remarks>
  48. /// This client executes the RPC like any other when it received it from the server.
  49. /// Benefit: The server's order of sending the RPCs is the same on all clients.
  50. /// </remarks>
  51. AllBufferedViaServer
  52. }
  53. public enum ViewSynchronization { Off, ReliableDeltaCompressed, Unreliable, UnreliableOnChange }
  54. /// <summary>
  55. /// Options to define how Ownership Transfer is handled per PhotonView.
  56. /// </summary>
  57. /// <remarks>
  58. /// This setting affects how RequestOwnership and TransferOwnership work at runtime.
  59. /// </remarks>
  60. public enum OwnershipOption
  61. {
  62. /// <summary>
  63. /// Ownership is fixed. Instantiated objects stick with their creator, room objects always belong to the Master Client.
  64. /// </summary>
  65. Fixed,
  66. /// <summary>
  67. /// Ownership can be taken away from the current owner who can't object.
  68. /// </summary>
  69. Takeover,
  70. /// <summary>
  71. /// Ownership can be requested with PhotonView.RequestOwnership but the current owner has to agree to give up ownership.
  72. /// </summary>
  73. /// <remarks>The current owner has to implement IPunCallbacks.OnOwnershipRequest to react to the ownership request.</remarks>
  74. Request
  75. }
  76. }