mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-17 01:13:05 +00:00
fix interference
This commit is contained in:
parent
5b10a570d7
commit
e49dd307f5
@ -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()
|
||||||
{
|
{
|
||||||
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user