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

View File

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