Class SyncVar<T>
- Namespace
- AO
- Assembly
- CoreAssembly.dll
SyncVar allows you to keep variables in sync from the server to all clients.
public class SyncVar<T> : ISyncVar
Type Parameters
T
Supported types: int, float, bool, string, Vector2, Vector3, Vector4, Entity
- Inheritance
-
SyncVar<T>
- Implements
- Inherited Members
- Extension Methods
Constructors
SyncVar()
public SyncVar()
SyncVar(T)
public SyncVar(T value)
Parameters
value
T
Properties
Value
public T Value { get; }
Property Value
- T
Methods
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
OnNetworkSpawn_Internal(Entity, Component)
public void OnNetworkSpawn_Internal(Entity e, Component c)
Parameters
Set(T)
public void Set(T value)
Parameters
value
T
Set(T, bool)
Set the value of the SyncVar. This should only be called on the server.
public void Set(T value, bool forceSync = false)
Parameters
value
TValue to set the SyncVar to
forceSync
bool
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
Events
OnSync
public event Action<T, T> OnSync
Event Type
- Action<T, T>
Operators
operator ==(SyncVar<T>, SyncVar<T>)
public static bool operator ==(SyncVar<T> a, SyncVar<T> b)
Parameters
Returns
operator ==(SyncVar<T>, T)
public static bool operator ==(SyncVar<T> a, T b)
Parameters
a
SyncVar<T>b
T
Returns
operator ==(T, SyncVar<T>)
public static bool operator ==(T a, SyncVar<T> b)
Parameters
a
Tb
SyncVar<T>
Returns
implicit operator T(SyncVar<T>)
public static implicit operator T(SyncVar<T> syncVar)
Parameters
syncVar
SyncVar<T>
Returns
- T
operator !=(SyncVar<T>, SyncVar<T>)
public static bool operator !=(SyncVar<T> a, SyncVar<T> b)
Parameters
Returns
operator !=(SyncVar<T>, T)
public static bool operator !=(SyncVar<T> a, T b)
Parameters
a
SyncVar<T>b
T
Returns
operator !=(T, SyncVar<T>)
public static bool operator !=(T a, SyncVar<T> b)
Parameters
a
Tb
SyncVar<T>