From ad9f6b97bfc7db61e58ff189886e8cf6ff5eeeb1 Mon Sep 17 00:00:00 2001 From: "Theston E. Fox" Date: Tue, 31 Jan 2017 23:40:56 +0000 Subject: [PATCH] fix(Highlighters): ensure highlighter is turned off on disable When the interactable object is disabled, the highlighter should also be turned off otherwise when the object is re-enabled it still has the highlighted colour even if it's not being touched. --- .../Interactions/Highlighters/VRTK_BaseHighlighter.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Assets/VRTK/Scripts/Interactions/Highlighters/VRTK_BaseHighlighter.cs b/Assets/VRTK/Scripts/Interactions/Highlighters/VRTK_BaseHighlighter.cs index 340bd0603..6493eb447 100644 --- a/Assets/VRTK/Scripts/Interactions/Highlighters/VRTK_BaseHighlighter.cs +++ b/Assets/VRTK/Scripts/Interactions/Highlighters/VRTK_BaseHighlighter.cs @@ -87,5 +87,10 @@ public static VRTK_BaseHighlighter GetActiveHighlighter(GameObject obj) return objectHighlighter; } + + protected virtual void OnDisable() + { + Unhighlight(); + } } } \ No newline at end of file