IQueueSystem.cs 792 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System.Collections.Generic;
  2. using Blue;
  3. using UnityEngine;
  4. public interface IQueueSystem : IService
  5. {
  6. BindableProperty<int> Level3QueueCount { get; }
  7. HashSet<GameObject> Level3List{ get;}
  8. void Add(GameObject go);
  9. void Remove(GameObject go);
  10. }
  11. public class QueueSystem : IQueueSystem
  12. {
  13. public BindableProperty<int> Level3QueueCount { get; set; } = new BindableProperty<int>();
  14. public HashSet<GameObject> Level3List { get; set; } = new HashSet<GameObject>();
  15. public void OnInit()
  16. {
  17. }
  18. public void Add(GameObject go)
  19. {
  20. Level3List.Add(go);
  21. Level3QueueCount.Value = Level3List.Count;
  22. }
  23. public void Remove(GameObject go)
  24. {
  25. Level3List.Remove(go);
  26. Level3QueueCount.Value = Level3List.Count;
  27. }
  28. }