diff --git a/plugin/src/MainGamePatch.cs b/plugin/src/MainGamePatch.cs index 4c7aeff..4f6956d 100644 --- a/plugin/src/MainGamePatch.cs +++ b/plugin/src/MainGamePatch.cs @@ -62,6 +62,7 @@ void Start() new SaveNotificationPatch(), new HudPatch(), new ProductionTerminalPatch(), + new OmniseekerPatch(), ]).ToArray(); Logger.LogDebug("Hello World!"); diff --git a/plugin/src/patch/main_game/ui/OmniseekerPatch.cs b/plugin/src/patch/main_game/ui/OmniseekerPatch.cs new file mode 100644 index 0000000..ca566aa --- /dev/null +++ b/plugin/src/patch/main_game/ui/OmniseekerPatch.cs @@ -0,0 +1,30 @@ +using TechtonicaVR.Input; +using TechtonicaVR.UI; +using UnityEngine; + +namespace TechtonicaVR.Patches.MainGame.UI; + +class OmniseekerPatch : GameComponentPatch + +{ + protected override bool Apply(OmniseekerUI component) + { + var tlc = component.transform; + if (tlc == null) + { + return false; + } + + var trackedCanvas = tlc.gameObject.AddComponent(); + trackedCanvas.hand = SteamVRInputMapper.rightHandObject.GetComponentInChildren()?.transform; + trackedCanvas.showDirection = (Vector3.forward + Vector3.left).normalized; + trackedCanvas.offset = new Vector3(0.08f, -0.03f, -0.1f); + trackedCanvas.showDistance = 0.3f; + trackedCanvas.rectTransform = tlc.GetChild(0).GetComponent(); + trackedCanvas.transformOverride = new Vector3(100, 450, 550); + + tlc.localScale = new Vector3(-0.1f, 0.1f, 0.1f); + + return true; + } +}