Пример #1
0
    IEnumerator WaitingPortal()
    {
        CharacterManager.Instance.FreezeAll();
        CharacterManager.Instance.BecomeInmortal(true);
        //Salvo
        posToShow = CollectablesManager.setCollectable(TypeLevel);

        GetComponent <SpriteRenderer>().enabled = false;
        for (int i = 0; i < transform.childCount; ++i)
        {
            transform.GetChild(i).gameObject.SetActive(false);
        }

        yield return(StartCoroutine(new TimeCallBacks().WaitPause(timeToShowNextStep)));

        collectable_UI.onFinish += FinishGivePiece;
        if (posToShow >= 0)
        {
            collectable_UI.SetCollect(posToShow);
        }
        else
        {
            collectable_UI.SetCollect(0);
        }

        float timer = CounterTimerPlay.Instance.EndTime();

        SaveManager.Instance.AddPlayTime(timer);
        ManagerAnalytics.MissionCompleted(Application.loadedLevelName,
                                          false, timer, 0, false);


        //Precargo la escena de video
        //    LoadLevelManager.Instance.LoadLevel(Application.loadedLevelName + "_Video", ThreadPriority.Low, true);
    }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (ReInput.players.GetPlayer(0).GetButtonDown(InputEnum.GetInputString(CombinationKeys[currentKey])) && !firstUnlock)
        {
            ++currentNumberOfTimePress;
            if (currentNumberOfTimePress >= numberOfTimePress)
            {
                ++currentKey;
                if (currentKey >= CombinationKeys.Length)
                {
                    SaveManager.Instance.dataKlaus.isNewGame          = false;
                    SaveManager.Instance.dataKlaus.isArcadeModeUnlock = true;
                    buttonUnlock.interactable    = true;
                    arcadePopUp.canChangeSection = true;
                    currentKey  = 0;
                    firstUnlock = true;
                    Debug.LogError("Unlocked ArcdeMode");
                }
            }
            StopCoroutine("ResetAll");
            StartCoroutine("ResetAll", timeToNotPress);
        }
        if (ReInput.players.GetPlayer(0).GetButtonDown(InputEnum.GetInputString(CombinationKeysTrophy[currentKey2])) && !secondUnlock)
        {
            ++currentNumberOfTimePress2;
            if (currentNumberOfTimePress2 >= numberOfTimePress)
            {
                ++currentKey2;
                if (currentKey2 >= CombinationKeysTrophy.Length)
                {
                    for (int i = 0; i < buttonsUnlocks2.Length; ++i)
                    {
                        buttonsUnlocks2[i].interactable = true;
                    }
                    for (int i = 1; i <= 6; ++i)
                    {
                        for (int j = 1; j <= 6; ++j)
                        {
                            CollectablesManager.setCollectable("W" + i + "L0" + j);
                        }
                    }
                    Debug.LogError("Unlocked Collectables");

                    currentKey2  = 0;
                    secondUnlock = true;
                }
            }
            StopCoroutine("ResetAll2");
            StartCoroutine("ResetAll2", timeToNotPress);
        }
        if (ReInput.players.GetPlayer(0).GetButtonDown(InputEnum.GetInputString(CombinationKeysMemories[currentKey3])) && !thirdUnlock)
        {
            ++currentNumberOfTimePress3;
            if (currentNumberOfTimePress3 >= numberOfTimePress)
            {
                ++currentKey3;
                if (currentKey3 >= CombinationKeysMemories.Length)
                {
                    SaveManager.Instance.dataKlaus.collectablesItems[0].item[0] = true;
                    for (int i = 0; i < SaveManager.Instance.dataKlaus.collectablesItems.Count; ++i)
                    {
                        for (int j = 0; j < SaveManager.Instance.dataKlaus.collectablesItems[i].item.Count; ++j)
                        {
                            SaveManager.Instance.dataKlaus.collectablesItems[i].item[j] = true;
                        }
                    }

                    for (int i = 0; i < buttonsUnlocksMemories.Length; ++i)
                    {
                        buttonsUnlocksMemories[i].interactable = true;
                    }

                    currentKey3 = 0;
                    thirdUnlock = true;
                    Debug.LogError("Unlocked Memories");
                }
            }
            StopCoroutine("ResetAll3");
            StartCoroutine("ResetAll3", timeToNotPress);
        }
    }