Minor fixes

This commit is contained in:
SDraw 2023-11-27 11:45:01 +03:00
parent aebf6c2c4e
commit 914bca26e4
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
14 changed files with 226 additions and 54 deletions

View file

@ -24,16 +24,6 @@ namespace ml_lme
bool m_gripLeft = false;
bool m_gripRight = false;
~LeapInput()
{
Settings.EnabledChange -= this.OnEnableChange;
Settings.InteractionChange -= this.OnInteractionChange;
Settings.GesturesChange -= this.OnGesturesChange;
Settings.FingersOnlyChange -= this.OnFingersOnlyChange;
MetaPort.Instance.settings.settingBoolChanged.RemoveListener(this.OnGameSettingBoolChange);
}
public override void ModuleAdded()
{
base.ModuleAdded();
@ -122,6 +112,34 @@ namespace ml_lme
m_lineRight.gameObject.layer = PlayerSetup.Instance.vrRayLeft.gameObject.layer;
}
public override void ModuleDestroyed()
{
base.ModuleDestroyed();
if(m_handRayLeft != null)
Object.Destroy(m_handRayLeft);
m_handRayLeft = null;
if(m_handRayRight != null)
Object.Destroy(m_handRayRight);
m_handRayRight = null;
if(m_lineLeft != null)
Object.Destroy(m_lineLeft);
m_lineLeft = null;
if(m_lineRight != null)
Object.Destroy(m_lineRight);
m_lineRight = null;
Settings.EnabledChange -= this.OnEnableChange;
Settings.InteractionChange -= this.OnInteractionChange;
Settings.GesturesChange -= this.OnGesturesChange;
Settings.FingersOnlyChange -= this.OnFingersOnlyChange;
MetaPort.Instance.settings.settingBoolChanged.RemoveListener(this.OnGameSettingBoolChange);
}
public override void UpdateInput()
{
if(base.InputEnabled)