fix _poolT on slave not updating smoothly and fix holograms not appearing

This commit is contained in:
Mister_Nebula 2021-03-28 19:08:18 +01:00
parent cac24fcc34
commit 86fa334020
2 changed files with 11 additions and 8 deletions

View File

@ -92,6 +92,7 @@ namespace QSB.PoolSync
_hologramGroup.SetActive(false); _hologramGroup.SetActive(false);
UpdateRendererFade(); UpdateRendererFade();
_transitionStone.SetActive(false); _transitionStone.SetActive(false);
_hologramGroup.transform.SetParent(null);
} }
private void Start() private void Start()
@ -258,7 +259,7 @@ namespace QSB.PoolSync
return; return;
} }
UpdatePoolRenderer(); UpdatePoolRenderer();
_slavePlatform._poolT = target; _slavePlatform._poolT = _poolT;
_slavePlatform.UpdatePoolRenderer(); _slavePlatform.UpdatePoolRenderer();
} }
@ -338,11 +339,6 @@ namespace QSB.PoolSync
DebugLog.ToConsole($"Error - Gameobject for {item.Key.PlayerId} in _playerToHologram is null!", MessageType.Error); DebugLog.ToConsole($"Error - Gameobject for {item.Key.PlayerId} in _playerToHologram is null!", MessageType.Error);
continue; continue;
} }
if (!item.Value.activeInHierarchy)
{
DebugLog.ToConsole($"Error - Gameobject for {item.Key.PlayerId} is inactive!", MessageType.Error);
continue;
}
var hologram = item.Value.transform.GetChild(0); var hologram = item.Value.transform.GetChild(0);
hologram.position = TransformPoint(item.Key.Body.transform.position, this, _slavePlatform); hologram.position = TransformPoint(item.Key.Body.transform.position, this, _slavePlatform);
hologram.rotation = TransformRotation(item.Key.Body.transform.rotation, this, _slavePlatform); hologram.rotation = TransformRotation(item.Key.Body.transform.rotation, this, _slavePlatform);
@ -400,7 +396,7 @@ namespace QSB.PoolSync
{ {
Debug.LogError("Shared stone with Remote Camera ID: " + _sharedStone.GetRemoteCameraID() + " has no registered camera platform!"); Debug.LogError("Shared stone with Remote Camera ID: " + _sharedStone.GetRemoteCameraID() + " has no registered camera platform!");
} }
if (_slavePlatform == this || !_slavePlatform.gameObject.activeInHierarchy) if (_slavePlatform == this || !_slavePlatform.gameObject.activeSelf)
{ {
_sharedStone = null; _sharedStone = null;
_slavePlatform = null; _slavePlatform = null;
@ -633,7 +629,7 @@ namespace QSB.PoolSync
return; return;
} }
var hologram = _playerToHologram.First(x => x.Key == player).Value; var hologram = _playerToHologram.First(x => x.Key == player).Value;
if (hologram.activeInHierarchy) if (hologram.activeSelf)
{ {
OnRemotePlayerExit(id); OnRemotePlayerExit(id);
} }
@ -690,6 +686,11 @@ namespace QSB.PoolSync
return; return;
} }
_playerToHologram[player].SetActive(false); _playerToHologram[player].SetActive(false);
if (!_anyoneStillOnPlatform)
{
_hologramGroup.SetActive(false);
}
} }
public enum CameraState public enum CameraState

View File

@ -8,6 +8,7 @@ using QSB.ItemSync;
using QSB.OrbSync; using QSB.OrbSync;
using QSB.Patches; using QSB.Patches;
using QSB.Player; using QSB.Player;
using QSB.PoolSync;
using QSB.QuantumSync; using QSB.QuantumSync;
using QSB.QuantumSync.WorldObjects; using QSB.QuantumSync.WorldObjects;
using QSB.SectorSync; using QSB.SectorSync;
@ -104,6 +105,7 @@ namespace QSB
gameObject.AddComponent<PlayerEntanglementWatcher>(); gameObject.AddComponent<PlayerEntanglementWatcher>();
gameObject.AddComponent<ItemManager>(); gameObject.AddComponent<ItemManager>();
gameObject.AddComponent<StatueManager>(); gameObject.AddComponent<StatueManager>();
gameObject.AddComponent<PoolManager>();
DebugBoxManager.Init(); DebugBoxManager.Init();