Exemplo n.º 1
0
    IEnumerator fishReelProgress()
    {
        AudioSource reelSound = audioManager.GetSource("Reel");

        reelSound.volume = 0.1f;
        while (fishReelPercent < 100)
        {
            fishReelPercent = Mathf.RoundToInt(fishReelPercent + 2 * currentPowerLevel);
            yield return(null);

            playerAnimator.SetFloat("reelingPower", currentPowerLevel);
            if (currentPowerLevel > 0.05f)
            {
                if (!reelSound.isPlaying)
                {
                    reelSound.Play();
                }
            }
            else
            {
                reelSound.Stop();
            }
        }
        numFishCaught++;
        gameManager.WonboScore++;

        reelSound.Stop();
        while (fishBit > 0)
        {
            fishingPoleAnimator.SetFloat("fishBit", fishBit);
            fishBit = fishBit - animationSmooth;
            playerAnimator.SetFloat("reelingPower", animationReelingPower);
            animationReelingPower = animationReelingPower - animationSmooth;
            yield return(null);
        }
        audioManager.Play("Collect");
        currentPowerLevel = 0;
        Debug.Log("Fish caught! Total number of fish caught: " + numFishCaught);
        fishController.throwFish();
        yield return(new WaitForSeconds(1f));

        fishHooked = false;
        #region ANIMATE ICONS
        float i = 0;
        while (i < 1)
        {
            i = Mathf.Lerp(i, 1.1f, 0.1f);
            Color iconColor = fishIcons[numFishCaught - 1].color;
            iconColor.a = i;
            fishIcons[numFishCaught - 1].color      = iconColor;
            fishIconTransforms[numFishCaught].pivot = new Vector2(1 - i, 1);
            yield return(null);
        }
        #endregion
        StartCoroutine(waitForFish());
    }
Exemplo n.º 2
0
    IEnumerator fishReelProgress()
    {
        while (fishReelPercent < 100)
        {
            fishReelPercent = Mathf.RoundToInt(fishReelPercent + 5 * targetPowerLevel);
            yield return(new WaitForSeconds(0.1f));

            playerAnimator.SetFloat("reelingPower", 1);
        }
        numFishCaught++;
        gameManager.JiyeonScore++;

        while (fishBit > 0)
        {
            fishingPoleAnimator.SetFloat("fishBit", fishBit);
            fishBit = fishBit - animationSmooth;
            playerAnimator.SetFloat("reelingPower", animationReelingPower);
            animationReelingPower = animationReelingPower - animationSmooth;
            yield return(null);
        }
        Debug.Log("Ji-Yeon caught fish! Total number of fish caught: " + numFishCaught);
        fishController.throwFish();
        yield return(new WaitForSeconds(1f));

        fishHooked = false;

        #region ANIMATE ICONS
        float i = 0;
        while (i < 1)
        {
            i = Mathf.Lerp(i, 1.1f, 0.1f);
            Color iconColor = fishIcons[numFishCaught - 1].color;
            iconColor.a = i;
            fishIcons[numFishCaught - 1].color      = iconColor;
            fishIconTransforms[numFishCaught].pivot = new Vector2(i, 1);
            yield return(null);
        }
        #endregion
        //fishIcons[numFishCaught - 1].color = Color.white;
        StartCoroutine(waitForFish());
    }