Skip to main content
namespace ML.SDK
Class

MLSyncVarAttribute


namespace ML.SDK
{
class MLSyncVarAttribute
}

Inherits from Attribute

Summary

Makes an eligible field synchronized across all clients. An field value can synchronized if the field type is within the list ofrealizable types. A static field can be used as a global synchronized variable. A instance field will be only synchronized within the instance.

NOTE: A local synchronized variable can only defined inside a UnityEngine

A callback function name can be passed to the attribute which will be called when the variable value modified.The callback method requires to with in the same class where the field is defined. The callback method also requires to be static if the field is defined static, i.e. global.

The callback method behavior can be modified using

Supported types:

Constructors

ConstructorDescription
MLSyncVarAttribute(string, CallbackMethodBehavior)Creates a new Massive Loop Synchronized value attribute