mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-03-03 04:13:52 +00:00
tweak
This commit is contained in:
parent
0dce0c62be
commit
cd9db24dd8
@ -27,10 +27,10 @@ namespace QSB.ShipSync.TransformSync
|
||||
return Locator.GetShipBody();
|
||||
}
|
||||
|
||||
/// Dont do base... this is a replacement!
|
||||
protected override void ApplyToAttached()
|
||||
{
|
||||
ApplyToSector();
|
||||
// Dont do base... this is a replacement!
|
||||
|
||||
if (ReferenceTransform == null || transform.position == Vector3.zero)
|
||||
{
|
||||
|
@ -1,15 +1,12 @@
|
||||
using Mirror;
|
||||
using OWML.Common;
|
||||
using QSB.SectorSync;
|
||||
using QSB.SectorSync.WorldObjects;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
|
||||
namespace QSB.Syncs.Sectored
|
||||
{
|
||||
public abstract class BaseSectoredSync : SyncBase
|
||||
{
|
||||
protected override bool AllowDisabledAttachedObject => false;
|
||||
protected override bool AllowNullReferenceTransform => true;
|
||||
|
||||
public QSBSector ReferenceSector { get; private set; }
|
||||
@ -57,7 +54,6 @@ namespace QSB.Syncs.Sectored
|
||||
}
|
||||
else
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - {LogName} sector is null!", MessageType.Warning);
|
||||
_sectorId = -1;
|
||||
}
|
||||
}
|
||||
@ -66,7 +62,6 @@ namespace QSB.Syncs.Sectored
|
||||
{
|
||||
if (_sectorId == -1)
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - {LogName} sector is null!", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
using Mirror;
|
||||
using OWML.Common;
|
||||
using QSB.Utility;
|
||||
using UnityEngine;
|
||||
|
||||
@ -7,8 +6,6 @@ namespace QSB.Syncs.Sectored.Rigidbodies
|
||||
{
|
||||
public abstract class SectoredRigidbodySync : BaseSectoredSync
|
||||
{
|
||||
protected override bool DestroyAttachedObject => false;
|
||||
|
||||
private const float PositionMovedThreshold = 0.05f;
|
||||
private const float AngleRotatedThreshold = 0.05f;
|
||||
private const float VelocityChangeThreshold = 0.05f;
|
||||
|
@ -1,5 +1,4 @@
|
||||
using Mirror;
|
||||
using OWML.Common;
|
||||
using QSB.Utility;
|
||||
using UnityEngine;
|
||||
|
||||
@ -7,8 +6,6 @@ namespace QSB.Syncs.Sectored.Transforms
|
||||
{
|
||||
public abstract class SectoredTransformSync : BaseSectoredSync
|
||||
{
|
||||
protected override bool DestroyAttachedObject => true;
|
||||
|
||||
protected abstract Transform InitLocalTransform();
|
||||
protected abstract Transform InitRemoteTransform();
|
||||
|
||||
|
@ -49,9 +49,8 @@ namespace QSB.Syncs
|
||||
|
||||
protected abstract bool IsReady { get; }
|
||||
protected abstract bool UseInterpolation { get; }
|
||||
protected abstract bool AllowDisabledAttachedObject { get; }
|
||||
protected virtual bool AllowDisabledAttachedObject => false;
|
||||
protected abstract bool AllowNullReferenceTransform { get; }
|
||||
protected abstract bool DestroyAttachedObject { get; }
|
||||
protected virtual bool IsPlayerObject => false;
|
||||
protected virtual bool OnlyApplyOnDeserialize => false;
|
||||
|
||||
@ -91,7 +90,7 @@ namespace QSB.Syncs
|
||||
|
||||
protected virtual void OnDestroy()
|
||||
{
|
||||
if (DestroyAttachedObject && !hasAuthority && AttachedTransform != null)
|
||||
if (IsPlayerObject && !hasAuthority && AttachedTransform != null)
|
||||
{
|
||||
Destroy(AttachedTransform.gameObject);
|
||||
}
|
||||
@ -106,7 +105,7 @@ namespace QSB.Syncs
|
||||
DebugLog.ToConsole($"Error - {LogName} is being init-ed when not in the universe!", MessageType.Error);
|
||||
}
|
||||
|
||||
if (DestroyAttachedObject && !hasAuthority && AttachedTransform != null)
|
||||
if (IsPlayerObject && !hasAuthority && AttachedTransform != null)
|
||||
{
|
||||
Destroy(AttachedTransform.gameObject);
|
||||
}
|
||||
|
@ -2,8 +2,6 @@
|
||||
{
|
||||
public abstract class BaseUnsectoredSync : SyncBase
|
||||
{
|
||||
protected override bool AllowDisabledAttachedObject => false;
|
||||
protected override bool AllowNullReferenceTransform => false;
|
||||
protected override bool DestroyAttachedObject => false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user