Пример #1
0
    void CheckForNextStep()
    {
        /*
         * if (SaveManager.Instance.dataKlaus == null)
         * {
         *  SaveManager.Instance.StartSaveManager();
         * }*/

        if (CollectablesManager.isCollectableReady(TypeLevel))//Pregunto si este collectable ya se agarro
        {
            SaveManager.Instance.LevelCollectableLoaded = Application.loadedLevelName;

            if (CollectablesManager.isCollectableFull(TypeLevel))//Pregunto si ya se colleciono todo
            {
                SaveManager.Instance.LevelToLoadVideoCollectable = Door.NextScene;
                //Muestro Puerta
                Door.pausa = pausa;
                Door.gameObject.SetActive(true);
            }
            else
            {
                SaveManager.Instance.LevelToLoadVideoCollectable = SaveManager.Instance.LevelToLoadCollectable;
                //Muestro Portal
                Portal.pausa = pausa;
                Portal.gameObject.SetActive(true);
            }
            gameObject.SetActive(false);
        }
    }
Пример #2
0
    void FinishGivePiece()
    {
        collectable_UI.onFinish -= FinishGivePiece;
        collectable_UI.gameObject.SetActive(false);


        SaveManager.Instance.LevelCollectableLoaded = Application.loadedLevelName;

        if (posToShow == -1)
        {
            SaveManager.Instance.LevelToLoadVideoCollectable = SaveManager.Instance.LevelToLoadCollectable;
        }
        else
        {
            if (CollectablesManager.isCollectableReady(TypeLevel))
            {
                if (CollectablesManager.isCollectableFull(TypeLevel))
                {
                    SaveManager.Instance.LevelToLoadVideoCollectable = Door.NextScene;
                }
                else
                {
                    SaveManager.Instance.LevelToLoadVideoCollectable = SaveManager.Instance.LevelToLoadCollectable;
                }
            }
        }

        CameraFade.StartAlphaFade(Color.black, false, 0.2f);
        CameraFade.Instance.m_OnFadeFinish += LoadLevel;
    }
Пример #3
0
 // Use this for initialization
 void Awake()
 {
     if (CollectablesManager.isCollectableFull(World) == false)
     {
         gameObject.SetActive(false);
     }
     else
     {
         CollectableCpuMaster.Instance.AddCPU();
     }
 }
Пример #4
0
    void OnGameLoaded()
    {
        // Get total time played
        timePlayedText.text = HUD_TimeAttack.FormatTime(SaveManager.Instance.dataKlaus.totalTimePlayed);

        // Get story progress
        float storyProgress = SaveManager.Instance.GetHistoryPercent();

        storyText.text = Mathf.FloorToInt(storyProgress) + "%";

        // Get total deaths
        deathsText.text = SaveManager.Instance.dataKlaus.deaths.ToString();

        // Get total memories
        int currentPieces = 0;
        int totalPieces   = 0;

        for (int i = 0; i != SaveManager.Instance.dataKlaus.collectablesItems.Count; ++i)
        {
            totalPieces   += SaveManager.Instance.dataKlaus.collectablesItems[i].item.Count;
            currentPieces += SaveManager.Instance.dataKlaus.collectablesItems[i].item.FindAll(x => x).Count;
        }

        piecesText.text = currentPieces.ToString("00") + "/" + totalPieces.ToString("00");

        // Get memories completed
        int memoriesCompleted = 0;
        int totalMemories     = 6;

        for (int i = 1; i != 7; ++i)
        {
            memoriesCompleted += CollectablesManager.isCollectableFull("W" + i) ? 1 : 0;
        }

        memoriesCompletedText.text = memoriesCompleted.ToString() + "/" + totalMemories.ToString();

        // Get time attack progress
        float timeAttackProgress = 100f * (float)SaveManager.Instance.dataKlaus.GetBrokenCompanyRecords() / (float)SaveManager.Instance.dataKlaus.GetTotalCompanyRecords();

        timeAttackText.text = Mathf.FloorToInt(timeAttackProgress) + "%";

        // Get overall progress
        progressText.text = Mathf.FloorToInt(storyProgress * 0.5f + timeAttackProgress * 0.25f + 25f * (float)currentPieces / (float)totalPieces) + "%";
    }
Пример #5
0
    void OnGameLoaded()
    {
        for (int i = 0; i != memories.Length; ++i)
        {
            memories[i].interactable = CollectablesManager.isCollectableFull("W" + (i + 1));
        }

        for (int i = 0; i != memories.Length; ++i)
        {
            if (!memories[i].interactable)
            {
                continue;
            }

            Navigation navigation = memories[i].navigation;

            for (int j = i - 1; j >= 0; --j)
            {
                if (memories[j].interactable)
                {
                    navigation.selectOnUp = memories[j];
                    break;
                }
            }

            for (int j = i + 1; j < memories.Length; ++j)
            {
                if (memories[j].interactable)
                {
                    navigation.selectOnDown = memories[j];
                    break;
                }
            }

            memories[i].navigation = navigation;
        }
    }