Global Game Jam 2021
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
692 B

  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class HowToCycler : MonoBehaviour
  5. {
  6. [SerializeField]
  7. private GameObject[] m_AllPanels;
  8. private int m_count;
  9. private void OnEnable()
  10. {
  11. m_count = 0;
  12. foreach (GameObject panel in m_AllPanels)
  13. panel.SetActive(false);
  14. m_AllPanels[0].SetActive(true);
  15. }
  16. public void OnClickNext()
  17. {
  18. foreach(GameObject panel in m_AllPanels)
  19. panel.SetActive(false);
  20. m_count = (m_count + 1) % m_AllPanels.Length;
  21. m_AllPanels[m_count].SetActive(true);
  22. }
  23. private void OnClickBack()
  24. {
  25. }
  26. }