示例#1
0
    void initKeyboard()
    {
        leftKeyboardstatus  = leftkeyboard.GetComponent <LeftKeyboard>();   //get status
        rightKeyboardstatus = rightkeyboard.GetComponent <RightKeyboard>(); //get status
        controller          = GetComponent <LeapMotionController>();        //get listener
        //mProvider = FindObjectOfType<LeapProvider>() as LeapProvider;
        inputText      = GameObject.Find("input").GetComponent <TextMesh>();
        inputText.text = "";
        hintsText      = GameObject.Find("hints").GetComponent <TextMesh>();
        hintsText.text = "";

        query_string = "";
        level        = 0;
        results      = new List <string>();
        translator   = new NumToStrList();

        only_right = true;

        cursor_down = false;
        select_down = false;
        backsapce   = false;
        left_slide  = false;
        right_slide = false;

        cur_pos = -1;

        Debug.Log("manager init");
    }
示例#2
0
    //---------------------------------------------------
    // Use this for initialization
    void Awake()
    {
#if SHOW_DEBUG_MESSAGES
        Debug.Log("LeapMotionControllerを実行");
#endif

        //  sceneにinstanceが存在するかを検査
        //  存在する場合,消滅させる。
        if (instance)
        {
            DestroyImmediate(gameObject);
            return;
        }

        //  このinstanceを唯一のobjectにする。
        instance = this;
    }
示例#3
0
        // Use this for initialization
        void Awake()
        {
            // Loop over each controller and hook up events to non-leap motion controllers
            // that occupy the same hands
            ControllerManager.Instance.ControllerAddedEvent += controller =>
            {
                // Ignore leap motion controllers
                if (controller is LeapMotionController)
                {
                    return;
                }

                // Get the correct leap controller
                LeapMotionController leapController = null;
                if (controller.Location == Left.Location)
                {
                    leapController = Left;
                }
                else if (controller.Location == Right.Location)
                {
                    leapController = Right;
                }

                // If there's a leap controller in the same location as another controller
                // make sure the leap controller is not showing when the other controller is enabled
                if (leapController != null)
                {
                    if (controller.InUse)
                    {
                        leapController.InUse = false;
                    }

                    // If the controller in the same hand as the leap controller is in use, make sure the leap controller is not in use.
                    // Conversely, if the controller is not in use make sure the leap controller is in use
                    controller.InUseChangedEvent += inUse => leapController.InUse = !inUse;
                }
            };
        }
 public void Awake()
 {
     instance = this;
 }