コード例 #1
0
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.Escape))
        {
            PauseButton.SendMessage("OnClick");
        }

        if (Game.Instance.TimerActive == true && Game.Instance.IsGameActive())
        {
            touchingDown = Input.touchCount > 0 && Input.touches[0].phase == TouchPhase.Began;
            clickingDown = Input.GetMouseButtonDown(0);

            touchingUp = Input.touchCount > 0 && Input.touches[0].phase == TouchPhase.Ended;
            clickingUp = Input.GetMouseButtonUp(0);


            if (touchingDown || clickingDown)
            {
                if (tutorial.activeSelf == true && Time.timeSinceLevelLoad > 1)
                {
                    tutorial.SetActive(false);
                }
                GetFirstTouch(touchingDown);
            }
            else if ((touchingUp || clickingUp) && canShoot)
            {
                GetSecondTouch(touchingUp);
            }
        }
        else             // timer is pausing
        {
            canShoot = false;
        }
    }