fix probe warp effect happening too much

This commit is contained in:
Mister_Nebula 2021-07-05 23:37:34 +01:00
parent 4871992116
commit 6adb0b2ffb
2 changed files with 12 additions and 20 deletions

View File

@ -56,10 +56,7 @@ namespace QSB.ProbeSync
private void OnWarpComplete()
{
DebugLog.DebugWrite($"OnWarpComplete");
gameObject.SetActive(false);
transform.localScale = Vector3.one;
_isRetrieving = false;
Deactivate();
}
public bool IsRetrieving()
@ -85,8 +82,6 @@ namespace QSB.ProbeSync
break;
}
DebugLog.DebugWrite($"LAUNCH!");
gameObject.SetActive(true);
transform.position = _owner.ProbeLauncher.transform.position;
transform.rotation = _owner.ProbeLauncher.transform.rotation;
@ -100,15 +95,9 @@ namespace QSB.ProbeSync
break;
}
DebugLog.DebugWrite($"ANCHOR!");
OnAnchorProbe();
break;
case ProbeEvent.Unanchor:
DebugLog.DebugWrite($"OnUnanchorProbe");
DebugLog.DebugWrite($"UNANCHOR!");
OnUnanchorProbe();
break;
case ProbeEvent.Retrieve:
@ -118,8 +107,6 @@ namespace QSB.ProbeSync
break;
}
DebugLog.DebugWrite($"RETRIEVE!");
OnRetrieveProbe();
break;
case ProbeEvent.Destroy:
@ -138,13 +125,18 @@ namespace QSB.ProbeSync
}
}
private void Deactivate()
{
transform.localScale = Vector3.one;
gameObject.SetActive(false);
_isRetrieving = false;
}
public void OnStartRetrieve(float duration)
{
DebugLog.DebugWrite($"OnStartRetrieving");
if (!_isRetrieving)
{
_isRetrieving = true;
DebugLog.DebugWrite($"start warp out");
_warpEffect.WarpObjectOut(duration);
if (OnStartRetrieveProbe == null)

View File

@ -90,7 +90,7 @@ namespace QSB.Tools
var newForwardSpotlight = forwardCamera.gameObject.AddComponent<QSBProbeSpotlight>();
newForwardSpotlight._id = oldForwardSpotlight.GetValue<ProbeCamera.ID>("_id");
newForwardSpotlight._fadeInLength = oldForwardSpotlight.GetValue<float>("_fadeInLength");
newForwardSpotlight._intensity = oldForwardSpotlight.GetValue<float>("_intensity");
newForwardSpotlight._intensity = 0.8f;
Object.Destroy(oldForwardSpotlight);
// CameraPivot/RotatingCameraPivot/RotatingCamera
@ -123,7 +123,7 @@ namespace QSB.Tools
newAmbLantern._fadeInCurve = oldAmbLantern.GetValue<AnimationCurve>("_fadeInCurve");
newAmbLantern._fadeOutCurve = oldAmbLantern.GetValue<AnimationCurve>("_fadeOutCurve");
newAmbLantern._emissiveRenderer = oldAmbLantern.GetValue<OWEmissiveRenderer>("_emissiveRenderer");
newAmbLantern._originalRange = oldAmbLantern.GetValue<float>("_originalRange");
newAmbLantern._originalRange = 60f;
Object.Destroy(oldAmbLantern);
// Lantern
@ -134,7 +134,7 @@ namespace QSB.Tools
newLantern._fadeInCurve = oldLantern.GetValue<AnimationCurve>("_fadeInCurve");
newLantern._fadeOutCurve = oldLantern.GetValue<AnimationCurve>("_fadeOutCurve");
newLantern._emissiveRenderer = oldLantern.GetValue<OWEmissiveRenderer>("_emissiveRenderer");
newLantern._originalRange = oldLantern.GetValue<float>("_originalRange");
newLantern._originalRange = 35f;
Object.Destroy(oldLantern);
// RearCamera
@ -149,7 +149,7 @@ namespace QSB.Tools
var newRearSpotlight = rearCamera.gameObject.AddComponent<QSBProbeSpotlight>();
newRearSpotlight._id = oldRearSpotlight.GetValue<ProbeCamera.ID>("_id");
newRearSpotlight._fadeInLength = oldRearSpotlight.GetValue<float>("_fadeInLength");
newRearSpotlight._intensity = oldRearSpotlight.GetValue<float>("_intensity");
newRearSpotlight._intensity = 0.8f;
Object.Destroy(oldRearSpotlight);
// PlaneOffsetMarker_Probe