// Use this for initialization void Start() { GameObject go = GameObject.Instantiate(otterUfoPrefab); go.transform.parent = transform; ufoScript = go.GetComponent <MiniGame_DA_OtterUfo>(); timeToAppear *= timeFactor * 2 + Random.Range(-0.25f, 0.50f); distanceToFinish = 157; asteroids = new List <GameObject>(); // ! asteroids.Add(asteroid1Prefab); asteroids.Add(asteroid2Prefab); asteroids.Add(asteroid3Prefab); landscapes = new List <GameObject>(); landscapes.Add(landscape1Prefab); landscapes.Add(landscape2Prefab); landscapes.Add(landscape3Prefab); landscapes.Add(landscape4Prefab); //landscape = GameObject.Instantiate(landscapes[Random.Range(0,landscapes.Count)]); landscape = GameObject.Instantiate(landscape0Prefab); landscape.transform.parent = transform; stars = new List <GameObject>(); for (int i = 0; i < 30; i++) { go = GameObject.Instantiate(starPrefab); go.transform.parent = transform.FindChild("Sterne").transform; go.transform.localPosition = new Vector3(Random.Range(-8f, 8f), Random.Range(-4f, 6f), 0); float scale = Random.Range(-0.15f, 0.15f); go.transform.localScale = new Vector3(0.5f + scale, 0.5f + scale, 1); go.GetComponent <SpriteRenderer>().color = new Color(1f, 1f, 1f, 1 + scale * 2 - 0.3f); if (0.5f + scale <= 0.5f) { go.GetComponent <SpriteRenderer>().sortingOrder = 1; } stars.Add(go); } go = GameObject.Instantiate(mondPrefab); go.transform.parent = transform.FindChild("Sterne").transform; go.transform.localPosition = new Vector3(8, Random.Range(-2f, 3f), 0); mond = go; time = 0; time2 = 0; publicTimeFactor = timeFactor; mappedTimeFactor = 1 + ((0.45f - 1) / (0 - 1)) * (timeFactor - 1); style = GameObject.FindGameObjectWithTag("GameController").GetComponent <MainGame>().Style; }
// Use this for initialization void Start() { GameObject go = GameObject.Instantiate(otterUfoPrefab); go.transform.parent = transform; ufoScript = go.GetComponent<MiniGame_DA_OtterUfo>(); timeToAppear *= timeFactor * 2 + Random.Range(-0.25f, 0.50f); distanceToFinish = 157; asteroids = new List<GameObject>(); // ! asteroids.Add(asteroid1Prefab); asteroids.Add(asteroid2Prefab); asteroids.Add(asteroid3Prefab); landscapes = new List<GameObject>(); landscapes.Add(landscape1Prefab); landscapes.Add(landscape2Prefab); landscapes.Add(landscape3Prefab); landscapes.Add(landscape4Prefab); //landscape = GameObject.Instantiate(landscapes[Random.Range(0,landscapes.Count)]); landscape = GameObject.Instantiate(landscape0Prefab); landscape.transform.parent = transform; stars = new List<GameObject>(); for (int i = 0; i < 30; i++) { go = GameObject.Instantiate(starPrefab); go.transform.parent = transform.FindChild("Sterne").transform; go.transform.localPosition = new Vector3(Random.Range(-8f, 8f), Random.Range(-4f, 6f), 0); float scale = Random.Range(-0.15f, 0.15f); go.transform.localScale = new Vector3(0.5f + scale, 0.5f + scale, 1); go.GetComponent<SpriteRenderer>().color = new Color(1f, 1f, 1f, 1 + scale*2 - 0.3f); if (0.5f + scale <= 0.5f) go.GetComponent<SpriteRenderer>().sortingOrder = 1; stars.Add(go); } go = GameObject.Instantiate(mondPrefab); go.transform.parent = transform.FindChild("Sterne").transform; go.transform.localPosition = new Vector3(8, Random.Range(-2f, 3f), 0); mond = go; time = 0; time2 = 0; publicTimeFactor = timeFactor; mappedTimeFactor = 1 + ((0.45f - 1) / (0 - 1)) * (timeFactor - 1); style = GameObject.FindGameObjectWithTag("GameController").GetComponent<MainGame>().Style; }