Beispiel #1
0
    void PocionComplete()
    {
        caldero.Play("win");
        audioSource.PlayOneShot(combiDone);
        Data.Instance.ui.HideTimer();
        //Events.FiguraComplete (figura.go.name);
        Events.OnMathGameComplete();
        //Data.Instance.levelsData.actualLevelPercent += levelBarStep;
        Data.Instance.levelsData.AddLevelPercent(levelBarStep);
        //colorBar.SetValue (Data.Instance.levelsData.actualLevelPercent);
        Data.Instance.ui.colorBar.SetValue(Data.Instance.levelsData.actualLevelPercent);

        foreach (GameObject go in slots)
        {
            Destroy(go);
        }
        slots.Clear();
        //Destroy (figuraGO);
        if (Data.Instance.levelsData.actualLevelPercent >= 1f)
        {
            colorDoneSign.SetActive(true);
            Events.OnColorComplete();
            //Data.Instance.figurasData.ResetFiguresDone ();
            Invoke("BackToWorld", 3);
        }
        else
        {
            doneSign.SetActive(true);
            Data.Instance.pocionesData.AddCurrentLevel();
            gamesPlayeds++;
            if (gamesPlayeds >= partidaGames)
            {
                AchievementsEvents.NewPointToAchievement(Achievement.types.POCIONES);
                Invoke("BackToWorld", 3);
            }
            else
            {
                Invoke("Init", 3);
            }
        }

        Events.SendData();
    }
Beispiel #2
0
    void Done(bool win)
    {
        Data.Instance.ui.HideTimer();
        fruitsManager.audioSource.PlayOneShot(ninjaDone);
        playing = false;
        Events.OnDragger(false);
        fruitsManager.Reset();
        fruitsManager.gameObject.SetActive(false);
        //Invoke ("CloseManager", 2);
        Game.Instance.ChangeMode(Game.modes.WORLD);
        Events.CloseFruitNinja(win);

        if (win)
        {
            interactiveObject.GetComponent <Door> ().SetState(Door.states.OPENING);
            AchievementsEvents.NewPointToAchievement(Achievement.types.FRUIT_NINJA_WIN);
        }

        fruitsManager.audioSource.PlayOneShot(glass);
    }
Beispiel #3
0
    void GrillaComplete()
    {
        brujo.Play("angry");
        audioSource.PlayOneShot(combiDone);
        Data.Instance.ui.HideTimer();
        //Events.FiguraComplete (figura.go.name);
        Events.OnMathGameComplete();
        //Data.Instance.levelsData.actualLevelPercent += levelBarStep;
        Data.Instance.levelsData.AddLevelPercent(levelBarStep);
        //colorBar.SetValue (Data.Instance.levelsData.actualLevelPercent);
        Data.Instance.ui.colorBar.SetValue(Data.Instance.levelsData.actualLevelPercent);

        //Destroy (figuraGO);
        if (Data.Instance.levelsData.actualLevelPercent >= 1f)
        {
            colorDoneSign.SetActive(true);
            Events.OnColorComplete();
            Invoke("BackToWorld", 3);
        }
        else
        {
            doneSign.SetActive(true);
            Data.Instance.grillaData.AddCurrentLevel();
            gamesPlayeds++;
            if (gamesPlayeds >= partidaGames)
            {
                AchievementsEvents.NewPointToAchievement(Achievement.types.GRILLA);
                Invoke("BackToWorld", 3);
            }
            else
            {
                brujo.Play("attack");
                Invoke("Init", 3);
            }
        }

        Events.SendData();
    }