Exemplo n.º 1
0
    private IEnumerator ReloadCoroutine()
    {
        DisplayText("Reloading...");

        if (handler.character.isNPC)
        {
            yield return(new WaitForSeconds(data.reloadTime));
        }
        else
        {
            handler.DownAnimation();
            yield return(new WaitForSeconds(data.reloadTime - handler.AnimationLength()));

            handler.UpAnimation();
            yield return(new WaitForSeconds(handler.AnimationLength()));
        }

        SetAmmo(data.clipSize);
        reloading = false;
    }