Skip to content

Commit b6330af

Browse files
committed
fix(Interaction): change event name to prevent overriding base method
The Interactable Object Unity Events script was declaring two events called `OnEnable` and `OnDisable` which were causing warnings as those names are also reserved for the `MonoBehaviour` methods.
1 parent ff285ba commit b6330af

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Assets/VRTK/Scripts/Utilities/UnityEvents/VRTK_InteractableObject_UnityEvents.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public sealed class VRTK_InteractableObject_UnityEvents : VRTK_UnityEvents<VRTK_
1010
[Serializable]
1111
public sealed class InteractableObjectEvent : UnityEvent<object, InteractableObjectEventArgs> { }
1212

13-
public InteractableObjectEvent OnEnable = new InteractableObjectEvent();
14-
public InteractableObjectEvent OnDisable = new InteractableObjectEvent();
13+
public InteractableObjectEvent OnObjectEnable = new InteractableObjectEvent();
14+
public InteractableObjectEvent OnObjectDisable = new InteractableObjectEvent();
1515

1616
public InteractableObjectEvent OnTouch = new InteractableObjectEvent();
1717
public InteractableObjectEvent OnUntouch = new InteractableObjectEvent();
@@ -69,12 +69,12 @@ protected override void RemoveListeners(VRTK_InteractableObject component)
6969

7070
private void Enable(object o, InteractableObjectEventArgs e)
7171
{
72-
OnEnable.Invoke(o, e);
72+
OnObjectEnable.Invoke(o, e);
7373
}
7474

7575
private void Disable(object o, InteractableObjectEventArgs e)
7676
{
77-
OnDisable.Invoke(o, e);
77+
OnObjectDisable.Invoke(o, e);
7878
}
7979

8080
private void Touch(object o, InteractableObjectEventArgs e)

0 commit comments

Comments
 (0)