Exemplo n.º 1
0
    void LoadLevel()
    {
        if (SaveManager.Instance.m_currentGame == null)
        {
            return;
        }

        string[] activated = SaveManager.Instance.m_currentGame.m_LightVeinActivated.ToArray();

        if (activated != null && activated.Length > 0)
        {
            print(activated.Length);
            LightVein[] lightVeins = FindObjectsOfType <LightVein>();

            for (int i = 0; i < lightVeins.Length; i++)
            {
                for (int j = 0; j < activated.Length; j++)
                {
                    if (lightVeins[i].name == activated[j])
                    {
                        if (SaveManager.Instance.m_currentGame.m_LastCheckPoint == lightVeins[i].name)
                        {
                            m_LastCheckPoint = lightVeins[i];
                        }

                        lightVeins[i].Activate();

                        break;
                    }
                }
            }

            m_Player.transform.position = GetLastCheckpoint();
        }
    }
Exemplo n.º 2
0
 public void SetLastCheckPoint(LightVein checkpoint)
 {
     m_LastCheckPoint = checkpoint;
     SaveManager.Instance.m_currentGame.m_LastCheckPoint = checkpoint.name;
 }