mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
fix AMT compatability, fix error spam
Avatar Motion Tweaker looks for CheckVR bool instead of MetaPort. Only center & disable VRIK on avatar if it is not actively loading.
This commit is contained in:
parent
933913bb11
commit
68716a912d
1 changed files with 27 additions and 6 deletions
|
@ -79,12 +79,16 @@ public class DesktopVRSwitchHelper : MonoBehaviour
|
|||
public void LateUpdate()
|
||||
{
|
||||
if (!isAttemptingSwitch) return;
|
||||
BodySystem.TrackingEnabled = false;
|
||||
BodySystem.TrackingPositionWeight = 0f;
|
||||
PlayerSetup.Instance._avatar.transform.position = avatarWorldPos;
|
||||
PlayerSetup.Instance._avatar.transform.rotation = avatarWorldRot;
|
||||
MovementSystem.Instance.TeleportToPosRot(avatarWorldPos, avatarWorldRot, false);
|
||||
MovementSystem.Instance.UpdateColliderCenter(avatarWorldPos);
|
||||
|
||||
if (!PlayerSetup.Instance.avatarIsLoading && PlayerSetup.Instance._avatar != null)
|
||||
{
|
||||
BodySystem.TrackingEnabled = false;
|
||||
BodySystem.TrackingPositionWeight = 0f;
|
||||
PlayerSetup.Instance._avatar.transform.position = avatarWorldPos;
|
||||
PlayerSetup.Instance._avatar.transform.rotation = avatarWorldRot;
|
||||
MovementSystem.Instance.TeleportToPosRot(avatarWorldPos, avatarWorldRot, false);
|
||||
MovementSystem.Instance.UpdateColliderCenter(avatarWorldPos);
|
||||
}
|
||||
}
|
||||
|
||||
internal static IEnumerator AttemptPlatformSwitch(bool forceMode = false)
|
||||
|
@ -113,6 +117,7 @@ public class DesktopVRSwitchHelper : MonoBehaviour
|
|||
yield
|
||||
return new WaitForEndOfFrame();
|
||||
|
||||
SetCheckVR(VRMode);
|
||||
SetMetaPort(VRMode);
|
||||
|
||||
//reset rich presence
|
||||
|
@ -256,6 +261,22 @@ public class DesktopVRSwitchHelper : MonoBehaviour
|
|||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void SetCheckVR(bool isVR)
|
||||
{
|
||||
try
|
||||
{
|
||||
MelonLogger.Msg($"Set CheckVR hasVrDeviceLoaded to {isVR}.");
|
||||
CheckVR.Instance.hasVrDeviceLoaded = isVR;
|
||||
}
|
||||
catch
|
||||
{
|
||||
MelonLogger.Error("Setting CheckVR hasVrDeviceLoaded failed. Is CheckVR.Instance invalid?");
|
||||
MelonLogger.Msg("CheckVR.Instance: " + CheckVR.Instance);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
internal static void SetMetaPort(bool isVR)
|
||||
{
|
||||
try
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue