File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -221,7 +221,8 @@ public bool CanClientRead(uint clientId)
221
221
public bool IsDirty ( )
222
222
{
223
223
if ( dirtyEvents . Count == 0 ) return false ;
224
- if ( NetworkingManager . singleton . NetworkTime - LastSyncedTime >= Settings . SendTickrate ) return true ;
224
+ if ( Settings . SendTickrate <= 0 ) return true ;
225
+ if ( NetworkingManager . singleton . NetworkTime - LastSyncedTime >= ( 1f / Settings . SendTickrate ) ) return true ;
225
226
return false ;
226
227
}
227
228
Original file line number Diff line number Diff line change @@ -51,7 +51,8 @@ public void ResetDirty()
51
51
public bool IsDirty ( )
52
52
{
53
53
if ( dirtyEvents . Count == 0 ) return false ;
54
- if ( NetworkingManager . singleton . NetworkTime - LastSyncedTime >= Settings . SendTickrate ) return true ;
54
+ if ( Settings . SendTickrate <= 0 ) return true ;
55
+ if ( NetworkingManager . singleton . NetworkTime - LastSyncedTime >= ( 1f / Settings . SendTickrate ) ) return true ;
55
56
return false ;
56
57
}
57
58
Original file line number Diff line number Diff line change @@ -70,7 +70,8 @@ public void ResetDirty()
70
70
public bool IsDirty ( )
71
71
{
72
72
if ( ! isDirty ) return false ;
73
- if ( NetworkingManager . singleton . NetworkTime - LastSyncedTime >= Settings . SendTickrate ) return true ;
73
+ if ( Settings . SendTickrate <= 0 ) return true ;
74
+ if ( NetworkingManager . singleton . NetworkTime - LastSyncedTime >= ( 1f / Settings . SendTickrate ) ) return true ;
74
75
return false ;
75
76
}
76
77
Original file line number Diff line number Diff line change @@ -25,7 +25,8 @@ public class NetworkedVarSettings
25
25
/// </summary>
26
26
public NetworkedVarPermissionsDelegate ReadPermissionCallback = null ;
27
27
/// <summary>
28
- /// The minimum amount of delay in seconds between sends
28
+ /// The maximum times per second this var will be synced.
29
+ /// Less than or equal to 0 will cause the variable to sync as soon as possible after being changed.
29
30
/// </summary>
30
31
public float SendTickrate = NetworkingManager . singleton . NetworkConfig . SendTickrate ;
31
32
/// <summary>
You can’t perform that action at this time.
0 commit comments