Пример #1
0
    //CLICK AND HOLD EMPTYING
    private void emptyTrash()
    {
        if (Input.GetMouseButton(0) && mouseover)
        {
            if (timeHeld > emptySpeed)
            {
                if (soundPlayed == false)
                {
                    GetComponent <AudioSource> ().Play();
                    soundPlayed = true;
                }
                full = false;
                anim.SetBool("trash full", false);
                anim.Play("Growing", -1, 0f);
                anim.Play("Growing HL", -1, 0f);

                lastEmpty = timer.GetTimeElapsed();
            }
            else
            {
                timeHeld += .02f;
            }
        }
        else
        {
            timeHeld    = 0;
            soundPlayed = false;
            if (!load.click)
            {
                load.stopLoading();
            }
        }
    }