Пример #1
0
    private void Update()
    {
        if (mainPlayerController.CheckIfInputEnabled())
        {
            GetMouseAim();

            if (chargeMetersHandler.CheckIfMinimumMagicValueReached())
            {
                if (Input.GetMouseButtonDown(0))
                {
                    launchArrowActive       = true;
                    currentLaunchArrowRatio = 0.1f;

                    SetArrowRendererPositions();
                }
                if (launchArrowActive)
                {
                    if (Input.GetMouseButton(0))
                    {
                        currentLaunchArrowRatio += Time.deltaTime * launchArrowGrowRate;
                        currentLaunchArrowRatio  = Mathf.Clamp(currentLaunchArrowRatio, 0.0f, 1.0f);

                        SetArrowRendererPositions();
                    }
                    if (Input.GetMouseButtonUp(0))
                    {
                        LaunchFromLaunchArrow();
                    }

                    if (Input.GetMouseButtonDown(1))
                    {
                        DisableLaunchArrowComponents();
                    }
                }
            }
            else if (launchArrowActive)
            {
                DisableLaunchArrowComponents();
            }
        }
    }
Пример #2
0
    void Update()
    {
        if (Application.isEditor && Input.GetKeyDown(KeyCode.Backslash))
        {
            SceneManager.LoadScene(SceneManager.GetActiveScene().name);
        }

        if (!(!isPaused && !mainPlayerController.CheckIfInputEnabled()))
        {
            if (Input.GetKeyDown(KeyCode.Escape))
            {
                OnPauseButtonDown();
            }
        }
    }