private void Awake() { slider = GetComponent <Slider>(); starsGenerator = GameObject.FindGameObjectWithTag("StarsGenerator").GetComponent <StarsGenerator>(); slider.value = starsGenerator.Speed; slider.onValueChanged.AddListener(delegate { ValueChangeCheck(); }); }
// Use this for initialization void Start() { platformWidths = new float[theObjectPools.Length]; for (int i = 0; i < theObjectPools.Length; i++) { platformWidths[i] = theObjectPools[i].pooledObject.GetComponent <BoxCollider2D>().size.x; } minHeight = transform.position.y; maxHeight = maxHeightPoint.position.y; theStarsGenerator = FindObjectOfType <StarsGenerator>(); }