Пример #1
0
    void Start()
    {
        limo  = GameObject.Find("Limo");
        Level = PlayerPrefs.GetInt("level", 1);
        levelText.GetComponent <Text>().text = "Level: " + Level;
        LimoHealth = 2;
        healthText.GetComponent <Text>().text = "Health: " + LimoHealth;

        gameStarted = false;
        distText    = DistanceText.GetComponent <Text>();

        tempDistance  = Random.Range(50, 100) * Level;
        distance      = Mathf.RoundToInt(tempDistance);
        distText.text = "Distance: " + distance;

        roadSpawner    = GameObject.Find("SpawnManager").GetComponent <RoadSpawner>();
        plotSpawner    = GameObject.Find("SpawnManager").GetComponent <PlotSpawner>();
        initAmount     = roadSpawner.roads.Count;
        tempChildCount = limo.transform.childCount;
    }
Пример #2
0
 void Start()
 {
     roadSpawner = GetComponent <RoadSpawner>();
     plotSpawner = GetComponent <PlotSpawner>();
 }