Merge branch 'master' of http://git.umayle.com:2023/yulong/NewN_UAVPlane
This commit is contained in:
commit
3aae7026ec
|
@ -9,15 +9,50 @@ public class DeviceManager : MonoSingleton<DeviceManager>
|
|||
/// 所有设备
|
||||
/// </summary>
|
||||
public List<EquipmentCommon> devices = new List<EquipmentCommon>();
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
SyncCreateRoom.send2roomRequset += GetSend2roomMsg;
|
||||
}
|
||||
/// <summary>
|
||||
/// 发送消息
|
||||
/// </summary>
|
||||
public Queue<string> send2roomStr = new Queue<string>();
|
||||
|
||||
private bool _isStartRehearsing = false;
|
||||
// 属性绑定布尔值,并在值变化时触发事件
|
||||
public bool isStartRehearsing
|
||||
{
|
||||
get { return _isStartRehearsing; }
|
||||
set
|
||||
{
|
||||
if (_isStartRehearsing != value)
|
||||
{
|
||||
_isStartRehearsing = value;
|
||||
OnActivationChanged?.Invoke(_isStartRehearsing);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 布尔值变化时触发的事件
|
||||
public event System.Action<bool> OnActivationChanged;
|
||||
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
SyncCreateRoom.send2roomRequset += GetSend2roomMsg;
|
||||
|
||||
// 订阅布尔值变化事件
|
||||
OnActivationChanged += OnActivationChangedHandler;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导条 暂停开始控制
|
||||
/// </summary>
|
||||
/// <param name="newValue"></param>
|
||||
void OnActivationChangedHandler(bool newValue)
|
||||
{
|
||||
devices.ForEach(x => x.isStartRehearsing = newValue);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (send2roomStr.Count > 0)
|
||||
|
|
Loading…
Reference in New Issue