Class RpcAttribute
- Namespace
- Godot
- Assembly
- GodotSharp.dll
Attribute that changes the RPC mode for the annotated method
to the given Mode,
optionally specifying the TransferMode and TransferChannel (on supported peers).
See MultiplayerApi.RpcMode and MultiplayerPeer.TransferModeEnum.
By default, methods are not exposed to networking (and RPCs).
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class RpcAttribute : Attribute
- Inheritance
-
RpcAttribute
- Inherited Members
Constructors
RpcAttribute(RpcMode)
Constructs a RpcAttribute instance.
public RpcAttribute(MultiplayerApi.RpcMode mode = RpcMode.Authority)
Parameters
mode
MultiplayerApi.RpcModeThe RPC mode to use.
Properties
CallLocal
If the method will also be called locally; otherwise, it is only called remotely.
public bool CallLocal { get; init; }
Property Value
Mode
RPC mode for the annotated method.
public MultiplayerApi.RpcMode Mode { get; }
Property Value
TransferChannel
Transfer channel for the annotated mode.
public int TransferChannel { get; init; }
Property Value
TransferMode
Transfer mode for the annotated method.
public MultiplayerPeer.TransferModeEnum TransferMode { get; init; }