Beispiel #1
0
 void Update()
 {
     if (Input.GetAxisRaw("Jump") == 1 && Time.timeScale > 0)
     {
         m_shootingControlScript.Shoot();
     }
 }
Beispiel #2
0
 IEnumerator ShootInput()
 {
     while (true)
     {
         if (Input.GetAxis("Fire1") > 0 && canShoot)
         {
             shootControl.Shoot(Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, Camera.main.transform.position.z)));
         }
         yield return(null);
     }
 }
Beispiel #3
0
    void Update()
    {
        if (m_player == null || PlayerHealth.PlayerDead)
        {
            return;
        }

        if (IsPlayerInRange())
        {
            m_shootingControlScript.Shoot();
        }
    }
Beispiel #4
0
    private IEnumerator UpdateSpectrum()
    {
        yield return(null);

        while (this.enabled)
        {
            GetSpectrum();

            bangVolume = GetBangVolume();

            if (worldText != null)
            {
                worldText.text = (Mathf.Round(bangVolume * 10000) / 100f).ToString();
            }

            if (lineRendererClean != null)
            {
                DrawCleanLine(lineRendererClean, true);
            }

            if (bangIndicator != null)
            {
                Vector3 newBangPos = bangIndicator.transform.position;
                newBangPos.y = bangVolume * k;
                bangIndicator.transform.position = newBangPos;
            }

            if (bangVolume >= bangShootThreshold / k)
            {
                if (!isShooting)
                {
                    shootingControl.Shoot();
                }
                isShooting = true;
            }
            else
            {
                isShooting = false;
            }
            yield return(new WaitForSeconds(1f / updateRate));
        }
    }