|
@@ -809,6 +809,34 @@ public class Client : MonoBehaviour
|
|
|
WorkerController.users_load = true;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ public static void BeaconsSave(byte[] bytedata, StateObject state)
|
|
|
+ {
|
|
|
+ GameObject canvas = GameObject.Find("Canvas");
|
|
|
+ if (canvas != null)
|
|
|
+ {
|
|
|
+ var e2c = canvas.GetComponent<Editor2DController>();
|
|
|
+ var beacons = e2c.Beacons;
|
|
|
+ if (beacons.Count > 0)
|
|
|
+ {
|
|
|
+
|
|
|
+ List<byte> list = new List<byte>();
|
|
|
+ list.Add(49);
|
|
|
+
|
|
|
+ foreach (var b in beacons)
|
|
|
+ {
|
|
|
+ list.AddRange(BitConverter.GetBytes(b.id));
|
|
|
+ list.AddRange(BitConverter.GetBytes(b.x));
|
|
|
+ list.AddRange(BitConverter.GetBytes(b.y));
|
|
|
+ list.AddRange(BitConverter.GetBytes(b.z));
|
|
|
+ }
|
|
|
+
|
|
|
+ byte[] tosend = list.ToArray();
|
|
|
+ SendEnqueue(list.ToArray());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public void BeaconsReceive(byte[] bytedata)
|
|
|
{
|
|
|
int read = 5;
|