This commit is contained in:
YangHua 2024-02-29 22:31:33 +08:00
parent 55a7e3e109
commit b3743f199c
1 changed files with 5 additions and 3 deletions

View File

@ -30,6 +30,7 @@ public class FormationManager : MonoSingleton<FormationManager>
// 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<FormationManager>
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($"<color=blue>{infoTemp}</color>");
formationIDs.Clear();
CheckBtns(0);
}
@ -196,6 +197,7 @@ public class FormationManager : MonoSingleton<FormationManager>
private char[] separators = { ',' }; // 设置分隔符为逗号
public void OnReciveMsg(string reciveInfo)
{
Debug.Log($"<color=blue>{reciveInfo}</color>");
List<UnmannedAerialVehicleManage> uavms = GetAllWRJ();
var result = reciveInfo.Split(separators) // 对字符串进行切割操作