Skip to content

Commit

Permalink
Move expensive calls in VRControls (which might have caused a minor F…
Browse files Browse the repository at this point in the history
…PS drop when opening UI)
  • Loading branch information
RedBigz committed Nov 26, 2024
1 parent d6299a3 commit 433e924
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions TABGVR/Player/VRControls.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ public class VRControls : MonoBehaviour
private global::Player player;
private Transform rotationX;
private WeaponHandler weaponHandler;

private MenuTransitions menuTransitions;
private MapHandler mapHandler;

Check failure on line 44 in TABGVR/Player/VRControls.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'MapHandler' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 44 in TABGVR/Player/VRControls.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'MapHandler' could not be found (are you missing a using directive or an assembly reference?)

private void Start()
{
Expand All @@ -54,6 +57,9 @@ private void Start()
interactionHandler.canPickUpAction = pickup => currentPickup = pickup;

inputHandler.enabled = false;

menuTransitions = InventoryUI.instance.gameObject.GetComponent<MenuTransitions>();
mapHandler = InventoryUI.instance.gameObject.GetComponentInChildren<MapHandler>();
}

private void SwapWeaponViaOffset(int offset)
Expand Down Expand Up @@ -108,8 +114,6 @@ private void Update()
// Menu
if (menuButtonPressed && !_menuButtonPressed)
{
var menuTransitions = InventoryUI.instance.gameObject.GetComponent<MenuTransitions>();

switch (MenuState.CurrentMenuState)
{
case MenuState.TABGMenuState.Main:
Expand Down

0 comments on commit 433e924

Please sign in to comment.