1
0

TEST.cs 573 B

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using UnityEngine;
  5. using ToneTuneToolkit.Common;
  6. /// <summary>
  7. ///
  8. /// </summary>
  9. public class TEST : MonoBehaviour
  10. {
  11. private EventListener<int> listenerTest = new EventListener<int>();
  12. private void Start()
  13. {
  14. listenerTest.OnValueChange += Test; // 发报纸给Test
  15. }
  16. private void OnDestroy()
  17. {
  18. listenerTest.OnValueChange -= Test; // 取消订阅
  19. }
  20. private void Test(int value)
  21. {
  22. Debug.Log(value);
  23. }
  24. public void GG()
  25. {
  26. listenerTest.Value += 1;
  27. }
  28. }