|
static implicit | operator T (SyncVar< T > field) |
|
static implicit | operator SyncVar< T > (T value) |
|
|
virtual void | InvokeCallback (T oldValue, T newValue) |
|
|
virtual T | Value [get, set] |
|
Definition at line 27 of file SyncVar.cs.
◆ SyncVar()
Definition at line 93 of file SyncVar.cs.
94 {
95
96
97 if (this is SyncVar<GameObject>)
98 Debug.LogWarning($"Use explicit {nameof(SyncVarGameObject)} class instead of {nameof(SyncVar<T>)}<GameObject>. It stores netId internally for persistence.");
99
100 if (this is SyncVar<NetworkIdentity>)
101 Debug.LogWarning($"Use explicit {nameof(SyncVarNetworkIdentity)} class instead of {nameof(SyncVar<T>)}<NetworkIdentity>. It stores netId internally for persistence.");
102
103 if (this is SyncVar<NetworkBehaviour>)
104 Debug.LogWarning($"Use explicit SyncVarNetworkBehaviour class instead of {nameof(SyncVar<T>)}<NetworkBehaviour>. It stores netId internally for persistence.");
105
106 _Value = value;
107 }
◆ ClearChanges()
◆ OnDeserializeAll()
◆ OnDeserializeDelta()
◆ OnSerializeAll()
◆ OnSerializeDelta()
◆ Reset()
◆ Value
Definition at line 35 of file SyncVar.cs.
36 {
37 [MethodImpl(MethodImplOptions.AggressiveInlining)]
38 get => _Value;
39 set
40 {
41
42
43 if (!Equals(value))
44 {
45
46 T old = _Value;
47 _Value = value;
49
50
51
52
53
54 if (!hookGuard &&
55
56
57
58
59 NetworkClient.active)
60 {
61 hookGuard = true;
62 InvokeCallback(old, value);
63 hookGuard = false;
64 }
65 }
66 }
67 }
Action OnDirty
Used internally to set owner NetworkBehaviour's dirty mask bit when changed.
◆ Callback