-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathSyncMethodAttribute.cs
More file actions
44 lines (36 loc) · 1.63 KB
/
Copy pathSyncMethodAttribute.cs
File metadata and controls
44 lines (36 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
namespace Multiplayer.API;
/// <summary>
/// An attribute that is used to mark methods for syncing.
/// The call will be replicated by the MPApi on all clients automatically.
/// </summary>
/// <example>
/// <para>An example showing how to mark a method for syncing.</para>
/// <code>
/// [SyncMethod]
/// public void MyMethod(...)
/// {
/// ...
/// }
/// </code>
/// </example>
[AttributeUsage(AttributeTargets.Method)]
public class SyncMethodAttribute : Attribute
{
public SyncContext context;
/// <summary>Instructs SyncMethod to cancel synchronization if any arg is null (see <see cref="ISyncMethod.CancelIfAnyArgNull"/>).</summary>
public bool cancelIfAnyArgNull = false;
/// <summary>Instructs SyncMethod to cancel synchronization if no map objects were selected during the call (see <see cref="ISyncMethod.CancelIfNoSelectedMapObjects"/>).</summary>
public bool cancelIfNoSelectedMapObjects = false;
/// <summary>Instructs SyncMethod to cancel synchronization if no world objects were selected during call replication(see <see cref="ISyncMethod.CancelIfNoSelectedWorldObjects"/>).</summary>
public bool cancelIfNoSelectedWorldObjects = false;
/// <summary>Instructs SyncMethod to synchronize only in debug mode (see <see cref="ISyncMethod.SetDebugOnly"/>).</summary>
public bool debugOnly = false;
/// <summary>A list of types to expose (see <see cref="ISyncMethod.ExposeParameter"/>)</summary>
public int[] exposeParameters;
/// <param name="context">Context</param>
public SyncMethodAttribute(SyncContext context = SyncContext.None)
{
this.context = context;
}
}