Exemple #1
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.tag == "finish")
        {
            TinySauce.OnGameFinished(PlayerPrefs.GetInt("Level").ToString(), true, 0);
            finish           = true;
            move.finish_bool = true;
            GameObject.Find("Computer").GetComponent <move>().PlaySound("sound2", 0.7f);
            stars.SetActive(true);
            //PlayerPrefs.SetInt("scene", int.Parse(SceneManager.GetActiveScene().name));

            int currentLevel = PlayerPrefs.GetInt("Level");
            currentLevel++;
            PlayerPrefs.SetInt("Level", currentLevel);
            Invoke("LoadNewLevel", 2f);
        }
        else
        {
            move.score += 1;
            slider.GetComponent <Slider>().value = move.score;
            GameObject.Find("Score_New").GetComponent <Text>().text = move.score.ToString();
            GameObject.Find("Computer").GetComponent <move>().PlaySound("sound1", 0.7f);

            int random = Random.Range(0, 2);
            if (random == 1)
            {
                other.transform.parent.gameObject.GetComponent <Animator>().Play("cube_break");
            }
            else
            {
                other.transform.parent.gameObject.GetComponent <Animator>().Play("cube_break2");
            }
        }
    }
Exemple #2
0
    void LevelUp()
    {
        int stars = PlayerPrefs.GetInt("level" + currentLevel.ToString() + "stars", 0);
        int currStars;

        if (attempts == 1)
        {
            currStars = 3;
        }
        else if (attempts <= 3)
        {
            currStars = 2;
        }
        else
        {
            currStars = 1;
        }

        TinySauce.OnGameFinished(true, currStars, levelNumber: currentLevel.ToString());

        if (currStars > stars)
        {
            PlayerPrefs.SetInt("level" + currentLevel.ToString() + "stars", currStars);
        }

        kickEnabled = false;
        StopAllCoroutines();
        animator.SetBool("levelComplete", true);
    }
 public void RestartGame()
 {
     currentIndex = SceneManager.GetActiveScene().buildIndex;
     //Debug.Log("Level Start - " + (currentIndex + 1));
     TinySauce.OnGameStarted(currentIndex.ToString());
     SceneManager.LoadScene(currentIndex);
 }
Exemple #4
0
        void Awake()
        {
            appToken = TinySauce.getToken();


            if (appToken == "")
            {
                throw new MissingFieldException("Go here", new Exception("No Adjust token found please add it to your tinysauce settings"));
                Debug.Break();
                return;
            }
            if (IsEditor())
            {
                return;
            }

            DontDestroyOnLoad(transform.gameObject);

            if (!this.startManually)
            {
                AdjustConfig adjustConfig = new AdjustConfig(this.appToken, this.environment, (this.logLevel == AdjustLogLevel.Suppress));
                adjustConfig.setLogLevel(this.logLevel);
                adjustConfig.setSendInBackground(this.sendInBackground);
                adjustConfig.setEventBufferingEnabled(this.eventBuffering);
                adjustConfig.setLaunchDeferredDeeplink(this.launchDeferredDeeplink);
                Adjust.start(adjustConfig);
            }
        }
Exemple #5
0
    void VoodooStart()
    {
#if VOODOO_LEVEL
        TinySauce.OnGameStarted("" + Level);
#elif VOODOO_NO_LEVEL
        TinySauce.OnGameStarted("game");
#endif
    }
Exemple #6
0
    void VoodooFinish(bool isLevelComplete = true)
    {
#if VOODOO_LEVEL
        TinySauce.OnGameFinished("" + Level, isLevelComplete, Score);
#elif VOODOO_NO_LEVEL
        TinySauce.OnGameFinished("game", isLevelComplete, Score);
#endif
    }
    public void RestartLevel()
    {
        int dCollected = playerNref.DiamondCollected;

        TinySauce.OnGameFinished(levelNumber: clt.ToString(), false, dCollected);

        Level = SceneManager.GetActiveScene();
        SceneManager.LoadScene(Level.name);
    }
Exemple #8
0
 private static void CheckAndUpdateSdkSettings(TinySauceSettings sauceSettings)
 {
     Console.Clear();
     BuildErrorWindow.Clear();
     GameAnalyticsPreBuild.CheckAndUpdateGameAnalyticsSettings(sauceSettings);
     FacebookPreBuild.CheckAndUpdateFacebookSettings(sauceSettings);
     AdjustBuildPrebuild.CheckAndUpdateAdjustSettings(sauceSettings);
     TinySauce.UpdateAdjustToken(sauceSettings);
 }
Exemple #9
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag == "enemy" || collision.gameObject.tag == "sea")
     {
         //SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
         TinySauce.OnGameFinished(PlayerPrefs.GetInt("Level").ToString(), false, 0);
         levelGenerator.LoadSameLevel();
         GameObject.FindGameObjectWithTag("slider").GetComponent <Slider>().value = 0;
     }
 }
Exemple #10
0
    public IEnumerator LoadSameLevel(float second)
    {
        yield return(new WaitForSeconds(second));

        CameraManager.INSTANCE.canFollow = true;
        DestroyAll();
        LoadLevel(level);
        PlayerPrefs.SetInt("level", level);
        PlayerPrefs.Save();
        TinySauce.OnGameStarted("LevelManager_LoadSameLevel-" + "Level-" + (level) + "Try_Level-" + (++deathCountSameLevel).ToString() + "_Time-" + (int)Time.time);
    }
 public void onStartGame()
 {
     Time.timeScale = 1f;
     TinySauce.OnGameStarted();
     isGameStarted        = true;
     isGameOver           = false;
     globalScrollSpeed    = startGlobalScrollSpeed;
     oldGlobalScrollSpeed = startGlobalScrollSpeed;
     gamePlayTime         = 0f;
     score      = 0;
     earthScore = 0;
 }
Exemple #12
0
    public IEnumerator NextLevel(float second)
    {
        yield return(new WaitForSeconds(second));

        DestroyAll();
        level++;
        level = level % 16;
        LoadLevel(level);
        CameraManager.INSTANCE.canFollow = true;
        PlayerPrefs.SetInt("level", level);
        PlayerPrefs.Save();
        TinySauce.OnGameStarted("LevelManager_NextLevel-" + "Level-" + level.ToString() + "_Time-" + (int)Time.time);
    }
    private void GenerateLevel()
    {
        TinySauce.OnGameStarted(PlayerPrefs.GetInt("Level").ToString());
        CubesOnScene[0] = FirstCube;

        for (int i = 1; i <= 19; i++)
        {
            Vector3 tempPos = SetNewCubePos(i);
            CubesOnScene[i] = Instantiate(CubePrefab, tempPos, FirstCube.transform.rotation);

            CubePositionsX[i - 1] = tempPos.x;
        }
    }
Exemple #14
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.gameObject.name == "Character")
     {
         //MainPanel.SetActive(true);
         GamePanel.SetActive(false);
         Right.GetComponent <MoveRight>().ispressed = false;
         Left.GetComponent <MoveLeft>().ispressed   = false;
         PlayerPrefs.SetInt("state", 0);
         PlayerPrefs.SetFloat("realPoints", PlayerPrefs.GetFloat("points"));
         TinySauce.OnGameFinished(PlayerPrefs.GetFloat("realPoints"));
         characterFunction();
     }
 }
 public void restartPressed()
 {
     if (level_complete)
     {
         TinySauce.OnGameFinished(cur_level.ToString(), level_complete, enemyCount);
         PlayerPrefs.SetInt("cur_level", cur_level + 1);
         SceneManager.LoadScene(0);
     }
     else
     {
         TinySauce.OnGameFinished(cur_level.ToString(), level_complete, enemyCount);
         SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
     }
 }
Exemple #16
0
    public void StartGame()
    {
        TinySauce.OnGameStarted();

        SetIngredientsToTab();
        _playerController.StartGame();

        _defaultCameraPosition = _mainCamera.transform.position;
        _defaultCameraRotation = _mainCamera.transform.rotation;


        _burger.BurgerStableActive(true);
        _scoreComponent.gameObject.SetActive(true);
        _gameArrow.SetActive(true);
    }
Exemple #17
0
    public void GameOverFunk()
    {
        isGameOver     = true;
        Time.timeScale = 1;

        GameManager.instance.GameOverFunc();


        Invoke("WaitForStatsCounting", 2);
        _cameraAnimation.Play();

        TextRenderer();
        SetRecord();

        TinySauce.OnGameFinished(Score.instance.GetScore());
    }
    public void ShowNextui()
    {
        if (!NLuiShown)
        {
            NextlevelUI.SetActive(true);
            int dCollected = playerNref.DiamondCollected * playerNref.Rewardstore;


            TinySauce.OnGameFinished(levelNumber: clt.ToString(), true, dCollected);


            NLuiShown = true;

            // PlayerPrefs.SetInt("")
        }
    }
    void Start()
    {
        Slider.maxValue = maxvalue;
        Slider.value    = 0;
        DiamondUI.text  = PlayerPrefs.GetInt("totaldiamond", 0).ToString();

        clt        = PlayerPrefs.GetInt("CLT_p", 1);
        CLuiT.text = clt.ToString();
        int nl = clt + 1;

        NLuiT.text = nl.ToString();

        /* leveltoload = PlayerPrefs.GetInt("currentlevel", 0);
         * SceneManager.LoadScene(leveltoload);*/


        TinySauce.OnGameStarted(levelNumber: clt.ToString());
    }
Exemple #20
0
    void StartLevel()
    {
        if (themeMenu.activeSelf)
        {
            themeMenu.SetActive(false);
        }

        if (!gameMenu.activeSelf)
        {
            gameMenu.SetActive(true);
        }

        if (levelUpCanvas.activeSelf)
        {
            LeanTween.cancel(nextLevelText.gameObject);
            levelUpCanvas.SetActive(false);
        }

        int level = GlobalVariables.currentLevel;

        TinySauce.OnGameStarted(levelNumber: level.ToString());

        levelText.text = "Level " + level.ToString();
        if (level == 1)
        {
            levels.transform.Find("Level" + level.ToString()).gameObject.SetActive(true);
        }
        else
        {
            if (levels.transform.childCount < level)
            {
                PlayerPrefs.SetInt("level", PlayerPrefs.GetInt("level", 1) - 1);
                unlockedNewTheme = false;
                BackToMainMenu();
            }
            levels.transform.Find("Level" + (level - 1).ToString()).gameObject.SetActive(false);
            levels.transform.Find("Level" + level.ToString()).gameObject.SetActive(true);
            if (unlockedNewTheme)
            {
                unlockedNewTheme = false;
                FindObjectOfType <CustomizationManager>().SelectActiveTheme();
            }
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        currentSceneIndex = SceneManager.GetActiveScene().buildIndex;

        TinySauce.OnGameStarted(levelNumber: (currentSceneIndex + 1).ToString());

        instance = this;

        if (loseCanvas != null)
        {
            loseCanvas.SetActive(false);
        }

        //this stuff will be set active after you win the level
        foreach (var item in activateStuff)
        {
            item.SetActive(false);
        }
    }
    public void gameOver()
    {
        TinySauce.OnGameFinished(score);

        if (score > PlayerPrefs.GetInt("score"))
        {
            PlayerPrefs.SetInt("score", score);
        }
        EasyMobileProManager.reportScore(score);


        isGameOver = true;
        SoundManager._inst.playSFXCorot(EnumsData.SFXEnum.lose, .1f);
        SoundManager._inst.playSFXCorot(EnumsData.SFXEnum.monsterLaugh, .6f);
        Time.timeScale = 0.4f;
        PlayerController._inst.onPlayerDie();
        MasterUI._inst.onGameOver();
        //Invoke("reloadScene", 2.2f);
    }
    void Awake()
    {
        if (!PlayerPrefs.HasKey("LevelNumber"))
        {
            PlayerPrefs.SetInt("LevelNumber", 1);
            TinySauce.OnGameStarted("1");
        }


        if (PlayerPrefs.GetInt("ExitLevel") >= 1 && PlayerPrefs.GetInt("ExitLevel") <= 6)
        {
            SceneManager.LoadScene(PlayerPrefs.GetInt("ExitLevel"));
            TinySauce.OnGameStarted(PlayerPrefs.GetInt("ExitLevel").ToString());
        }
        else
        {
            SceneManager.LoadScene(1);
            TinySauce.OnGameStarted("1");
        }
    }
    public void NextLevel()
    {
        currentIndex = SceneManager.GetActiveScene().buildIndex;
        if (currentIndex < 6)
        {
            PlayerPrefs.SetInt("LevelNumber", PlayerPrefs.GetInt("LevelNumber") + 1);
            TinySauce.OnGameStarted(PlayerPrefs.GetInt("LevelNumber").ToString());

            SceneManager.LoadScene(currentIndex + 1);
            SaveGame();
        }
        else
        {
            PlayerPrefs.SetInt("LevelNumber", PlayerPrefs.GetInt("LevelNumber") + 1);
            TinySauce.OnGameStarted(PlayerPrefs.GetInt("LevelNumber").ToString());

            SceneManager.LoadScene(1);
            SaveGame();
        }
    }
    public void LevelComplete()
    {
        foreach (var item in activateStuff)
        {
            item.SetActive(true);
        }


        //while build enable this statement
        if (SceneManager.GetActiveScene().buildIndex < 1)
        {
            StartCoroutine(LoadLevelAfterDelay(currentSceneIndex + 1));
            TinySauce.OnGameFinished(levelNumber: (currentSceneIndex + 1).ToString(), 1);
        }
        else
        {
            StartCoroutine(LoadLevelAfterDelay(0));
            TinySauce.OnGameFinished(levelNumber: (currentSceneIndex + 1).ToString(), 0);
        }
    }
    public void LoadSameLevel()
    {
        TinySauce.OnGameStarted(PlayerPrefs.GetInt("Level").ToString());
        playerBall.GetComponent <Rigidbody>().MovePosition(playerInitialPos);
        for (int i = 0; i < 19; i++)
        {
            Destroy(CubesOnScene[i]); //Destroy all cubes, broken or unbroken
        }

        CubesOnScene[0] = Instantiate(CubePrefab, firstCubeTransform.position, firstCubeTransform.rotation);
        Vector3 pos = firstCubeTransform.position;

        move.score = 0;
        GameObject.Find("Score_New").GetComponent <Text>().text = "";

        for (int i = 0; i < 18; i++)
        {
            pos.x  = CubePositionsX[i];
            pos.z += 25f;
            CubesOnScene[i + 1] = Instantiate(CubePrefab, pos, firstCubeTransform.rotation);
        }
    }
    // Start is called before the first frame update
    void Start()
    {
        PlayerPrefs.DeleteAll();
        //init Voodoo
        TinySauce.OnGameStarted(cur_level.ToString());
        //init character
        weight       = start_weight;
        rb           = this.GetComponent <Rigidbody>();
        UiController = GameObject.FindGameObjectsWithTag("Ui")[0].GetComponent <UiController>();

        //init Dam
        damPieces = GameObject.FindGameObjectsWithTag("DamPieces");
        damI      = damPieces.Length;

        //init borders
        left_border  = left_border_object.transform.position.z;
        right_border = right_border_object.transform.position.z;

        //init obstacles
        obstacles          = GameObject.FindGameObjectsWithTag("Obstacle");
        obstacles_class    = new Obstacles[obstacles.Length];
        obstacles_renderer = new Renderer[obstacles.Length];
        obstacles_collider = new Collider[obstacles.Length];
        for (int i = 0; i < obstacles.Length; i++)
        {
            obstacles_class[i]    = obstacles[i].GetComponent <Obstacles>();
            obstacles_renderer[i] = obstacles[i].GetComponent <Renderer>();
            obstacles_collider[i] = obstacles[i].GetComponent <Collider>();
        }
        updateObstacles();
        SpawnerRef = GameObject.FindGameObjectWithTag("Respawn");

        //init colliders
        min_collision_radius = GetComponent <SphereCollider>().radius;
        min_trigger_scale    = GetComponent <BoxCollider>().size;
        LoadSaves();
    }
Exemple #28
0
 private void SavePlayerProgress()
 {
     RememberPlayer();
     SaveData();
     TinySauce.OnGameFinished(_playerData.Level.ToString(), _playerData.LevelProgress);
 }
Exemple #29
0
 private void Start()
 {
     TinySauce.OnGameStarted();
 }
Exemple #30
0
 public void GameStarted()
 {
     TinySauce.OnGameStarted();
 }