Exemplo n.º 1
0
    // キー取得
    void Update()
    {
        if (rKey)
        {
            if (Input.anyKeyDown && ctrlmode == 2)
            {
                Disp.text = jsr.ControlButtonKeys();
                rKey      = false;
                SetKey(Id);
                ctrlmode = 0;
            }
        }

        /* キーパッドでどこを選択しているかの表示したりするやつ
         * 決定ボタン( Playstation4 DualShock でいう □ボタンとしてる )
         * でUIのジャンプボタンを選択させ、
         * ジャンプボタン( Playstation4 DualShock でいう ×ボタン)
         * で選択を解除している。
         */
        if (KeyConfig.GetKeyDown("Submit"))
        {
            if (EventSystem.current.currentSelectedGameObject != null)
            {
                SelectedObj = EventSystem.current.currentSelectedGameObject;
            }
            EventSystem.current.SetSelectedGameObject(SelectedObj);
        }
        if (KeyConfig.GetKeyUp("Submit") || Input.GetMouseButtonUp(0))
        {
            ctrlmode = 2;
        }
        if (KeyConfig.GetKeyDown("Jump"))
        {
            EventSystem.current.SetSelectedGameObject(null);
            if (ctrlmode == 2)
            {
                ctrlmode = 0;
            }
        }
    }
Exemplo n.º 2
0
 /// <summary>
 /// 指定したキーが離されたかどうかを返す
 /// </summary>
 /// <returns>入力状態</returns>
 internal bool GetKeyUp(Key key)
 {
     return(keyConfig.GetKeyUp(key.String));
 }