예제 #1
0
    public void RestartGame()
    {
        StartPlatform.ActiveObstacle = true;
        groundPool.DeactivateAllAlive();
        goldCoinPool.DeactivateAllAlive();
        silverCoinPool.DeactivateAllAlive();
        rizlaHealPool.DeactivateAllAlive();
        for (int i = 0; i < obstaclesPools.Length; i++)
        {
            obstaclesPools[i].DeactivateAllAlive();
        }
        for (int i = 0; i < pe1Pools.Length; i++)
        {
            pe1Pools[i].DeactivateAllAlive();
        }
        for (int i = 0; i < pe2Pools.Length; i++)
        {
            pe2Pools[i].DeactivateAllAlive();
        }

        nextPE1Lenght          = 0f; nextPE2Lenght = 0f;
        nextObstLenght         = 35f; nextGroundLenght = 35f;
        nextCoinLenght         = 40f;
        nextRizlaValDistance.x = UnityEngine.Random.Range(10, 35);
        nextRizlaValDistance.y = nextRizlaValDistance.x / rizlaHealOverDist.x * rizlaHealOverDist.y;
        nextJetPowerupLenght   = stageStartLenghts[1] / 2;
        PE1Heap.position       = Vector3.zero;
        PE2Heap.position       = Vector3.zero;

        Rain.s_inst.RestartRain();
        cig.ReviveOrRestart(true);
        Camera.main.transform.position = new Vector3(15f, 3.7f, -10f);       //HARDCODED

        UpdateHighScoreUI();
        UpdateGoldCoinCountUI();
        GameMenu.s_inst.blockControlls.SetActive(true);
        StopAllCoroutines();         //##
        StartCoroutine(StartLaunch(startGameLaunchTime));
    }