示例#1
0
    public void Update()
    {
        if (loadingScene || usingSetting || intro.activeSelf)
        {
            return;
        }

        if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow))
        {
            selected.Up(ref selected);
        }
        else if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))
        {
            selected.Down(ref selected);
        }
        else if (Input.GetButtonDown("Submit"))
        {
            selected.Submit();
        }
    }
示例#2
0
    public void Update()
    {
        if (settingMenu.enabled)
        {
            return;
        }

        if ((transform.position - targetPos).sqrMagnitude >= 0.01f)
        {
            transform.position = Vector3.SmoothDamp(transform.position, targetPos, ref moveSpeed, smoothTime);
        }

        if (Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.UpArrow))
        {
            selected.Up(ref selected);
        }
        else if (Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.DownArrow))
        {
            selected.Down(ref selected);
        }
        else if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.LeftArrow))
        {
            selected.Left(ref selected);
        }
        else if (Input.GetKeyDown(KeyCode.D) || Input.GetKeyDown(KeyCode.RightArrow))
        {
            selected.Right(ref selected);
        }
        else if (Input.GetButtonDown("Submit"))
        {
            selected.Submit();
        }
        else if (Input.GetButtonDown("Cancel"))
        {
            settingMenu.Activate();
        }
    }