示例#1
0
 private void Awake()
 {
     slider         = GetComponent <Slider>();
     starsGenerator = GameObject.FindGameObjectWithTag("StarsGenerator").GetComponent <StarsGenerator>();
     slider.value   = starsGenerator.Speed;
     slider.onValueChanged.AddListener(delegate { ValueChangeCheck(); });
 }
示例#2
0
    // 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>();
    }