Example #1
0
        void Start()
        {
            List <Controller> listOfControllers = new List <Controller>();

            listOfControllers.Add(new Controller());
            //listOfControllers.Add(new LeapmotionIntegration.ReceiverController("", 80));

            leap_controller_ = new LeapmotionIntegration.ConsolidatedController(listOfControllers);

            SetAlpha(0.0f);
        }
 /** 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)
     {
         if (leap_controller_.IsConnected)
         {
             leap_controller_.ClearPolicy(Controller.PolicyFlag.POLICY_OPTIMIZE_HMD);
         }
         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();
            }

            List <Controller> listOfControllers = new List <Controller>();

            listOfControllers.Add(new Controller());
            //listOfControllers.Add(new LeapmotionIntegration.ReceiverController("", 80));

            leap_controller_ = new LeapmotionIntegration.ConsolidatedController(listOfControllers);

            if (leap_controller_.IsConnected)
            {
                initializeFlags();
            }
            else
            {
                leap_controller_.Device += onHandControllerConnect;
            }
        }