invalid optimization test
This commit is contained in:
@@ -85,10 +85,23 @@ namespace BoneSync.Sync.Components
|
|||||||
public bool isStale => Time.realtimeSinceStartup - _lastSyncTime > 30f;
|
public bool isStale => Time.realtimeSinceStartup - _lastSyncTime > 30f;
|
||||||
public bool isOwner => _ownerId == BoneSync.lobby.GetLocalId();
|
public bool isOwner => _ownerId == BoneSync.lobby.GetLocalId();
|
||||||
|
|
||||||
public bool isValid => _GetIsValid();
|
public bool isValid
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (_isInvalidCached) return false;
|
||||||
|
bool valid = _GetIsValid();
|
||||||
|
if (valid) return true;
|
||||||
|
_isInvalidCached = true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private bool _isInvalidCached = false;
|
||||||
|
|
||||||
private bool _GetIsValid()
|
private bool _GetIsValid()
|
||||||
{
|
{
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (this == null) return false;
|
if (this == null) return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user