Browse Source

save zones

Виктор Шейко 4 years ago
parent
commit
9f9f98dcda

+ 229 - 18
Assets/Scenes/Player.unity

@@ -7399,7 +7399,7 @@ RectTransform:
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
+  m_AnchorMax: {x: 0.99991804, y: 1}
   m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 20, y: 20}
   m_Pivot: {x: 0.5, y: 0.5}
@@ -10654,7 +10654,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 1
+  m_IsActive: 0
 --- !u!224 &935354066
 RectTransform:
   m_ObjectHideFlags: 0
@@ -10667,13 +10667,14 @@ RectTransform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children:
   - {fileID: 1460553589}
+  - {fileID: 1857692568}
   m_Father: {fileID: 100471033}
   m_RootOrder: 7
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 1, y: 0.5}
   m_AnchorMax: {x: 1, y: 0.5}
-  m_AnchoredPosition: {x: -85, y: -205}
-  m_SizeDelta: {x: 0, y: 0}
+  m_AnchoredPosition: {x: -85, y: -180}
+  m_SizeDelta: {x: 168, y: 200}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &935354067
 MonoBehaviour:
@@ -11937,6 +11938,9 @@ MonoBehaviour:
   DatePicker: {fileID: 3789338435055865494}
   projection: {fileID: 2062404954}
   Locations: {fileID: 1977324416}
+  Dialog: {fileID: 3538187245544653788}
+  ZonesScroll: {fileID: 1296382291}
+  load_location: 1
 --- !u!1 &1010503890
 GameObject:
   m_ObjectHideFlags: 0
@@ -15797,8 +15801,8 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 1}
   m_AnchorMax: {x: 1, y: 1}
-  m_AnchoredPosition: {x: 32.73681, y: 0}
-  m_SizeDelta: {x: -133, y: 0}
+  m_AnchoredPosition: {x: -0.00006154367, y: 0}
+  m_SizeDelta: {x: -133, y: 10}
   m_Pivot: {x: 0, y: 1}
 --- !u!114 &1296382293
 MonoBehaviour:
@@ -17726,7 +17730,7 @@ RectTransform:
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
+  m_AnchorMax: {x: 1, y: 1}
   m_AnchoredPosition: {x: 0, y: 0}
   m_SizeDelta: {x: 20, y: 20}
   m_Pivot: {x: 0.5, y: 0.5}
@@ -17801,9 +17805,9 @@ RectTransform:
   m_RootOrder: 2
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 1, y: 0}
-  m_AnchorMax: {x: 1, y: 0}
+  m_AnchorMax: {x: 1, y: 1}
   m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 20, y: 0}
+  m_SizeDelta: {x: 20, y: -17}
   m_Pivot: {x: 1, y: 1}
 --- !u!114 &1417318866
 MonoBehaviour:
@@ -18421,9 +18425,9 @@ RectTransform:
   m_Father: {fileID: 935354066}
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
-  m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 0, y: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 84, y: -84}
   m_SizeDelta: {x: 160, y: 160}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!114 &1460553590
@@ -21128,6 +21132,83 @@ Transform:
   m_Father: {fileID: 1998721015}
   m_RootOrder: 3
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
+--- !u!1 &1619201253
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1619201254}
+  - component: {fileID: 1619201256}
+  - component: {fileID: 1619201255}
+  m_Layer: 5
+  m_Name: Text
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &1619201254
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1619201253}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children: []
+  m_Father: {fileID: 1857692568}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 0}
+  m_AnchorMax: {x: 1, y: 1}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 0, y: 0}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &1619201255
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1619201253}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_FontData:
+    m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
+    m_FontSize: 14
+    m_FontStyle: 0
+    m_BestFit: 0
+    m_MinSize: 10
+    m_MaxSize: 40
+    m_Alignment: 4
+    m_AlignByGeometry: 0
+    m_RichText: 1
+    m_HorizontalOverflow: 0
+    m_VerticalOverflow: 0
+    m_LineSpacing: 1
+  m_Text: "\u0421\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u044C \u0437\u043E\u043D\u044B"
+--- !u!222 &1619201256
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1619201253}
+  m_CullTransparentMesh: 0
 --- !u!1 &1621443592
 GameObject:
   m_ObjectHideFlags: 0
@@ -21496,9 +21577,9 @@ RectTransform:
   m_RootOrder: 0
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
+  m_AnchorMax: {x: 1, y: 1}
   m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 0, y: 0}
+  m_SizeDelta: {x: -17, y: -17}
   m_Pivot: {x: 0, y: 1}
 --- !u!114 &1638995564
 MonoBehaviour:
@@ -23230,7 +23311,6 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: 3e845f46ea55e1e479654a3213fd5cf9, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  WallHeight: 1
   WallThickness: 0.05
   Rounding: 1
   move: 0
@@ -23520,9 +23600,9 @@ RectTransform:
   m_RootOrder: 1
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
-  m_AnchorMax: {x: 0, y: 0}
+  m_AnchorMax: {x: 1, y: 0}
   m_AnchoredPosition: {x: 0, y: 0}
-  m_SizeDelta: {x: 0, y: 20}
+  m_SizeDelta: {x: -17, y: 20}
   m_Pivot: {x: 0, y: 0}
 --- !u!114 &1785601451
 MonoBehaviour:
@@ -23567,7 +23647,7 @@ MonoBehaviour:
   m_HandleRect: {fileID: 622982002}
   m_Direction: 0
   m_Value: 0
-  m_Size: 0.68613416
+  m_Size: 0.99991804
   m_NumberOfSteps: 0
   m_OnValueChanged:
     m_PersistentCalls:
@@ -25083,6 +25163,135 @@ Transform:
   m_Father: {fileID: 1998721015}
   m_RootOrder: 9
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 90}
+--- !u!1 &1857692567
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1857692568}
+  - component: {fileID: 1857692571}
+  - component: {fileID: 1857692570}
+  - component: {fileID: 1857692569}
+  m_Layer: 5
+  m_Name: Button_ZonesSave
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &1857692568
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1857692567}
+  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_Children:
+  - {fileID: 1619201254}
+  m_Father: {fileID: 935354066}
+  m_RootOrder: 1
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 84, y: -181}
+  m_SizeDelta: {x: 160, y: 30}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &1857692569
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1857692567}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Navigation:
+    m_Mode: 3
+    m_SelectOnUp: {fileID: 0}
+    m_SelectOnDown: {fileID: 0}
+    m_SelectOnLeft: {fileID: 0}
+    m_SelectOnRight: {fileID: 0}
+  m_Transition: 1
+  m_Colors:
+    m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
+    m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
+    m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
+    m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
+    m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
+    m_ColorMultiplier: 1
+    m_FadeDuration: 0.1
+  m_SpriteState:
+    m_HighlightedSprite: {fileID: 0}
+    m_PressedSprite: {fileID: 0}
+    m_SelectedSprite: {fileID: 0}
+    m_DisabledSprite: {fileID: 0}
+  m_AnimationTriggers:
+    m_NormalTrigger: Normal
+    m_HighlightedTrigger: Highlighted
+    m_PressedTrigger: Pressed
+    m_SelectedTrigger: Selected
+    m_DisabledTrigger: Disabled
+  m_Interactable: 1
+  m_TargetGraphic: {fileID: 1857692570}
+  m_OnClick:
+    m_PersistentCalls:
+      m_Calls:
+      - m_Target: {fileID: 1761650666}
+        m_MethodName: SaveZones
+        m_Mode: 1
+        m_Arguments:
+          m_ObjectArgument: {fileID: 0}
+          m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
+          m_IntArgument: 0
+          m_FloatArgument: 0
+          m_StringArgument: 
+          m_BoolArgument: 0
+        m_CallState: 2
+--- !u!114 &1857692570
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1857692567}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
+  m_Type: 1
+  m_PreserveAspect: 0
+  m_FillCenter: 1
+  m_FillMethod: 4
+  m_FillAmount: 1
+  m_FillClockwise: 1
+  m_FillOrigin: 0
+  m_UseSpriteMesh: 0
+  m_PixelsPerUnitMultiplier: 1
+--- !u!222 &1857692571
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1857692567}
+  m_CullTransparentMesh: 0
 --- !u!1 &1861851629
 GameObject:
   m_ObjectHideFlags: 0
@@ -26446,6 +26655,7 @@ MonoBehaviour:
   Beacons: {fileID: 143457022}
   Walls: {fileID: 1740594263}
   WallCursor: {fileID: 8002323671399922969}
+  Zones: {fileID: 935354065}
 --- !u!1 &1953380811
 GameObject:
   m_ObjectHideFlags: 0
@@ -28862,6 +29072,7 @@ MonoBehaviour:
   Password: {fileID: 970171090373747829}
   Error: {fileID: 970171088933971315}
   loading: {fileID: 1263637075}
+  player: {fileID: 0}
 --- !u!222 &970171088642886945
 CanvasRenderer:
   m_ObjectHideFlags: 0

+ 15 - 7
Assets/Scripts/Components/WallCreate.cs

@@ -7,7 +7,7 @@ using UnityEngine.UI;
 
 public class WallCreate : MonoBehaviour
 {    
-    public float WallHeight = 1f;
+    public static float WallHeight = 1f;
     public float WallThickness = 0.05f;
     public int Rounding = 1;
     public bool move = false;
@@ -75,7 +75,7 @@ public class WallCreate : MonoBehaviour
                     wall = AddRoom();
                     break;
                 case Mode.Zone:
-                    wall = AddZone();
+                    wall = AddZone(Dialog, Player, ZonesScroll);
                     break;
             }
         }
@@ -159,10 +159,11 @@ public class WallCreate : MonoBehaviour
         }                
     }
 
-    GameObject AddWall(Vector3 pos)
+    public static GameObject AddWall(Vector3 pos, Vector3 scale = default)
     {
         var wall = Instantiate(Resources.Load("GameObjects/Pole", typeof(GameObject))) as GameObject;
         wall.transform.position = pos;
+        if(scale != null) wall.transform.localScale = scale;
         wall.transform.SetParent(GameObject.Find("Walls").transform);
         Walls.Add(wall);
         return wall;
@@ -180,7 +181,7 @@ public class WallCreate : MonoBehaviour
         return room;
     }
 
-    GameObject AddZone()
+    public static GameObject AddZone(GameObject Dialog, GameObject Player, GameObject ZonesScroll)
     {
         var zone = Instantiate(Resources.Load("GameObjects/Zone", typeof(GameObject))) as GameObject;
         //zone.transform.position = pos;
@@ -188,9 +189,8 @@ public class WallCreate : MonoBehaviour
 
         var panel_button = Instantiate(Resources.Load("GameObjects/Panel_Beacon", typeof(GameObject))) as GameObject;
         panel_button.transform.SetParent(ZonesScroll.transform);
-        //panel_button.name = $"Beacon_{b?.id.ToString() ?? Beacons.Count.ToString()}";
+        panel_button.name = $"Zone_{Zones.Count}";
         var button = panel_button.transform.GetChild(0).GetComponent<Button>();
-        button.name = $"Zone_{Zones.Count}";
         button.transform.GetChild(0).GetComponent<Text>().text = $"Зона {Zones.Count + 1}";
         zone.GetComponent<ZoneController>().TextMesh.text = $"Зона {Zones.Count+1}";
         var active_zone = Zones.Count;
@@ -211,7 +211,7 @@ public class WallCreate : MonoBehaviour
 
             button_ok.onClick.AddListener(() =>
             {                                
-                button.transform.GetChild(0).GetComponent<Text>().text = $"Зона {active_zone + 1}";
+                button.transform.GetChild(0).GetComponent<Text>().text = !Dialog.GetComponent<Dialog>().InputField.text.Equals("") ? Dialog.GetComponent<Dialog>().InputField.text : $"Зона {active_zone + 1}";
                 zone.GetComponent<ZoneController>().TextMesh.text = !Dialog.GetComponent<Dialog>().InputField.text.Equals("") ? Dialog.GetComponent<Dialog>().InputField.text : $"Зона {active_zone + 1}";
                 Dialog.SetActive(false);
             });           
@@ -228,4 +228,12 @@ public class WallCreate : MonoBehaviour
         Zones.Add(z);
         return zone;
     }
+
+    public void SaveZones()
+    {
+        foreach(var z in Zones)
+        {
+            z.Save();
+        }
+    }
 }

+ 5 - 4
Assets/Scripts/Controllers/AuthorizationController.cs

@@ -17,12 +17,14 @@ public class AuthorizationController : MonoBehaviour
     public static bool error = false; // маяк для client
     static string textError = "Неправильный логин или пароль";
 
-    Client client;
+    public GameObject player;
+
+    //Client client;
 
     // Start is called before the first frame update
     void Start()
     {
-        client = Client.instance;
+        //client = Client.instance;
         var waslogin = PlayerPrefs.GetString("lastlogin");
         var waspass = PlayerPrefs.GetString("lastpass");
 
@@ -31,7 +33,7 @@ public class AuthorizationController : MonoBehaviour
         if (waspass != null)
             Password.text = waspass;
 
-        DebugHelper.ActivateConsole();
+        DebugHelper.ActivateConsole();        
     }
 
     // Update is called once per frame
@@ -41,7 +43,6 @@ public class AuthorizationController : MonoBehaviour
         {//SceneManager.LoadScene("Location");
             transform.gameObject.SetActive(false);
             //client.SendGetUsers((uint)PlayerController.active_company + 1);
-           
             //if (ModeController.editor == true && PlayerController.active_location != PlayerController.locations.Count) client.BeaconsRequest((uint)PlayerController.locations[PlayerController.active_location].id);
             //if (ModeController.editor == false) client.BeaconsRequest((uint)PlayerController.locations[PlayerController.active_location].id);
         }

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

@@ -68,7 +68,7 @@ public class EditorController : MonoBehaviour
         }
 
 
-        PlayerController.LoadMaps(client, DropdownLocation, Locations.gameObject);
+        PlayerController.LoadMaps(DropdownLocation, Locations.gameObject);
     }
 
     public void UpdatePanel()

+ 4 - 1
Assets/Scripts/Controllers/ModeController.cs

@@ -19,6 +19,7 @@ public class ModeController : MonoBehaviour
     public GameObject Beacons;
     public GameObject Walls;
     public GameObject WallCursor;
+    public GameObject Zones;
 
     Transform maps;
 
@@ -71,6 +72,7 @@ public class ModeController : MonoBehaviour
         Plane.SetActive(false);
         Grid.SetActive(false);
         Walls.SetActive(false);
+        Zones.SetActive(false);
 
         Destroy(GameObject.Find("SizeX"));
         Destroy(GameObject.Find("SizeY"));
@@ -123,7 +125,8 @@ public class ModeController : MonoBehaviour
         Plane.SetActive(true);
         Grid.SetActive(true);
         Walls.SetActive(true);
-        
+        Zones.SetActive(true);
+
         maps.transform.SetParent(Editor.transform);
         maps.transform.SetSiblingIndex(0);
         maps.GetComponent<RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, 190);

+ 44 - 14
Assets/Scripts/Controllers/PlayerController.cs

@@ -30,7 +30,7 @@ public class PlayerController : MonoBehaviour
     public GameObject EndSec;
     public GameObject StartStopButton;
     public GameObject ErrorDialog;
-   // public GameObject ButtonPlay;
+    // public GameObject ButtonPlay;
     public Dropdown DropdownMode;
     public Toggle ToggleLine;
     public Toggle ToggleDisappearance;
@@ -38,6 +38,8 @@ public class PlayerController : MonoBehaviour
     Camera camera;
     public Toggle projection;
     public GameObject Locations;
+    public GameObject Dialog;
+    public GameObject ZonesScroll;
 
     public enum Mode { RealTime = 0, History = 1, Stop = 2 };
     public static Mode active_mode = Mode.Stop;
@@ -59,7 +61,7 @@ public class PlayerController : MonoBehaviour
     public static List<User> users = new List<User>();
     public static bool users_load = false;
     public static bool beacons_load = false;
-    public static  List<Location> locations;
+    public static List<Location> locations;
     public static List<Marker> markers;
 
     //List<bool> StartStop = new List<bool>();
@@ -74,23 +76,24 @@ public class PlayerController : MonoBehaviour
         markers = new List<Marker>();
         locations = new List<Location>();
 
-        Date = DatePicker.GetComponent<DateTimePicker>();
+        //Date = DatePicker.GetComponent<DateTimePicker>();
         locations.Add(new Location { id = 1, name = "1 Братск" });
         locations.Add(new Location { id = 22, name = "22 Офис Ижевск" });
         locations.Add(new Location { id = 25, name = "25" });
         locations.Add(new Location { id = 26, name = "26 Братское (вагрант)" });
         foreach (var l in locations)
-        DropdownLocation.options.Add(new Dropdown.OptionData(l.name));
-        
+            DropdownLocation.options.Add(new Dropdown.OptionData(l.name));
+
         //for (int i = 0; i < Locations.transform.childCount; i++)
         //    maps.Add(Locations.transform.GetChild(i).gameObject);
 
         DropdownCompany.options.Add(new Dropdown.OptionData("Тайшет"));
         DropdownCompany.options.Add(new Dropdown.OptionData("Тестовая"));
         DropdownCompany.options.Add(new Dropdown.OptionData("Братское"));
-      
+
     }
 
+    public bool load_location = true;
     public static int active_location = -1;
     public static int active_company = -1;
     // Update is called once per frame
@@ -117,17 +120,17 @@ public class PlayerController : MonoBehaviour
             }
         }
 
-        if(active_company != DropdownCompany.value && AuthorizationController.success)
+        if (active_company != DropdownCompany.value && AuthorizationController.success)
         {
             active_company = DropdownCompany.value;
-            foreach(var m in markers)
+            foreach (var m in markers)
             {
                 Destroy(m.marker.gameObject);
                 Destroy(m.marker_line.gameObject);
                 Destroy(m.toggle.gameObject);
             }
             markers = new List<Marker>();
-            client.SendGetUsers((uint) active_company + 1);
+            client.SendGetUsers((uint)active_company + 1);
         }
 
         time_draw += Time.deltaTime;
@@ -155,7 +158,7 @@ public class PlayerController : MonoBehaviour
                         starting = false;
                     }
                 }
-            }                
+            }
 
             time_draw -= interpolationPeriod;
         }
@@ -164,7 +167,7 @@ public class PlayerController : MonoBehaviour
         if (active_mode == Mode.RealTime /*&& !inputField_location.text.Equals("")*/ /*&& time_realtime >= interpolationPeriod*/ && !starting)
         {
             //time_realtime -= interpolationPeriod;
-            
+
             //var location_id = uint.Parse(inputField_location.text);
             foreach (var m in markers)
             {
@@ -209,8 +212,33 @@ public class PlayerController : MonoBehaviour
                 WorkerMarker(u, Color.green);
         }
 
-        LoadMaps(client, DropdownLocation, Locations);
-    }   
+        LoadMaps(DropdownLocation, Locations);
+        //if (AuthorizationController.success && load_location)
+        //{
+        //    load_location = false;
+        //    foreach (var l in locations)
+        //        l.Load();
+        //}
+
+        if (locations.Any() && AuthorizationController.success)
+        {
+            if (locations[active_company].walls != null)
+
+                //foreach (var w in locations[active_company].walls)
+                //{
+                //    //{ start_width = start_pos.x, start_height = start_pos.z, end_width = scale_x, end_height = scale_z, go = wall };
+                //    WallCreate.AddWall(new Vector3(w.start_height, WallCreate.WallHeight / 2, w.start_width), new Vector3(w.end_height, WallCreate.WallHeight, w.end_width));
+                //}
+
+            if(locations[active_company].zones != null)
+                foreach (var w in locations[active_company].zones)
+                {
+                    //{ start_width = start_pos.x, start_height = start_pos.z, end_width = scale_x, end_height = scale_z, go = wall };
+                    WallCreate.AddZone(Dialog, gameObject, ZonesScroll);
+                }
+        }
+    }
+
 
     /// <summary>
     /// Создание маркера для сотрудника
@@ -431,13 +459,15 @@ public class PlayerController : MonoBehaviour
             DebugHelper.DrawConsole();
     }
 
-    public static void LoadMaps(Client client, Dropdown DropdownLocation, GameObject Locations)
+    public static void LoadMaps(Dropdown DropdownLocation, GameObject Locations)
     {
         if (active_location != DropdownLocation.value && AuthorizationController.success)
         {
             if(active_location >= 0)Locations.transform.GetChild(active_location).gameObject.SetActive(false);
             Locations.transform.GetChild(DropdownLocation.value).gameObject.SetActive(true);
             active_location = DropdownLocation.value;
+            
+            if (locations[active_location].walls == null) locations[active_location].Load();
 
             foreach (var b in Beacons)
             {

+ 1 - 0
Assets/Scripts/Models/Beacon.cs

@@ -9,6 +9,7 @@ using UnityEngine.UI;
 public class Beacon
 {
     public uint id { get; set; }
+    public uint location_id { get; set; }
     public float x { get; set; }
     public float y { get; set; }
     public float z { get; set; } // этаж

+ 5 - 0
Assets/Scripts/Models/Wall.cs

@@ -11,6 +11,7 @@ using UnityEngine;
 public class Wall
 {
     public uint id = 0;
+    public uint location_id {get;set;}
     public float start_width { get; set; }
     public float start_height { get; set; }
     public float end_width { get; set; }
@@ -56,6 +57,8 @@ public class Wall
     public static void ReceiveFromServer(byte[] bytedata)
     {
         int read = 5;
+        var location = PlayerController.locations[PlayerController.active_company];
+        location.walls = new List<Wall>();
         while (read < bytedata.Length)
         {
             var id = BitConverter.ToUInt32(bytedata, read);
@@ -65,6 +68,8 @@ public class Wall
             var z2 = BitConverter.ToSingle(bytedata, read + 16);
             Debug.Log($"wall received id {id} x1 {x1} z1 {z1} x2 {x2} z2 {z2}");
             read += 20;
+
+            location.walls.Add(new Wall { id = id, location_id = location.id, start_height = x1, start_width = z1, end_height = x2, end_width = z2 });
         }
     }