Skip to content

Commit a421788

Browse files
committed
More work on interface callbacks.
1 parent 4097e6d commit a421788

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

OSVR-Unity/Assets/OSVRUnity/src/InterfaceCallbacks.cs

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,31 @@ public class InterfaceCallbacks : MonoBehaviour
3232
public delegate void AnalogCallback(string source, float value);
3333
#endregion
3434

35-
void Start()
35+
#region Event methods
36+
public void Start()
3637
{
3738
if (null == iface)
3839
{
3940
iface = OSVR.Unity.ClientKit.instance.context.getInterface(path);
4041
}
4142
}
4243

43-
void OnDestroy()
44+
public void OnDestroy()
45+
{
46+
Stop();
47+
}
48+
49+
public void OnApplicationQuit()
50+
{
51+
Stop();
52+
}
53+
54+
#endregion
55+
56+
/// <summary>
57+
/// Used in the end-of-life method, this can also be called manually to free the internal interface.
58+
/// </summary>
59+
public void Stop()
4460
{
4561
iface = null;
4662
}

0 commit comments

Comments
 (0)