/** Calling this method stop the connection for the existing instance of a Controller, * clears old policy flags and resets to null */ protected void destroyController() { if (leap_controller_ != null) { leap_controller_.StopConnection(); leap_controller_ = null; } }
/** Create an instance of a Controller, initialize its policy flags * and subscribe to connection event */ protected void createController() { if (leap_controller_ != null) { destroyController(); } //leap_controller_ = new Controller(); leap_controller_ = FindObjectOfType <LeapSocketController>(); if (!leap_controller_.IsConnected) { leap_controller_.Device += onHandControllerConnect; } }