public void Awake() { for (int i = 0; i < globalSettings.levelGroupingSettings.Length; i++) { CollectionObjectScript spawnedCollection = Instantiate((globalSettings.levelGroupingSettings[i].CollectionPrefab), this.transform).GetComponent <CollectionObjectScript>(); collectionObjects.Add(spawnedCollection); spawnedCollection.gameObject.name += "" + i.ToString(); spawnedCollection.PopulateLevels(globalSettings.levelGroupingSettings[i]); // run level population function on collection object bottomSpaceFiller.transform.SetSiblingIndex(i + 1); } }
private IEnumerator animatedScrollUp(float newYValue, float currentViewportYpos, CollectionObjectScript collection) { yield return(new WaitForSeconds(1f)); while (true) { contentPanel.anchoredPosition = new Vector2(0, currentViewportYpos); currentViewportYpos -= 10 * (Time.deltaTime * 200); yield return(new WaitForEndOfFrame()); if (currentViewportYpos <= newYValue) { // show sparkles & tick collection.Tick(); collection.ShowSparkles(); yield return(new WaitForSeconds(2)); SceneActivationBehaviour <OverlayUISceneActivator> .Instance.ToggleBlocker(false); yield break; } } }