1234567891011121314151617181920212223242526272829303132333435363738 |
- using System.Collections.Generic;
- using Blue;
- using UnityEngine;
- /// <summary>
- /// 服务于三级菜单,用于统一开关
- /// </summary>
- public interface IQueueSystem : IService
- {
- BindableProperty<int> Level3QueueCount { get; }
- HashSet<GameObject> Level3List{ get;}
- void Add(GameObject go);
- void Remove(GameObject go);
- }
- public class QueueSystem : IQueueSystem
- {
- public BindableProperty<int> Level3QueueCount { get; set; } = new BindableProperty<int>();
- public HashSet<GameObject> Level3List { get; set; } = new HashSet<GameObject>();
- public void OnInit()
- {
- }
- public void Add(GameObject go)
- {
- Level3List.Add(go);
- Level3QueueCount.Value = Level3List.Count;
- }
- public void Remove(GameObject go)
- {
- Level3List.Remove(go);
- Level3QueueCount.Value = Level3List.Count;
- }
- }
|