12345678910111213141516171819202122232425262728 |
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class LuJingItem : MonoBehaviour
- {
- public event Action<int, bool> OnToggleSelect;
- public Toggle Toggle;
- public int Index { get; set; }
- private void Awake()
- {
- Toggle = GetComponent<Toggle>();
- Toggle.onValueChanged.AddListener(OnToggleValueChange);
- }
- private void OnToggleValueChange(bool ison)
- {
- if (OnToggleSelect != null)
- {
- OnToggleSelect(Index, ison);
- }
- }
- }
|