SelectSceneBtn.cs 412 B

12345678910111213141516
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class SelectSceneBtn : MonoBehaviour
  6. {
  7. public Toggle toggle;
  8. public Text label;
  9. public void Init(ScenesPage scene)
  10. {
  11. toggle.onValueChanged.AddListener(_=> { SelectScene.Instance.selectSceneId = scene.id; });
  12. label.text = scene.name;
  13. toggle.isOn = false;
  14. }
  15. }