SunBursts.cs 876 B

1234567891011121314151617181920212223242526
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. /// <summary>
  5. /// Switches on all objects in its list slowly, pausing two seconds on each one.
  6. /// Used in the ZED planetarium sample to stagger the animations of the 18 SunBurstRoot objects on the sun.
  7. /// </summary>
  8. public class SunBursts : MonoBehaviour
  9. {
  10. /// <summary>
  11. /// All objects to be turned on, in order. Script assumes they begin disabled.
  12. /// </summary>
  13. [Tooltip("All objects to be turned on, in order. Script assumes they begin disabled.")]
  14. public List<GameObject> sunBurstsGO = new List<GameObject>();
  15. // Use this for initialization
  16. IEnumerator Start ()
  17. {
  18. for (int i = 0; i < sunBurstsGO.Count; i++)
  19. {
  20. yield return new WaitForSeconds(2f);
  21. sunBurstsGO[i].SetActive(true);
  22. }
  23. }
  24. }