/* Initialize All Members*/ public void Init(ASLAlphabetDetectedHandler letterCallback = null, ASLSimilarityDetectedHandler similarityCallback = null) { MyLeapListener listener; Leap.Controller controller; if (_instance != null) { listener = _instance.leapListener; controller = _instance.leapController; } else { listener = new MyLeapListener(); controller = new Leap.Controller(listener); } _instance = this; // Set-up the Listener leapListener = listener; leapController = controller; // Initialize Local Data letterHandler = letterCallback; similarityHandler = similarityCallback; lastLetterTime = DateTime.Now.Ticks; currentLetter = INVALID_ASL_LETTER; currentSimilarity = ASLTest.INVALID_ASL_TEST; lastResult = INVALID_ASL_LETTER; FirstPassInit(); SecondPassInit(); }
/* ========================= Initialize Data Members ============================ */ // Singleton Approach public static void Initialize(InputManager instance, ASLAlphabetDetectedHandler letterCallback = null, ASLSimilarityDetectedHandler similarityCallback = null) { // Initialize instance.Init(letterCallback, similarityCallback); }