@@ -24,12 +24,29 @@ public enum RpcDelivery
2424 [ AttributeUsage ( AttributeTargets . Method ) ]
2525 public class RpcAttribute : Attribute
2626 {
27- // Must match the set of parameters below
27+ /// <summary>
28+ /// Parameters that define the behavior of an RPC attribute
29+ /// </summary>
2830 public struct RpcAttributeParams
2931 {
32+ /// <summary>
33+ /// Specifies the delivery method for the RPC
34+ /// </summary>
3035 public RpcDelivery Delivery ;
36+
37+ /// <summary>
38+ /// When true, only the owner of the object can execute this RPC
39+ /// </summary>
3140 public bool RequireOwnership ;
41+
42+ /// <summary>
43+ /// When true, local execution of the RPC is deferred until the next network tick
44+ /// </summary>
3245 public bool DeferLocal ;
46+
47+ /// <summary>
48+ /// When true, allows the RPC target to be overridden at runtime
49+ /// </summary>
3350 public bool AllowTargetOverride ;
3451 }
3552
@@ -38,10 +55,26 @@ public struct RpcAttributeParams
3855 /// Type of RPC delivery method
3956 /// </summary>
4057 public RpcDelivery Delivery = RpcDelivery . Reliable ;
58+
59+ /// <summary>
60+ /// When true, only the owner of the object can execute this RPC
61+ /// </summary>
4162 public bool RequireOwnership ;
63+
64+ /// <summary>
65+ /// When true, local execution of the RPC is deferred until the next network tick
66+ /// </summary>
4267 public bool DeferLocal ;
68+
69+ /// <summary>
70+ /// When true, allows the RPC target to be overridden at runtime
71+ /// </summary>
4372 public bool AllowTargetOverride ;
4473
74+ /// <summary>
75+ /// Initializes a new instance of the RpcAttribute with the specified target
76+ /// </summary>
77+ /// <param name="target">The target for this RPC</param>
4578 public RpcAttribute ( SendTo target )
4679 {
4780 }
@@ -60,8 +93,15 @@ private RpcAttribute()
6093 [ AttributeUsage ( AttributeTargets . Method ) ]
6194 public class ServerRpcAttribute : RpcAttribute
6295 {
96+ /// <summary>
97+ /// When true, only the owner of the NetworkObject can invoke this ServerRpc.
98+ /// This property overrides the base RpcAttribute.RequireOwnership.
99+ /// </summary>
63100 public new bool RequireOwnership ;
64101
102+ /// <summary>
103+ /// Initializes a new instance of ServerRpcAttribute that targets the server
104+ /// </summary>
65105 public ServerRpcAttribute ( ) : base ( SendTo . Server )
66106 {
67107
@@ -75,6 +115,9 @@ public ServerRpcAttribute() : base(SendTo.Server)
75115 [ AttributeUsage ( AttributeTargets . Method ) ]
76116 public class ClientRpcAttribute : RpcAttribute
77117 {
118+ /// <summary>
119+ /// Initializes a new instance of ClientRpcAttribute that targets all clients except the server
120+ /// </summary>
78121 public ClientRpcAttribute ( ) : base ( SendTo . NotServer )
79122 {
80123
0 commit comments