Esempio n. 1
0
    public void Start()
    {
        if (SceneManager.GetActiveScene().buildIndex == 0) //schermata home
        {
            Play("landing");
        }
        else if (SceneManager.GetActiveScene().buildIndex == 1) //SampleSceneRange
        {
            Play("build");
            Play("play");
            Mute("play");
        }

        saveManager = SaveManager.SaveManagerInstance;
        saveManager = SaveUtility.LoadObject(saveManager, "saveFile");
        //Debug.Log("Volume musica iniziale: " + saveManager.musicVolume);
        FindSoundSlider();
        if (musicToggle)
        {
            if (saveManager.musicVolume)
            {
                musicToggle.isOn     = false;
                AudioListener.volume = 1f;
            }
            else
            {
                musicToggle.isOn     = true;
                AudioListener.volume = 0;
            }
        }
    }
Esempio n. 2
0
    public void Start()
    {
        numberIfDeathsText.text = LevelManager.TotalNumberOfDeaths.ToString();
        allButtons = new GameObject[levelAmountTest];
        //Carichiamo l'oggetto SaveManager per ottenere i dati salvati del gioco
        saveManager = SaveManager.SaveManagerInstance;
        saveManager = SaveUtility.LoadObject(saveManager, "saveFile");

        CreateLevelButtons();
    }
Esempio n. 3
0
 public virtual void StartDeath()
 {
     player.SetActiveRagdoll(true);
     SpawnBloodParticles();
     LevelManager.NumberOfDeaths      += 1;
     LevelManager.TotalNumberOfDeaths += 1;
     saveManager = SaveManager.SaveManagerInstance;
     saveManager = SaveUtility.LoadObject(saveManager, "saveFile");
     saveManager.totalDeathsCounter = LevelManager.TotalNumberOfDeaths;
     SaveUtility.SaveObject(saveManager, "saveFile");
     GameObject.Find("NumberOfAttemptsText").GetComponent <Text>().text = "NUMBER OF DEATHS: " + LevelManager.NumberOfDeaths;
 }
Esempio n. 4
0
    private static void SaveStarsNumber()
    {
        SaveManager saveManager = SaveManager.SaveManagerInstance;

        saveManager = SaveUtility.LoadObject <SaveManager>(saveManager, "saveFile");

        if (saveManager.stars[CurrentLevelIndex] < GetNumberOfStars())
        {
            saveManager.stars[CurrentLevelIndex] = GetNumberOfStars();
            SaveUtility.SaveObject(saveManager, "saveFile");
        }
    }
Esempio n. 5
0
    void Start()
    {
        Application.targetFrameRate = 60;

        levels = new List <Level>();

        PlayerSimulator.playerSimulatorFlagReached += ActivateChangeLevelStateButton;
        //inizializza il Dictionary degli ostacoli a zero
        LevelManager.NumberOfObstacles = new Dictionary <ObstacleType, int>();
        foreach (ObstacleType type in System.Enum.GetValues(typeof(ObstacleType)))
        {
            NumberOfObstacles.Add(type, 0);
        }

        try
        {
            for (int i = 1; i < 100; i++)
            {
                String levelPath = "Levels/Level" + i.ToString();
                levels.Add(Resources.Load <Level>(levelPath));
            }
        }
        catch (NullReferenceException e) { }


        CurrentLevel          = levels[CurrentLevelIndex];
        currentLevelText.text = "LV. " + (CurrentLevelIndex + 1);

        if (CurrentLevel == null)
        {
            Debug.Log("Il livello corrente è null nel LevelManager");
        }

        SetUpLevel();

        state = LevelState.UNDER_CONSTRUCTION;

        currentTime = 0.0f;

        saveManager         = SaveManager.SaveManagerInstance;
        saveManager         = SaveUtility.LoadObject(saveManager, "saveFile");
        TotalNumberOfDeaths = saveManager.totalDeathsCounter;
    }
Esempio n. 6
0
 void Start()
 {
     saveManager           = SaveManager.SaveManagerInstance;
     saveManager           = SaveUtility.LoadObject(saveManager, "saveFile");
     overallDeathText.text = saveManager.totalDeathsCounter.ToString();
 }