Ejemplo n.º 1
0
    private IEnumerator Pixelate(int hintCase) //Try to use hint
    {
        if (StaticBehaviors.EnoughCoinsForHint(3))
        {
            MusicManager.instance.PlaySound("pixelate");

            float delay = animationSpeed / 0.2f / Mathf.Abs(arrayOfValues[hintCase] - arrayOfValues[hintCase + 1]);
            pixelateButton.interactable = false;

            for (int i = 1; i < 10; i++) //Animation of decreasing pixel grid
            {
                yield return(new WaitForSeconds(animationSpeed));

                SetPixelGrid(arrayOfValues[hintCase] - i);
            }

            for (int i = 1; i < Mathf.Abs(arrayOfValues[hintCase] - arrayOfValues[hintCase + 1]) + 10; i++) //Animation of encreasing pixel grid
            {
                yield return(new WaitForSeconds(delay));

                SetPixelGrid(arrayOfValues[hintCase] - 9 + i);
            }

            pixelateButton.interactable = hintCase == arrayOfValues.Length - 2 ? false : true; //Check is hint button should be disabled
            openedPics++;

            UIManager.HintEvent(3, null);
        }
    }
Ejemplo n.º 2
0
    private void TryToDraw()
    {
        if (tempPoint == Vector3.zero)
        {
            tempPoint = moveToPoint;
        }
        if (tempPoint != moveToPoint) //If there is new point to move
        {
            if (StaticBehaviors.EnoughCoinsForHint(5, false))
            {
                DrawOnMask();

                if (!spatula.activeSelf)
                {
                    spatula.SetActive(true);
                }
            }
        }
    }
Ejemplo n.º 3
0
 private void HitPlank(int number) //When the plank is clicked or shooted
 {
     if (StaticBehaviors.EnoughCoinsForHint(4))
     {
         GameObject currentPlank = planks[number];
         if (currentPlank.GetComponent <Image>().enabled)
         {
             currentPlank.GetComponent <Image>().enabled = false;
             planksOppened.Add(number);
             Destroy(Instantiate(puffPrefab, currentPlank.transform.position, Quaternion.identity, transform), 2); //Particles
             MusicManager.instance.PlaySound("shot");
         }
         else
         {
             MusicManager.instance.PlaySound("miss");
         }
         UIManager.HintEvent(4, planksOppened.ToArray());
     }
 }
Ejemplo n.º 4
0
    //Hints handler
    private void UseHint(int index)
    {
        if (StaticBehaviors.EnoughCoinsForHint(index))
        {
            switch (index)
            {
            case 0:
                StaticBehaviors.RevealOneLetter(letterFieldsList, letterList, LevelManager.rightAnswerList);
                break;

            case 1:
                StaticBehaviors.RemoveWrongLetters(letterFieldsList, letterList, LevelManager.rightAnswerList);
                break;

            case 2:
                StaticBehaviors.SolveTask(letterFieldsList, letterList, LevelManager.rightAnswerList);
                break;
            }
            HintEvent(index, null);
            hintsPopup.gameObject.SetActive(false);
        }
    }