Skip to main content

Class ServerAttribute

Prevents a method from running if server is not active. Can only be used inside a NetworkBehaviour

Inheritance
System.Object
System.Attribute
Inherited Members
Show
Syntax
[AttributeUsage(AttributeTargets.Method)]
public class ServerAttribute : Attribute, _Attribute

Fields

error

If true, when the method is called from a client, it throws an error If false, no error is thrown, but the method won't execute useful for unity built in methods such as Await, Update, Start, etc.

Declaration
public bool error