-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): move crafting queue to left hand (#22)
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Plugin.Input; | ||
using TechtonicaVR.UI; | ||
using UnityEngine; | ||
|
||
namespace TechtonicaVR.Patches.MainGame.UI; | ||
|
||
class CraftingQueuePatch : GameComponentPatch<CraftingQueueGrid> | ||
|
||
{ | ||
protected override bool Apply(CraftingQueueGrid component) | ||
{ | ||
var tlc = component.gameObject.transform.parent; | ||
if (tlc == null) | ||
{ | ||
return false; | ||
} | ||
|
||
var trackedCanvas = tlc.gameObject.AddComponent<HandTrackedCanvas>(); | ||
trackedCanvas.hand = SteamVRInputMapper.leftHandObject.transform; | ||
trackedCanvas.showDirection = -Vector3.right; | ||
trackedCanvas.offset = new Vector3(-0.08f, 0.06f, -0.1f); | ||
trackedCanvas.showDistance = 0.3f; | ||
trackedCanvas.noTransform = true; | ||
tlc.localPosition = new Vector3(-17.7141f, 17.7794f, 0f); | ||
tlc.localScale = new Vector3(-0.1f, 0.1f, 0.1f); | ||
for (int i = 0; i < tlc.childCount; i++) | ||
{ | ||
tlc.GetChild(i).localPosition = Vector3.zero; | ||
} | ||
|
||
return true; | ||
} | ||
} |