fix interference

This commit is contained in:
_nebula 2023-01-23 20:13:55 +00:00
parent 5b10a570d7
commit e49dd307f5
2 changed files with 10 additions and 11 deletions

View File

@ -1,4 +1,5 @@
using UnityEngine; using QSB.Player;
using UnityEngine;
namespace QSB.Tools.ProbeTool; namespace QSB.Tools.ProbeTool;
@ -15,8 +16,8 @@ public class QSBProbeCamera : MonoBehaviour
private Quaternion _origLocalRotation; private Quaternion _origLocalRotation;
private Quaternion _origParentLocalRotation; private Quaternion _origParentLocalRotation;
private Vector2 _cameraRotation = Vector2.zero; private Vector2 _cameraRotation = Vector2.zero;
private QuantumMoon _quantumMoon;
private SandLevelController _sandLevelController; private SandLevelController _sandLevelController;
private PlayerInfo owner;
public event ProbeCamera.RotateCameraEvent OnRotateCamera; public event ProbeCamera.RotateCameraEvent OnRotateCamera;
@ -33,11 +34,8 @@ public class QSBProbeCamera : MonoBehaviour
private void Start() private void Start()
{ {
var astroObject = Locator.GetAstroObject(AstroObject.Name.QuantumMoon); var probe = GetComponentInParent<QSBSurveyorProbe>();
if (astroObject != null) owner = probe.GetOwner();
{
_quantumMoon = astroObject.GetComponent<QuantumMoon>();
}
} }
public static OWCamera GetLastSnapshotCamera() => public static OWCamera GetLastSnapshotCamera() =>
@ -53,10 +51,9 @@ public class QSBProbeCamera : MonoBehaviour
=> _sandLevelController = sandLevelController; => _sandLevelController = sandLevelController;
public bool HasInterference() => public bool HasInterference() =>
_id != ProbeCamera.ID.PreLaunch (_id != ProbeCamera.ID.PreLaunch && owner.IsInMoon != owner.Probe.InsideQuantumMoon)
//&& ((this._quantumMoon != null && this._quantumMoon.IsPlayerInside() != this._quantumMoon.IsProbeInside()) || (_sandLevelController != null && _sandLevelController.IsPointBuried(transform.position))
|| (_sandLevelController != null && _sandLevelController.IsPointBuried(transform.position)); || (Locator.GetCloakFieldController() != null && owner.IsInCloak != owner.Probe.InsideCloak);
//|| (Locator.GetCloakFieldController() != null && Locator.GetCloakFieldController().isPlayerInsideCloak != Locator.GetCloakFieldController().isProbeInsideCloak));
public RenderTexture TakeSnapshot() public RenderTexture TakeSnapshot()
{ {

View File

@ -116,6 +116,8 @@ public class QSBSurveyorProbe : MonoBehaviour, ILightSource
_owner = player; _owner = player;
} }
public PlayerInfo GetOwner() => _owner;
private void OnWarpComplete() => Deactivate(); private void OnWarpComplete() => Deactivate();
public bool IsRetrieving() public bool IsRetrieving()