Example #1
0
    IEnumerator ChangeScene(int i)
    {
        yield return(new WaitForSeconds(3f));

        //        SceneManager.LoadScene(i);
        LoadingScreenManager.LoadScene(i);
    }
Example #2
0
 public static void LoadGame(string levelName, int laps, int players, bool isReverse)
 {
     try
     {
         WriteLog.Debug("Starting generating and loading multiplayer scene...");
         GameSetupScript.Instance.ReverseTrack = isReverse;
         if (GameManager.Instance != null)
         {
             GameManager.Instance.CurrentGameMode = GameManager.GameMode.QuickRace;
             GameManager.Instance.CurrentGameType = GameManager.GameType.SinglePlayer;
             GameManager.Instance.CurrentRaceType = GameManager.RaceType.Single;
             WriteLog.Verbose("Setting Game mode/type/racetype to QuickRace/singleplayer/single");
         }
         LevelData levelData = LevelDatabase.Instance.LevelDataList.Find((LevelData level) => level.BuildName == levelName && (level.IsReverseLevel == isReverse));
         if (levelData == null)
         {
             WriteLog.Debug("Potential error, levelData is null");
         }
         GameSetupScript.Instance.SetCurrentLevel(levelData);
         GameSetupScript.Instance.GetCurrentLevel().RaceMode = GameManager.RaceType.Single;
         GameSetupScript.Instance.EnableTutorial  = false;
         GameSetupScript.Instance.Bots            = players;
         GameSetupScript.Instance.Laps            = laps;
         GameSetupScript.Instance.NumberOfPlayers = 1;
         WriteLog.Verbose("Starting to load game scene");
         LoadingScreenManager.LoadScene(GameSetupScript.Instance.GetCurrentLevel().BuildName, GameSetupScript.Instance.GetCurrentLevel().BuildIndex);
     }
     catch (Exception ex)
     {
         WriteLog.Error("Error while trying to load game: " + ex.Message + ex.StackTrace);
     }
 }
Example #3
0
 public void yesExit()
 {
     ExitGameObject.SetActive(false);
     Time.timeScale = 1;
     //SceneManager.LoadScene("newMenu");
     LoadingScreenManager.LoadScene(1);
 }
Example #4
0
 void OnTriggerEnter(Collider iCollide)
 {
     if (iCollide.transform.name == "Player")
     {
         LoadingScreenManager.LoadScene(num);
     }
 }
Example #5
0
 public void NewGame()
 {
     LoadingScreenManager.LoadScene(1);
     gameManager.currentRoom  = 0;
     gameManager.currentState = 0;
     SaveLoadManager.SaveGameState(gameManager);
 }
Example #6
0
    public IEnumerator WaitGameOver()
    {
        yield return(new WaitForSeconds(2));

        //SceneManager.LoadScene ("Score");
        LoadingScreenManager.LoadScene(10);
    }
Example #7
0
    IEnumerator GameOver()
    {
        AnaliticsControl.ovosTime = tempo;
        yield return(new WaitForSeconds(2));

        //SceneManager.LoadScene("Score");
        LoadingScreenManager.LoadScene(10);
    }
Example #8
0
    private IEnumerator PlaySoundButton(int scene)
    {
        aud.Stop();
        aud.Play();
        yield return(new WaitForSeconds(aud.clip.length));

        LoadingScreenManager.LoadScene(scene);
    }
Example #9
0
 public void LoadSceneNum(int num)
 {
     if (num < 0 || num >= SceneManager.sceneCountInBuildSettings)
     {
         return;
     }
     LoadingScreenManager.LoadScene(num);
 }
Example #10
0
    void ToScore()
    {
        notaFinal = 0;
        if (tempo <= 5f)
        {
            notaFinal = 20;
        }
        else if (tempo <= 7f)
        {
            notaFinal = 10;
        }
        else if (tempo <= 10f)
        {
            notaFinal = 7;
        }

        else if (tempo <= 15f)
        {
            notaFinal = 5;
        }

        PlayerPrefs.SetInt("notaFinalTemp" + idTema.ToString(), notaFinal);

        if (gamelevel == 0)
        {
            if (notaFinal > PlayerPrefs.GetInt("piqueFacil" + idTema.ToString()))
            {
                PlayerPrefs.SetInt("piqueFacil" + idTema.ToString(), notaFinal);
            }
            if (PlayerPrefs.GetString("dificuldade" + idTema) == "F" || PlayerPrefs.GetString("dificuldade" + idTema) == "")
            {
                PlayerPrefs.SetString("dificuldade" + idTema, "M");
            }
        }
        else if (gamelevel == 1)
        {
            if (notaFinal > PlayerPrefs.GetInt("piqueMedio" + idTema.ToString()))
            {
                PlayerPrefs.SetInt("piqueMedio" + idTema.ToString(), notaFinal);
            }

            if (PlayerPrefs.GetString("dificuldade" + idTema) == "M")
            {
                PlayerPrefs.SetString("dificuldade" + idTema, "D");
            }
        }
        else if (gamelevel == 2)
        {
            if (notaFinal > PlayerPrefs.GetInt("piqueDificil" + idTema.ToString()))
            {
                PlayerPrefs.SetInt("piqueDificil" + idTema.ToString(), notaFinal);
            }
        }

        //Score.infoValue = string.Format ("Parabéns, você me achou em {0} segundos e tirou {1}!", tempo.ToString ("0.0"), notaFinal);
        //SceneManager.LoadScene ("Score");
        LoadingScreenManager.LoadScene(10);
    }
Example #11
0
    public void RejectSave()
    {
        if (Time.timeScale == 0)
        {
            Time.timeScale = 1;
        }

        LoadingScreenManager.LoadScene(1);
    }
 public void LoadSceneNumber(int num)
 {
     if (num < 0 || num >= SceneManager.sceneCountInBuildSettings)
     {
         Debug.LogWarning("Can't load scene num " + num + ", SenceManager only has " + SceneManager.sceneCountInBuildSettings + "Scenes is BuildSetting !");
         return;
     }
     LoadingScreenManager.LoadScene(num);
 }
Example #13
0
    public IEnumerator StartGameOver()
    {
        memoriaData.tempoJogo = tempo;
        //dataController.SetMemoriaData(memoriaData);
        yield return(new WaitForSeconds(2));

        //SceneManager.LoadScene ("Score");
        LoadingScreenManager.LoadScene(10);
    }
Example #14
0
    public void LoadSceneNum(string name)
    {
        /*if (num < 0 || num >= SceneManager.sceneCountInBuildSettings) {
         *      Debug.LogWarning("Can't load scene num " + num + ", SceneManager only has " + SceneManager.sceneCountInBuildSettings + " scenes in BuildSettings");
         *      return;
         * }*/

        LoadingScreenManager.LoadScene(name);
    }
Example #15
0
    public IEnumerator GameOver()
    {
        if (acertos == 12)
        {
            notaFinal = 20;
        }
        else if (acertos <= 11 && acertos >= 8)
        {
            notaFinal = 10;
        }
        else if (acertos <= 7 && acertos >= 4)
        {
            notaFinal = 7;
        }
        else if (acertos < 4)
        {
            notaFinal = 5;
        }
        if (gamelevel == 0)
        {
            if (notaFinal > PlayerPrefs.GetInt("piqueFacil" + idTema.ToString()))
            {
                PlayerPrefs.SetInt("piqueFacil" + idTema.ToString(), notaFinal);
            }
            if (PlayerPrefs.GetString("dificuldade" + idTema) == "F" || PlayerPrefs.GetString("dificuldade" + idTema) == "")
            {
                PlayerPrefs.SetString("dificuldade" + idTema, "M");
            }
        }
        else if (gamelevel == 1)
        {
            if (notaFinal > PlayerPrefs.GetInt("piqueMedio" + idTema.ToString()))
            {
                PlayerPrefs.SetInt("piqueMedio" + idTema.ToString(), notaFinal);
            }

            if (PlayerPrefs.GetString("dificuldade" + idTema) == "M")
            {
                PlayerPrefs.SetString("dificuldade" + idTema, "D");
            }
        }
        else if (gamelevel == 2)
        {
            if (notaFinal > PlayerPrefs.GetInt("piqueDificil" + idTema.ToString()))
            {
                PlayerPrefs.SetInt("piqueDificil" + idTema.ToString(), notaFinal);
            }
        }
        PlayerPrefs.SetInt("notaFinalTemp" + idTema.ToString(), notaFinal);
        alimentosData.nota = notaFinal;
        //dataController.SetAlimentosData(alimentosData);
        yield return(new WaitForSeconds(2));

        //SceneManager.LoadScene ("Score");
        LoadingScreenManager.LoadScene(10);
    }
Example #16
0
    // Update is called once per frame
    void Update()
    {
        if (player.transform.position.x >= this.transform.position.x)
        {
            PersistentGameObject PGO = GameObject.FindGameObjectWithTag("PersistentObject").GetComponent <PersistentGameObject> ();
            PGO.setPlayerWeapon(player.transform.Find("RifleWeapon").gameObject.GetComponent <TrackMouse> ().weapon);

            LoadingScreenManager.LoadScene(sceneIndexToLoad);
        }
    }
Example #17
0
 public void ReloadPlacingPhase()
 {
     Gamestate.Instance.currentState = 1;
     SaveLoadManager.SaveGameState(Gamestate.Instance);
     isReloaded = true;
     SaveLoadManager.SavePlacingData(this);
     //Inventory.Instance.GetListCount();
     LoadingScreenManager.LoadScene(1);
     Time.timeScale = 1.0f;
 }
Example #18
0
 public void LoadSceneNum(int num)
 {
     if (num < 0 || num >= SceneManager.sceneCountInBuildSettings)
     {
         Debug.LogWarning("CANT LOAD SCENE " + num);
         return;
     }
     Debug.Log("Running THIS NOW");
     LoadingScreenManager.LoadScene(num);
 }
Example #19
0
    public void LoadSceneNum(int num)
    {
        if (num < 0 || num >= SceneManager.sceneCountInBuildSettings)
        {
            Debug.LogWarning("Can't load scene " + num + ". It's beyond the scene count for this project. Did you add the scene to build settings?");
            return;
        }

        LoadingScreenManager.LoadScene(num);
    }
Example #20
0
 public void LoadScreenNum(int num, int fromScene)
 {
     if (num < 0 || num >= SceneManager.sceneCountInBuildSettings) //błąd
     {
         Debug.LogWarning("Cant load scene num" + num + ", Scene manager only has " + SceneManager.sceneCountInBuildSettings + " scenes in BuildSettings!");
         return;
     }
     LoadingScreenManager.LoadScene(num, fromScene);     //wywołanie skryptu umożliwiającego ładowanie sceny
     Debug.Log("Load Scene: " + num);
 }
Example #21
0
    //-------------------------------
    // UI controls

    public void Retry()
    {
        if (Time.timeScale == 0)
        {
            Time.timeScale = 1;
        }

        GameController.Player.GetComponent <FirstPersonController>().m_MouseLook.SetCursorLock(true);
        LoadingScreenManager.LoadScene(GameController.CurrentLevel);
    }
Example #22
0
    public IEnumerator GameOver()
    {
        isGame = false;
        gameOverPrefab.SetActive(true);
        gameOverPanel.SetTrigger("DoFade");
        PlayerPrefs.SetInt("gold", getGold);
        yield return(new WaitForSeconds(1.5f));

        LoadingScreenManager.LoadScene(1);
    }
    public void LoadSceneNum(int num)
    {
        if (num < 0 || num >= SceneManager.sceneCountInBuildSettings)
        {
            Debug.LogWarning($"Can't load scene num {num}, SceneManager only has {SceneManager.sceneCountInBuildSettings} scenes in BuildSettings!");
            return;
        }

        LoadingScreenManager.LoadScene(num);
    }
Example #24
0
 public void LoadSceneNum(int num)
 {
     if (num < 0 || num >= SceneManager.sceneCountInBuildSettings)
     {
         Debug.LogError("Can't load scene with index " + num);
     }
     else
     {
         LoadingScreenManager.LoadScene(num);
     }
 }
Example #25
0
 public void changeCamera(Button btn)
 {
     if (num < 0 || num >= SceneManager.sceneCountInBuildSettings)
     {
         Debug.LogWarning("Can't load scene num " + num + ", SenceManager only has " + SceneManager.sceneCountInBuildSettings + "Scenes is BuildSetting !");
         return;
     }
     LoadingScreenManager.LoadScene(num);
     cameraUI.gameObject.SetActive(false);
     cameraMale.gameObject.SetActive(false);
     cameraFemale.gameObject.SetActive(false);
 }
    public void SelectPoint()
    {
        // Locates the TargetData GO and sets the executing Point as the current target
        GameObject      targetData      = GameObject.Find("TargetData");
        TargetDataPoint targetDataPoint = targetData.GetComponent <TargetDataPoint> ();

        targetDataPoint.SetDataPoint(gameObject.name);

        // Loads the WorldScene
        LoadingScreenManager.LoadScene("WorldScene");
        return;
    }
Example #27
0
/*
 *  public void ChangeLevel(int levelIndex)
 *  {
 *      SoundSystem.s.FadeOutMusic(0.5f, () =>
 *       {
 *           LevelConditions LC = levelconditions.Find(x => x.BuildSettingOrder == levelIndex);
 *           if (LC != null) {
 *               ProfileLevels PL = ProfileSingleton.profileLevels.Find(x => x.code == LC.Code);
 *               if (PL != null)
 *               {
 *                   sProfileManager.ProfileSingleton.newLevelIndex = PL.index;
 *
 *               }
 *          }
 *           sProfileManager.ProfileSingleton.ChangingLevel = true;
 *           LoadingScreenManager.LoadScene(levelIndex + 3);
 *       });
 *  }
 */
    public void ChangeLevel(string code)
    {
        int levelIndex = 0;

        levelIndex = levelconditions.Find(x => x.Code == code).BuildSettingOrder;
        SoundSystem.s.FadeOutMusic(0.5f, () =>
        {
            sProfileManager.ProfileSingleton.newLevelIndex = ProfileSingleton.profileLevels.Find(x => x.code == code).index;
            sProfileManager.ProfileSingleton.ChangingLevel = true;
            LoadingScreenManager.LoadScene(levelIndex);
        });
    }
Example #28
0
	public IEnumerator FimJogo(){
		fim = true;
		AnaliticsControl.pastoreiraTime = tempo;
		yield return new WaitForSeconds(1f);
        notaFinal = 10;
		if (notaFinal > PlayerPrefs.GetInt("notaFinal" + idTema.ToString()))
		{
			PlayerPrefs.SetInt ("notaFinal" + idTema.ToString (), notaFinal);
		}
		PlayerPrefs.SetInt ("notaFinalTemp" + idTema.ToString (), notaFinal);
//		Score.infoValue = string.Format ("Você marcou {0} pontos!", pontuacao);
		if (gamelevel == 0)
		{
			if (notaFinal > PlayerPrefs.GetInt("piqueFacil" + idTema.ToString()))
			{
				PlayerPrefs.SetInt ("piqueFacil" + idTema.ToString (), notaFinal);
			}
			if(PlayerPrefs.GetString("dificuldade" + idTema) == "F" || PlayerPrefs.GetString("dificuldade" + idTema) == "")
			{
				PlayerPrefs.SetString("dificuldade" + idTema, "M");
			}
			
		}
		else if (gamelevel == 1)
		{
			if (notaFinal > PlayerPrefs.GetInt("piqueMedio" + idTema.ToString()))
			{
				PlayerPrefs.SetInt ("piqueMedio" + idTema.ToString (), notaFinal);
			}

			if(PlayerPrefs.GetString("dificuldade" + idTema) == "M")
			{
				PlayerPrefs.SetString("dificuldade" + idTema, "D");
			}
			
		}
		else if (gamelevel == 2)
		{
			if (notaFinal > PlayerPrefs.GetInt("piqueDificil" + idTema.ToString()))
			{
				PlayerPrefs.SetInt ("piqueDificil" + idTema.ToString (), notaFinal);
			}
			
		}

		BarnAnin ();
		
		yield return new WaitForSeconds (2f);
		//SceneManager.LoadScene("Score");
		LoadingScreenManager.LoadScene(10);

	}
Example #29
0
    public void RandomLevel(int MaxIndex)
    {
        if (GameController.FirstLevelComplete != true)
        {
            ManageScenes.FirstLevelError();
        }

        if (GameController.FirstLevelComplete == true)
        {
            LoadingScreenManager.LoadScene(Mathf.RoundToInt(Random.Range(MinIndex, MaxIndex)));
            Init.ToMenu = false;
        }
    }
Example #30
0
 public void OpenLevel(int level)
 {
     StateManager.SetLevel(level);
     StateManager.SetIsCustom(false);
     if (level == 10)
     {
         SceneManager.LoadScene("PreBossLevel");
     }
     else
     {
         LoadingScreenManager.LoadScene(2);
     }
 }