using QSB.Player; using UnityEngine; using UnityEngine.PostProcessing; namespace QSB.Tools.ProbeTool { internal static class ProbeCreator { public static void CreateProbe(Transform newProbe, PlayerInfo player) { var qsbProbe = newProbe.gameObject.AddComponent(); player.Probe = qsbProbe; qsbProbe.SetOwner(player); // Probe_Body Object.Destroy(newProbe.GetComponent()); Object.Destroy(newProbe.GetComponent()); Object.Destroy(newProbe.GetComponent()); Object.Destroy(newProbe.GetComponent()); Object.Destroy(newProbe.GetComponent()); Object.Destroy(newProbe.GetComponent()); Object.Destroy(newProbe.GetComponent()); Object.Destroy(newProbe.GetComponent()); Object.Destroy(newProbe.GetComponent()); Object.Destroy(newProbe.GetComponent()); // ProbeDetector //Object.Destroy(newProbe.Find("ProbeDetector").gameObject); var probeDetector = newProbe.Find("ProbeDetector").gameObject; Object.Destroy(probeDetector.GetComponent()); Object.Destroy(probeDetector.GetComponent()); Object.Destroy(probeDetector.GetComponent()); // CameraPivot var cameraPivot = newProbe.Find("CameraPivot"); Object.Destroy(cameraPivot.GetComponent()); // TODO : Sync probe animations // CameraPivot/Geometry/Props_HEA_Probe_ANIM var animRoot = cameraPivot.Find("Geometry").Find("Props_HEA_Probe_ANIM"); Object.Destroy(animRoot.GetComponent()); Object.Destroy(animRoot.GetComponent()); // TODO : Set up QSB cameras for these two cameras - that's why im not just destroying the GOs here // CameraPivot/ForwardCamera var forwardCamera = cameraPivot.Find("ForwardCamera"); Object.Destroy(forwardCamera.GetComponent()); Object.Destroy(forwardCamera.GetComponent()); Object.Destroy(forwardCamera.GetComponent()); Object.Destroy(forwardCamera.GetComponent()); Object.Destroy(forwardCamera.GetComponent()); Object.Destroy(forwardCamera.GetComponent()); var oldForwardSpotlight = forwardCamera.GetComponent(); var newForwardSpotlight = forwardCamera.gameObject.AddComponent(); newForwardSpotlight._id = oldForwardSpotlight._id; newForwardSpotlight._fadeInLength = oldForwardSpotlight._fadeInLength; newForwardSpotlight._intensity = 0.8f; Object.Destroy(oldForwardSpotlight); // CameraPivot/RotatingCameraPivot/RotatingCamera var rotatingCamera = cameraPivot.Find("RotatingCameraPivot").Find("RotatingCamera"); Object.Destroy(rotatingCamera.GetComponent()); Object.Destroy(rotatingCamera.GetComponent()); Object.Destroy(rotatingCamera.GetComponent()); Object.Destroy(rotatingCamera.GetComponent()); Object.Destroy(rotatingCamera.GetComponent()); Object.Destroy(rotatingCamera.GetComponent()); // ProbeEffects var probeEffects = newProbe.Find("ProbeEffects"); var oldEffects = probeEffects.GetComponent(); var newEffects = probeEffects.gameObject.AddComponent(); newEffects._flightLoopAudio = oldEffects._flightLoopAudio; newEffects._anchorAudio = oldEffects._anchorAudio; newEffects._anchorParticles = oldEffects._anchorParticles; Object.Destroy(oldEffects); Object.Destroy(probeEffects.Find("CloudsEffectBubble").gameObject); Object.Destroy(probeEffects.Find("SandEffectBubble").gameObject); Object.Destroy(probeEffects.Find("ProbeElectricityEffect").gameObject); // AmbientLight_Probe var ambientLight = newProbe.Find("AmbientLight_Probe"); var oldAmbLantern = ambientLight.GetComponent(); var newAmbLantern = ambientLight.gameObject.AddComponent(); newAmbLantern._fadeInDuration = oldAmbLantern._fadeInDuration; newAmbLantern._fadeInCurve = oldAmbLantern._fadeInCurve; newAmbLantern._fadeOutCurve = oldAmbLantern._fadeOutCurve; newAmbLantern._emissiveRenderer = oldAmbLantern._emissiveRenderer; newAmbLantern._originalRange = 60f; Object.Destroy(oldAmbLantern); // Lantern var lantern = newProbe.Find("Lantern"); var oldLantern = lantern.GetComponent(); var newLantern = lantern.gameObject.AddComponent(); newLantern._fadeInDuration = oldLantern._fadeInDuration; newLantern._fadeInCurve = oldLantern._fadeInCurve; newLantern._fadeOutCurve = oldLantern._fadeOutCurve; newLantern._emissiveRenderer = oldLantern._emissiveRenderer; newLantern._originalRange = 35f; Object.Destroy(oldLantern); // RearCamera var rearCamera = newProbe.Find("RearCamera"); Object.Destroy(rearCamera.GetComponent()); Object.Destroy(rearCamera.GetComponent()); Object.Destroy(rearCamera.GetComponent()); Object.Destroy(rearCamera.GetComponent()); Object.Destroy(rearCamera.GetComponent()); Object.Destroy(rearCamera.GetComponent()); var oldRearSpotlight = rearCamera.GetComponent(); var newRearSpotlight = rearCamera.gameObject.AddComponent(); newRearSpotlight._id = oldRearSpotlight._id; newRearSpotlight._fadeInLength = oldRearSpotlight._fadeInLength; newRearSpotlight._intensity = 0.8f; Object.Destroy(oldRearSpotlight); // PlaneOffsetMarker_Probe Object.Destroy(newProbe.Find("PlaneOffsetMarker_Probe").gameObject); newProbe.Find("RecallEffect").gameObject.GetComponent().enabled = true; newProbe.Find("RecallEffect").gameObject.GetComponent().enabled = true; newProbe.Find("RecallEffect").name = "RemoteProbeRecallEffect"; newProbe.gameObject.SetActive(true); } } }