void Update()
    {
        if (useInitialAngle)
        {
            cannon.SetTargetWithAngle(targetCursor.transform.position, initialFireAngle);
        }
        else
        {
            cannon.SetTargetWithSpeed(targetCursor.transform.position, initialFireSpeed, useLowAngle);
        }

        if (Input.GetButtonDown("Fire1") && !EventSystem.current.IsPointerOverGameObject())
        {
            cannon.Fire();

            Text destroy = GameObject.Find("usedBomb").GetComponent <Text>();
            destroy.text = (int.Parse(destroy.text) - 1) + "";

            if ((int.Parse(destroy.text)) <= 0)
            {
                endGameScreen.SetActive(true);
                GameObject gamesatus = GameObject.Find("GameStatus");


                gamesatus.transform.position = new Vector3(endGameScreen.transform.position.x + 130, endGameScreen.transform.position.y + 200, 0);
                Time.timeScale = 0;
            }
        }

        timeOfFlightText.text = Mathf.Clamp(cannon.lastShotTimeOfFlight - (Time.time - cannon.lastShotTime), 0, float.MaxValue).ToString("F3");
    }
Beispiel #2
0
    void Update()
    {
        if (useInitialAngle)
        {
            cannon.SetTargetWithAngle(targetCursor.transform.position, initialFireAngle);
        }
        else
        {
            cannon.SetTargetWithSpeed(targetCursor.transform.position, initialFireSpeed, useLowAngle);
        }

        if (Input.GetButtonDown("Fire1") && !EventSystem.current.IsPointerOverGameObject())
        {
            cannon.Fire();
        }
    }
Beispiel #3
0
    void Update()
    {
        if (useInitialAngle)
        {
            cannon.SetTargetWithAngle(targetCursor.transform.position, initialFireAngle);
        }
        else
        {
            cannon.SetTargetWithSpeed(targetCursor.transform.position, initialFireSpeed, useLowAngle);
        }

        if (Input.GetButtonDown("Fire1") && !EventSystem.current.IsPointerOverGameObject())
        {
            cannon.Fire();
        }

        timeOfFlightText.text = Mathf.Clamp(cannon.lastShotTimeOfFlight - (Time.time - cannon.lastShotTime), 0, float.MaxValue).ToString("F3");
    }
    void Update()
    {
        for (int i = 0; i < PracticalPlayers; i++)
        {
            if (targetCursor[i] == null)
            {
                continue;
            }
            if (useInitialAngle)
            {
                cannon.SetTargetWithAngle(targetCursor[i].transform.position, initialFireAngle, i);
            }
            else
            {
                cannon.SetTargetWithSpeed(targetCursor[i].transform.position, initialFireSpeed, useLowAngle, i);
            }

            if (targetCursor[i].FireFlg)
            {
                if (timer.TimerFinishflg)
                {
                    gameController.AddPlayer(cannon.FireHuman(i));
                    targetCursor[i].FireFlg = false;
                    _slider_Background.gameObject.SetActive(false);
                    _slider_Fillarea.gameObject.SetActive(false);
                    DeleteCursor(i);
                }
            }
            // デバッグ用射出
            if (DebugModeGame.GetProperty().m_debugMode&& DebugModeGame.GetProperty().m_Injection > i)
            {
                if (Input.GetButtonDown("Injection_" + (i + 1).ToString()))
                {
                    gameController.AddPlayer(cannon.FireHuman(i));
                    targetCursor[i].FireFlg = false;
                    DeleteCursor(i);
                }
            }
        }
        //timeOfFlightText.text = Mathf.Clamp(cannon.lastShotTimeOfFlight - (Time.time - cannon.lastShotTime), 0, float.MaxValue).ToString("F3");
    }