diff --git a/Assets/Zion/Scripts/Adam/FormationManager.cs b/Assets/Zion/Scripts/Adam/FormationManager.cs index 543e8313..49602b4f 100644 --- a/Assets/Zion/Scripts/Adam/FormationManager.cs +++ b/Assets/Zion/Scripts/Adam/FormationManager.cs @@ -30,6 +30,7 @@ public class FormationManager : MonoSingleton // Start is called before the first frame update void Start() { + SyncCreateRoom.send2roomRequset += OnReciveMsg; startFormationBtn.onClick.AddListener(OnStartFormation); submitFormationBtn.onClick.AddListener(OnSubmit); cancelFormationBtn.onClick.AddListener(OnCancel); @@ -183,12 +184,12 @@ public class FormationManager : MonoSingleton isStartFormation = false; string infoTemp = ""; - for (int i = 0; i < formationInfo.uavms.Count; i++) + for (int i = 0; i < formationIDs.Count; i++) { - infoTemp += formationInfo.uavms[i].equipmentCommon.deviceID + ","; + infoTemp += formationIDs[i] + ","; } SendGroupToOther(formationInfos.Count.ToString(), infoTemp); - Debug.Log($"{infoTemp}"); + formationIDs.Clear(); CheckBtns(0); } @@ -196,6 +197,7 @@ public class FormationManager : MonoSingleton private char[] separators = { ',' }; // 设置分隔符为逗号 public void OnReciveMsg(string reciveInfo) { + Debug.Log($"{reciveInfo}"); List uavms = GetAllWRJ(); var result = reciveInfo.Split(separators) // 对字符串进行切割操作