예제 #1
0
    void GallerySelectInput()
    {
        int   size = DataBaseManager.GetObjectLength();
        float axis = (int)Input.GetAxis("LRArrow") + (int)Input.GetAxis("Horizontal");

        //左右移動
        if (axis != 0)
        {
            selectGravity += Time.deltaTime;
            if (!isArrowed)
            {
                //-1で左、1で右
                galleryselect += (int)axis;
                isArrowed      = true;
            }
            //1秒後にめっちゃ早く選ぶ
            if (selectGravity > 0.5f)
            {
                galleryselect += (int)axis;
            }
            if (galleryselect < 0)
            {
                galleryselect = 0;
            }
            if (galleryselect >= size)
            {
                galleryselect = size - 1;
            }
        }
        else
        {
            isArrowed     = false;
            selectGravity = 0;
        }
        if (Input.GetButtonDown("cross"))
        {
            mode = MODE.TITLE;
            canvas.HideImage();
        }
    }