IQueueSystem.cs 868 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections.Generic;
  2. using Blue;
  3. using UnityEngine;
  4. /// <summary>
  5. /// 服务于三级菜单,用于统一开关
  6. /// </summary>
  7. public interface IQueueSystem : IService
  8. {
  9. BindableProperty<int> Level3QueueCount { get; }
  10. HashSet<GameObject> Level3List{ get;}
  11. void Add(GameObject go);
  12. void Remove(GameObject go);
  13. }
  14. public class QueueSystem : IQueueSystem
  15. {
  16. public BindableProperty<int> Level3QueueCount { get; set; } = new BindableProperty<int>();
  17. public HashSet<GameObject> Level3List { get; set; } = new HashSet<GameObject>();
  18. public void OnInit()
  19. {
  20. }
  21. public void Add(GameObject go)
  22. {
  23. Level3List.Add(go);
  24. Level3QueueCount.Value = Level3List.Count;
  25. }
  26. public void Remove(GameObject go)
  27. {
  28. Level3List.Remove(go);
  29. Level3QueueCount.Value = Level3List.Count;
  30. }
  31. }