mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 03:19:23 +00:00
Mode switch handling, attempt two
This commit is contained in:
parent
66b448a2c3
commit
84b0de7065
13 changed files with 256 additions and 288 deletions
|
@ -89,8 +89,8 @@ namespace ml_lme
|
|||
OnTrackingModeChange(Settings.TrackingMode);
|
||||
OnRootAngleChange(Settings.RootAngle);
|
||||
|
||||
VRModeSwitchEvents.OnInitializeXR.AddListener(this.OnSwitchToVR);
|
||||
VRModeSwitchEvents.OnDeinitializeXR.AddListener(this.OnSwitchToDesktop);
|
||||
VRModeSwitchEvents.OnInitializeXR.AddListener(this.OnModeSwitch);
|
||||
VRModeSwitchEvents.OnDeinitializeXR.AddListener(this.OnModeSwitch);
|
||||
}
|
||||
|
||||
IEnumerator WaitForLocalPlayer()
|
||||
|
@ -141,8 +141,8 @@ namespace ml_lme
|
|||
Settings.HeadAttachChange -= this.OnHeadAttachChange;
|
||||
Settings.HeadOffsetChange -= this.OnHeadOffsetChange;
|
||||
|
||||
VRModeSwitchEvents.OnInitializeXR.RemoveListener(this.OnSwitchToVR);
|
||||
VRModeSwitchEvents.OnDeinitializeXR.RemoveListener(this.OnSwitchToDesktop);
|
||||
VRModeSwitchEvents.OnInitializeXR.RemoveListener(this.OnModeSwitch);
|
||||
VRModeSwitchEvents.OnDeinitializeXR.RemoveListener(this.OnModeSwitch);
|
||||
}
|
||||
|
||||
void Update()
|
||||
|
@ -270,14 +270,9 @@ namespace ml_lme
|
|||
OnHeadAttachChange(Settings.HeadAttach);
|
||||
}
|
||||
|
||||
void OnSwitchToVR()
|
||||
void OnModeSwitch()
|
||||
{
|
||||
m_inVR = true;
|
||||
OnHeadAttachChange(Settings.HeadAttach);
|
||||
}
|
||||
void OnSwitchToDesktop()
|
||||
{
|
||||
m_inVR = false;
|
||||
m_inVR = Utils.IsInVR();
|
||||
OnHeadAttachChange(Settings.HeadAttach);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue