using System; namespace Unity.Netcode { /// /// RPC delivery types /// public enum RpcDelivery { /// /// Reliable delivery /// Reliable = 0, /// /// Unreliable delivery /// Unreliable } /// /// Represents the common base class for Rpc attributes. /// public abstract class RpcAttribute : Attribute { /// /// Type of RPC delivery method /// public RpcDelivery Delivery = RpcDelivery.Reliable; } /// /// Marks a method as ServerRpc. /// A ServerRpc marked method will be fired by a client but executed on the server. /// [AttributeUsage(AttributeTargets.Method)] public class ServerRpcAttribute : RpcAttribute { /// /// Whether or not the ServerRpc should only be run if executed by the owner of the object /// public bool RequireOwnership = true; } /// /// Marks a method as ClientRpc. /// A ClientRpc marked method will be fired by the server but executed on clients. /// [AttributeUsage(AttributeTargets.Method)] public class ClientRpcAttribute : RpcAttribute { } }