Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        // shoot projectile
        if (Input.GetKeyDown(KeyCode.Space))
        {
            if (!rapidFire)
            {
                if (uiapi.GetSliderValue() == fireRate)
                {
                    //uiapi.IncEgg();
                    ProcessEggSpwan();
                }
            }
            else
            {
                //uiapi.IncEgg();
                ProcessEggSpwan();
            }
        }

        // rapid fire -- no wait for egg firing
        if (Input.GetKeyDown(KeyCode.R))
        {
            if (rapidFire)
            {
                rapidFire = false;
            }
            else
            {
                rapidFire = true;
            }
            uiapi.RapidFire(rapidFire);
        }
    }