mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
tweaks to head turn
This commit is contained in:
parent
a8cd7122a8
commit
ff70ae9652
6 changed files with 39 additions and 32 deletions
|
@ -30,14 +30,16 @@ public class MainMenuHelper : MonoBehaviour
|
|||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (MenuIsOpen)
|
||||
if (!MenuIsOpen) return;
|
||||
|
||||
if (MSP_MenuInfo.PlayerAnchorMenus || NeedsPositionUpdate)
|
||||
{
|
||||
if (MSP_MenuInfo.UseIndependentHeadTurn)
|
||||
MSP_MenuInfo.HandleIndependentLookInput();
|
||||
if (MSP_MenuInfo.PlayerAnchorMenus)
|
||||
UpdateMenuPosition();
|
||||
if (NeedsPositionUpdate)
|
||||
UpdateMenuPosition();
|
||||
UpdateMenuPosition();
|
||||
}
|
||||
|
||||
if (MSP_MenuInfo.UseIndependentHeadTurn)
|
||||
{
|
||||
MSP_MenuInfo.HandleIndependentLookInput();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,13 +66,13 @@ public class MainMenuHelper : MonoBehaviour
|
|||
}
|
||||
else
|
||||
{
|
||||
worldAnchor.eulerAngles = MSP_MenuInfo.CameraTransform.eulerAngles;
|
||||
worldAnchor.rotation = MSP_MenuInfo.CameraTransform.rotation;
|
||||
}
|
||||
worldAnchor.position = MSP_MenuInfo.CameraTransform.position + MSP_MenuInfo.CameraTransform.forward * 2f * MSP_MenuInfo.ScaleFactor;
|
||||
}
|
||||
else
|
||||
{
|
||||
worldAnchor.eulerAngles = MSP_MenuInfo.CameraTransform.eulerAngles;
|
||||
worldAnchor.rotation = MSP_MenuInfo.CameraTransform.rotation;
|
||||
worldAnchor.position = MSP_MenuInfo.CameraTransform.position;
|
||||
}
|
||||
if (updateMenuPos) UpdateMenuPosition();
|
||||
|
@ -93,8 +95,8 @@ public class MainMenuHelper : MonoBehaviour
|
|||
if (MSP_MenuInfo.CameraTransform == null || MSP_MenuInfo.DisableMMHelper) return;
|
||||
Transform activeAnchor = MSP_MenuInfo.independentHeadTurn ? worldAnchor : MSP_MenuInfo.CameraTransform;
|
||||
transform.localScale = new Vector3(1.6f * MSP_MenuInfo.ScaleFactor, 0.9f * MSP_MenuInfo.ScaleFactor, 1f);
|
||||
transform.eulerAngles = activeAnchor.eulerAngles;
|
||||
transform.position = activeAnchor.position + activeAnchor.forward * 1f * MSP_MenuInfo.ScaleFactor * MSP_MenuInfo.AspectRatio;
|
||||
transform.rotation = activeAnchor.rotation;
|
||||
}
|
||||
|
||||
//VR Main Menu
|
||||
|
@ -103,6 +105,6 @@ public class MainMenuHelper : MonoBehaviour
|
|||
if (worldAnchor == null || MSP_MenuInfo.DisableMMHelper_VR) return;
|
||||
transform.localScale = new Vector3(1.6f * MSP_MenuInfo.ScaleFactor * 1.8f, 0.9f * MSP_MenuInfo.ScaleFactor * 1.8f, 1f);
|
||||
transform.position = worldAnchor.position;
|
||||
transform.eulerAngles = worldAnchor.eulerAngles;
|
||||
transform.rotation = worldAnchor.rotation;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,14 +28,16 @@ public class QuickMenuHelper : MonoBehaviour
|
|||
|
||||
void LateUpdate()
|
||||
{
|
||||
if (MenuIsOpen)
|
||||
if (!MenuIsOpen) return;
|
||||
|
||||
if (MSP_MenuInfo.PlayerAnchorMenus || NeedsPositionUpdate || MetaPort.Instance.isUsingVr)
|
||||
{
|
||||
if (MSP_MenuInfo.UseIndependentHeadTurn)
|
||||
MSP_MenuInfo.HandleIndependentLookInput();
|
||||
if (MSP_MenuInfo.PlayerAnchorMenus || MetaPort.Instance.isUsingVr)
|
||||
UpdateMenuPosition();
|
||||
if (NeedsPositionUpdate)
|
||||
UpdateMenuPosition();
|
||||
UpdateMenuPosition();
|
||||
}
|
||||
|
||||
if (MSP_MenuInfo.UseIndependentHeadTurn)
|
||||
{
|
||||
MSP_MenuInfo.HandleIndependentLookInput();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -51,7 +53,8 @@ public class QuickMenuHelper : MonoBehaviour
|
|||
public void UpdateWorldAnchors(bool updateMenuPos = false)
|
||||
{
|
||||
if (worldAnchor == null || MSP_MenuInfo.CameraTransform == null) return;
|
||||
worldAnchor.eulerAngles = MSP_MenuInfo.CameraTransform.eulerAngles;
|
||||
|
||||
worldAnchor.rotation = MSP_MenuInfo.CameraTransform.rotation;
|
||||
worldAnchor.position = MSP_MenuInfo.CameraTransform.position;
|
||||
if (updateMenuPos) UpdateMenuPosition();
|
||||
}
|
||||
|
@ -74,7 +77,7 @@ public class QuickMenuHelper : MonoBehaviour
|
|||
|
||||
Transform activeAnchor = MSP_MenuInfo.independentHeadTurn ? worldAnchor : MSP_MenuInfo.CameraTransform;
|
||||
transform.localScale = new Vector3(1f * MSP_MenuInfo.ScaleFactor, 1f * MSP_MenuInfo.ScaleFactor, 1f);
|
||||
transform.eulerAngles = activeAnchor.eulerAngles;
|
||||
transform.rotation = activeAnchor.rotation;
|
||||
transform.position = activeAnchor.position + activeAnchor.transform.forward * 1f * MSP_MenuInfo.ScaleFactor;
|
||||
}
|
||||
|
||||
|
@ -86,8 +89,8 @@ public class QuickMenuHelper : MonoBehaviour
|
|||
if (MSP_MenuInfo.WorldAnchorQM)
|
||||
{
|
||||
transform.localScale = new Vector3(1f * MSP_MenuInfo.ScaleFactor, 1f * MSP_MenuInfo.ScaleFactor, 1f);
|
||||
transform.eulerAngles = worldAnchor.eulerAngles;
|
||||
transform.position = worldAnchor.position + worldAnchor.transform.forward * 1f * MSP_MenuInfo.ScaleFactor;
|
||||
transform.rotation = worldAnchor.rotation;
|
||||
return;
|
||||
}
|
||||
transform.localScale = new Vector3(1f * MSP_MenuInfo.ScaleFactor, 1f * MSP_MenuInfo.ScaleFactor, 1f);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue