static bool Prefix(Drillable __instance) { // Call the BetterDrillable.ManagedUpdate method var betterDrillable = __instance.GetComponent <BetterDrillable>(); betterDrillable.ManagedUpdate(); // Return out of original method. return(false); }
static bool Prefix(Drillable __instance) { // Call the BetterDrillable.HoverDrillable function var betterDrillable = __instance.GetComponent <BetterDrillable>(); betterDrillable.HoverDrillable(); // Return out of original method. return(false); }
static bool Prefix(Drillable __instance, Vector3 position, Exosuit exo, out GameObject hitObject) { // Call the BetterDrillable.OnDrill function var betterDrillable = __instance.GetComponent <BetterDrillable>(); betterDrillable.OnDrill(position, exo, out hitObject); // Return out of original method return(false); }
static bool Prefix(Drillable __instance) { if (Player.main.inSeamoth) { __instance.GetComponent <SeamothDrillable>().HoverDrillable(); return(false); } return(true); }
static bool Prefix(Drillable __instance) { if (Player.main.IsPilotingSeatruck()) { var seatruckDrillable = __instance.GetComponent <SeaTruckDrillable>(); seatruckDrillable.HoverDrillable(); return(false); } return(true); }
public void Update() { upgradeModels.SetActive(upgradeInstalled); if (!active) { return; } if (drilling) { if (!shark.fxControl.drillFX.isPlaying) { shark.fxControl.drillFX.Play(); } } else { if (shark.fxControl.drillFX.isPlaying) { shark.fxControl.drillFX.Stop(false, ParticleSystemStopBehavior.StopEmitting); } } drillTarget = null; GameObject target = null; Vector3 zero = Vector3.zero; UWE.Utils.TraceFPSTargetPosition(gameObject, 20f, ref target, ref zero); if (target == null) { InteractionVolumeUser user = Player.main.GetComponent <InteractionVolumeUser>(); if (user != null && user.GetMostRecent() != null) { target = user.GetMostRecent().gameObject; } } Drillable drillable = target.FindAncestor <Drillable>(); if (drillable) { drillTarget = drillable.GetComponent <SharkDrillable>(); HandReticle.main.SetInteractText(Language.main.GetFormat <string>("DrillResource", Language.main.Get(drillTarget.drill.primaryTooltip)), drillTarget.drill.secondaryTooltip, false, true, HandReticle.Hand.Left); HandReticle.main.SetIcon(HandReticle.IconType.Drill, 1f); float distToTarget = Vector3.Distance(shark.fxControl.drillFX.transform.parent.position, drillTarget.transform.position); ParticleSystem.EmissionModule em = shark.fxControl.drillFX.emission; em.rateOverTime = 200 * distToTarget; ParticleSystem.ShapeModule shape = shark.fxControl.drillFX.shape; shape.scale = new Vector3(0.3f, 0.3f, distToTarget); Vector3 targetVector = drillTarget.transform.position - shark.fxControl.drillFX.transform.parent.position; targetVector.Normalize(); shark.fxControl.drillFX.transform.localPosition = new Vector3(0f, 0f, distToTarget / 2f); shark.fxControl.drillFX.transform.parent.forward = targetVector; } else { ParticleSystem.EmissionModule em = shark.fxControl.drillFX.emission; em.rateOverTime = 4000; ParticleSystem.ShapeModule shape = shark.fxControl.drillFX.shape; shape.scale = new Vector3(0.3f, 0.3f, 20f); shark.fxControl.drillFX.transform.localPosition = new Vector3(0f, 0f, 10f); shark.fxControl.drillFX.transform.localEulerAngles = Vector3.zero; } }