Browse Source

wall, zone, beacon id fix

Виктор Шейко 4 years ago
parent
commit
64cf5cae72

+ 3 - 3
Assets/Scripts/Components/WallCreate.cs

@@ -156,7 +156,7 @@ public class WallCreate : MonoBehaviour
                 var w = wall.transform.GetChild(i);
                 if(w.gameObject.activeSelf == true)
                 {
-                    currentWall = new Wall { id = (uint)Walls.Count,location_id = location_id, start_width = w.position.x, start_height = w.position.z, end_width = w.localScale.x, end_height = w.localScale.z, go = wall };
+                    currentWall = new Wall { id = Convert.ToUInt32(4000000000 + Walls.Count),location_id = location_id, start_width = w.position.x, start_height = w.position.z, end_width = w.localScale.x, end_height = w.localScale.z, go = wall };
                     Walls[location_id].Add(currentWall);
                 }
             }
@@ -165,7 +165,7 @@ public class WallCreate : MonoBehaviour
         //if (mode == Mode.Room) Rooms.Add(currentWall);
         if (mode == Mode.Wall)
         {
-            currentWall = new Wall { id = (uint)Walls.Count, start_width = start_pos.x, start_height = start_pos.z, end_width = scale_x, end_height = scale_z, go = wall };
+            currentWall = new Wall { id =Convert.ToUInt32(4000000000 + Walls.Count), start_width = start_pos.x, start_height = start_pos.z, end_width = scale_x, end_height = scale_z, go = wall };
             Walls[location_id].Add(currentWall);
         }
         
@@ -227,7 +227,7 @@ public class WallCreate : MonoBehaviour
         var active_zone = Zones.Count;
 
         
-        if(z == null) z = new Zone { id=(uint)Zones.Count, go=zone, buttons = panel_button, location_id=(uint) location_id };   
+        if(z == null) z = new Zone { id= Convert.ToUInt32(4000000000 + Zones.Count), go=zone, buttons = panel_button, location_id=(uint) location_id };   
         else
         {
             zone.transform.position = new Vector3(z.start_height, 0.05f, z.start_width);

+ 1 - 0
Assets/Scripts/Controllers/EditorController.cs

@@ -292,6 +292,7 @@ public class EditorController : MonoBehaviour
         var button_ok = PanelBeaconEdit.transform.GetChild(7).transform.GetChild(0).GetComponent<Button>();
         button_ok.onClick.AddListener(() =>
         {
+            b.id = Convert.ToUInt32(4000000000 + Beacons.Count);
             b.uuid = PanelBeaconEdit.transform.GetChild(1).GetComponent<InputField>().text;
             b.minor = ushort.Parse(PanelBeaconEdit.transform.GetChild(2).GetComponent<InputField>().text);
             b.major = ushort.Parse(PanelBeaconEdit.transform.GetChild(3).GetComponent<InputField>().text);