Browse Source

fix create location

Виктор Шейко 4 years ago
parent
commit
5311c86f16

+ 3 - 4
Assets/Scripts/Controllers/EditorController.cs

@@ -81,6 +81,7 @@ public class EditorController : MonoBehaviour
             newLocation = new Location
             {
                 id = uintNumber,
+                company_id=(uint)company.active_company,
                 location = NewLocation,
                 walls = new List<Wall>(),
                 zones = new List<Zone>(),
@@ -107,8 +108,6 @@ public class EditorController : MonoBehaviour
         //}
     }
 
-    string texture_url = "";
-
     /// <summary>
     /// Изменение размеров панели
     /// Загрузка текстуры
@@ -119,7 +118,7 @@ public class EditorController : MonoBehaviour
         //if (!Image.text.Equals(texture_url))
         //{
         StartCoroutine(SendingFormController.LoadImage(Image.text, p, Vector3.zero, Vector3.zero, LoadTexture));
-        texture_url = Image.text;
+        //texture_url = Image.text;
         //}
     }
 
@@ -159,7 +158,7 @@ public class EditorController : MonoBehaviour
             //var location = new Location { id = 0, name = Name.text, beacons = Beacons, zones = WallCreate.Zones, walls = WallCreate.Walls, texture_url = Image.text, plane = plane, location =  NewLocation};
             Location location;
             if (EditLocation.id != 0) location = EditLocation;
-            else location = new Location { id = Convert.ToUInt32(4000000000), plane = plane, location = NewLocation };
+            else location = new Location { id = Convert.ToUInt32(4000000000), plane = plane, location = NewLocation, company_id = (uint)company.active_company };
             location.name = Name.text;
             location.texture_url = Image.text;
 

+ 2 - 2
Assets/Scripts/Models/Location.cs

@@ -30,10 +30,10 @@ public class Location
         bw.Write(plane.transform.localScale.z);
         bw.Write(plane.transform.localPosition.x);
         bw.Write(plane.transform.localPosition.z);
-        bw.Write(company_id);       
+        bw.Write(Client.instance.company_id/*company_id*/);       
         bw.Write(urllen);
         bw.Write(urlb);
-
+        Debug.LogWarning($"save location id={id}, comapny id={company_id}");
         //ms.Write(bdata, 0, bdata.Length);
         //Debug.Log("imagesend bytes "+ms.ToArray().Length);
         var data = Client.ConstructVariablePacket(56, ms.ToArray());