mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-26 18:35:34 +00:00
SyncBase: dont base.Update unless we also UpdateTransform
This commit is contained in:
parent
c4b771589b
commit
a5a3688a47
@ -129,21 +129,17 @@ namespace QSB.Syncs
|
|||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
DebugLog.ToConsole($"Exception when initializing {name} : {ex}", MessageType.Error);
|
DebugLog.ToConsole($"Exception when initializing {name} : {ex}", MessageType.Error);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
base.Update();
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
else if (_isInitialized && (!IsReady || !_baseIsReady))
|
else if (_isInitialized && (!IsReady || !_baseIsReady))
|
||||||
{
|
{
|
||||||
_isInitialized = false;
|
_isInitialized = false;
|
||||||
base.Update();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_isInitialized)
|
if (!_isInitialized)
|
||||||
{
|
{
|
||||||
base.Update();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,33 +147,27 @@ namespace QSB.Syncs
|
|||||||
{
|
{
|
||||||
DebugLog.ToConsole($"Warning - AttachedObject {LogName} is null.", MessageType.Warning);
|
DebugLog.ToConsole($"Warning - AttachedObject {LogName} is null.", MessageType.Warning);
|
||||||
_isInitialized = false;
|
_isInitialized = false;
|
||||||
base.Update();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!AttachedTransform.gameObject.activeInHierarchy && !IgnoreDisabledAttachedObject)
|
if (!AttachedTransform.gameObject.activeInHierarchy && !IgnoreDisabledAttachedObject)
|
||||||
{
|
{
|
||||||
base.Update();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (ReferenceTransform != null && ReferenceTransform.position == Vector3.zero && ReferenceTransform != Locator.GetRootTransform())
|
||||||
{
|
{
|
||||||
if (ReferenceTransform != null && ReferenceTransform.position == Vector3.zero && ReferenceTransform != Locator.GetRootTransform())
|
DebugLog.ToConsole($"Warning - {LogName}'s ReferenceTransform is at (0,0,0). ReferenceTransform:{ReferenceTransform.name}, AttachedObject:{AttachedTransform.name}", MessageType.Warning);
|
||||||
{
|
|
||||||
DebugLog.ToConsole($"Warning - {LogName}'s ReferenceTransform is at (0,0,0). ReferenceTransform:{ReferenceTransform.name}, AttachedObject:{AttachedTransform.name}", MessageType.Warning);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ReferenceTransform == Locator.GetRootTransform())
|
if (ReferenceTransform == Locator.GetRootTransform())
|
||||||
{
|
{
|
||||||
base.Update();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ReferenceTransform == null && !IgnoreNullReferenceTransform)
|
if (ReferenceTransform == null && !IgnoreNullReferenceTransform)
|
||||||
{
|
{
|
||||||
DebugLog.ToConsole($"Warning - {LogName}'s ReferenceTransform is null. AttachedObject:{AttachedTransform.name}", MessageType.Warning);
|
DebugLog.ToConsole($"Warning - {LogName}'s ReferenceTransform is null. AttachedObject:{AttachedTransform.name}", MessageType.Warning);
|
||||||
base.Update();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,7 +178,6 @@ namespace QSB.Syncs
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateTransform();
|
UpdateTransform();
|
||||||
|
|
||||||
base.Update();
|
base.Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user