Пример #1
0
    public void ResetToRandom()
    {
        moves          = startMoves;
        movesText.text = "Moves: " + moves.ToString();
        movesPossible  = true;
        ball.gameObject.SetActive(true);
        ball.transform.position = ball.startPos;

        ball.rigidbodyThis.velocity        = Vector3.zero;
        ball.rigidbodyThis.angularVelocity = Vector3.zero;
        allObsticles.RandomizeObsticles();
        allObsticles.levelObsticleMovmentType = (ObsticleMovementType)(int)Random.Range(0, 3);
        allObsticles.SetObsticles();
        allTargets.RandomizeTargets();
        allTargets.SetTargets();

        targetNumber = allTargets.targetNumber;
        StartCoroutine("TillTargetsSet");
        gamePanel.SetActive(true);
        losePanel.SetActive(false);
        winPanel.SetActive(false);
        Time.timeScale = 1;
        timer          = 0;
        inputAllowed   = false;
    }