mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-01 03:32:38 +00:00
fix hiding players
This commit is contained in:
parent
810485c77c
commit
9e242219da
@ -122,7 +122,12 @@ namespace QSB.Player
|
||||
public static void ChangePlayerVisibility(uint playerId, bool visible)
|
||||
{
|
||||
var player = GetPlayer(playerId);
|
||||
foreach (var renderer in player.Body.GetComponents<Renderer>())
|
||||
if (player.Body == null)
|
||||
{
|
||||
DebugLog.ToConsole($"Warning - Player {playerId} has a null body!", MessageType.Warning);
|
||||
return;
|
||||
}
|
||||
foreach (var renderer in player.Body.GetComponentsInChildren<Renderer>())
|
||||
{
|
||||
renderer.enabled = visible;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
using QSB.Events;
|
||||
using QSB.Patches;
|
||||
using QSB.Utility;
|
||||
using QSB.Player;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.StatueSync.Patches
|
||||
@ -17,6 +17,10 @@ namespace QSB.StatueSync.Patches
|
||||
|
||||
public static bool Statue_Update(bool ____waitForPlayerGrounded)
|
||||
{
|
||||
if (StatueManager.Instance.HasStartedStatueLocally)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (!____waitForPlayerGrounded || !Locator.GetPlayerController().IsGrounded())
|
||||
{
|
||||
return true;
|
||||
@ -28,6 +32,7 @@ namespace QSB.StatueSync.Patches
|
||||
timberHearth.InverseTransformPoint(playerBody.position),
|
||||
Quaternion.Inverse(timberHearth.rotation) * playerBody.rotation,
|
||||
Locator.GetPlayerCamera().GetComponent<PlayerCameraController>().GetDegreesY());
|
||||
QSBPlayerManager.HideAllPlayers();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ namespace QSB.StatueSync
|
||||
internal class StatueManager : MonoBehaviour
|
||||
{
|
||||
public static StatueManager Instance { get; private set; }
|
||||
public bool HasStartedStatueLocally;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
@ -22,6 +23,7 @@ namespace QSB.StatueSync
|
||||
|
||||
private IEnumerator BeginRemoteUplinkSequence(Vector3 position, Quaternion rotation, float cameraDegrees)
|
||||
{
|
||||
HasStartedStatueLocally = true;
|
||||
var cameraEffectController = Locator.GetPlayerCamera().GetComponent<PlayerCameraEffectController>();
|
||||
cameraEffectController.CloseEyes(0.5f);
|
||||
OWInput.ChangeInputMode(InputMode.None);
|
||||
|
Loading…
Reference in New Issue
Block a user