public void StartCatch(int index)
 {
     isPrison            = false;
     isCatching          = true;
     currentTypeCatching = index;
     levelMover.TurnNight(false);
     levelMover.SwapLayers();
     carParts.TurnAll();
     levelGenerator.SpawnExceptUniq(new string[] { "осн.кафе" });
     levelSpeed.SetSpeedLevel(2, true);
     try
     {
         dreamSpawner.Block();
     }
     catch
     {
     }
 }
Beispiel #2
0
 public void GenerateDonutBuilding()
 {
     levelGenerator.SpawnConcreteUniq("осн.кафе");//SpawnExceptUniq(new string[] { "осн.техника", "", "", ""});
     levelSpeed.SetSpeedLevel(2, true);
 }
Beispiel #3
0
    IEnumerator Starting()
    {
        //car.EnableMoving();
        //yield return new WaitForSeconds(3f);
        //ui.DarkScreen();
        generator.enabled = true;
        yield return(new WaitForSeconds(2f));

        //ui.RemoveDark();
        //car.DisableMoving();
        car.DisableCarBorders();


        var startScale = car.transform.localScale;
        var startPos   = car.transform.position;
        var endScale   = new Vector3(0.7f, 0.7f, 0);
        var endPos     = new Vector3(-3.5f, -3.4f, 0);

        var gStartScale = garageBack.transform.localScale;
        var gStartPos   = garageBack.transform.position;
        var gEndScale   = new Vector3(1.25f, 1.25f, 0);
        var gEndPos     = new Vector3(-13f, -0.5f, 1);


        car.EnableWheels();

        for (float i = 0; i < 1.1f; i += 0.01f)
        {
            yield return(new WaitForSeconds(0.01f));

            car.transform.localScale = Vector3.Lerp(startScale, endScale, i);
            car.transform.position   = Vector3.Lerp(startPos, endPos, i);

            garageBack.transform.localScale = Vector3.Lerp(gStartScale, gEndScale, i);
            garageBack.transform.position   = Vector3.Lerp(gStartPos, gEndPos, i);
        }
        //garageBack.SetActive(false);

        StartCoroutine(AudioDecay());

        startPos = car.transform.position;
        endPos   = new Vector3(-3.5f, car.transform.position.y, 0);

        character.GetComponent <CharacterMovement>().enabled = true;
        character.GetComponent <CharacterMovement>().GoTo(car.transform.position);

        for (float i = 0; i < 1.1f; i += 0.01f)
        {
            yield return(new WaitForSeconds(1f));

            Debug.Log("Going char");
            if (isCharacterSeated)
            {
                break;
            }
            // car.transform.position = Vector3.Lerp(startPos, endPos, i);
        }

        character.gameObject.SetActive(false);
        car.DriverSit();
        levelSpeed.SetSpeedLevel(0, true);
        car.EnableStars();
        ui.TurnOnGameplayUI(0);
        try
        {
            FindObjectOfType <DreamSpawner>().UnBlock(false);
        }
        catch
        {
        }
    }