Виктор Шейко 5 years ago
parent
commit
a437b0e281

+ 332 - 8
Assets/Resources/GameObjects/Capsule.prefab

@@ -1,5 +1,82 @@
 %YAML 1.1
 %TAG !u! tag:unity3d.com,2011:
+--- !u!1 &375781432752661623
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 6764541215890316696}
+  - component: {fileID: 7814363689051633914}
+  - component: {fileID: 2976693785139827413}
+  m_Layer: 5
+  m_Name: Text
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 0
+--- !u!224 &6764541215890316696
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 375781432752661623}
+  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: 6492558690037778736}
+  m_RootOrder: 1
+  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!222 &7814363689051633914
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 375781432752661623}
+  m_CullTransparentMesh: 0
+--- !u!114 &2976693785139827413
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 375781432752661623}
+  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: Button
 --- !u!1 &814368165201010587
 GameObject:
   m_ObjectHideFlags: 0
@@ -32,9 +109,9 @@ RectTransform:
   m_Father: {fileID: 580799061589659549}
   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: 42, y: -17}
   m_SizeDelta: {x: 80, y: 15}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &6645171239019881875
@@ -103,9 +180,9 @@ RectTransform:
   m_PrefabInstance: {fileID: 0}
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 2769879451585008547}
-  m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
   m_LocalPosition: {x: 0, y: 0, z: 0}
-  m_LocalScale: {x: 2, y: 2.5, z: 2}
+  m_LocalScale: {x: 0, y: 0, z: 0}
   m_Children:
   - {fileID: 580799061589659549}
   m_Father: {fileID: 7336634080090794197}
@@ -113,8 +190,8 @@ RectTransform:
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
   m_AnchorMin: {x: 0, y: 0}
   m_AnchorMax: {x: 0, y: 0}
-  m_AnchoredPosition: {x: 961, y: 722.5}
-  m_SizeDelta: {x: 961, y: 579}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 0, y: 0}
   m_Pivot: {x: 0, y: 0}
 --- !u!223 &5778327769624969747
 Canvas:
@@ -176,6 +253,125 @@ MonoBehaviour:
   m_BlockingMask:
     serializedVersion: 2
     m_Bits: 4294967295
+--- !u!1 &3185409453413919520
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 6492558690037778736}
+  - component: {fileID: 5324904743653416913}
+  - component: {fileID: 6326818606970202496}
+  - component: {fileID: 7867107486275645808}
+  m_Layer: 5
+  m_Name: Button
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &6492558690037778736
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 3185409453413919520}
+  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: 8938162049854063809}
+  - {fileID: 6764541215890316696}
+  m_Father: {fileID: 580799061589659549}
+  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: 97, y: -17}
+  m_SizeDelta: {x: 30, y: 30}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!222 &5324904743653416913
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 3185409453413919520}
+  m_CullTransparentMesh: 0
+--- !u!114 &6326818606970202496
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 3185409453413919520}
+  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!114 &7867107486275645808
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 3185409453413919520}
+  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: 6326818606970202496}
+  m_OnClick:
+    m_PersistentCalls:
+      m_Calls: []
 --- !u!1 &7567893345184978865
 GameObject:
   m_ObjectHideFlags: 0
@@ -208,13 +404,14 @@ RectTransform:
   m_LocalScale: {x: 1, y: 1, z: 1}
   m_Children:
   - {fileID: 6641817515841021218}
+  - {fileID: 6492558690037778736}
   m_Father: {fileID: 5873275319289875318}
   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_SizeDelta: {x: -1279, y: -625}
   m_Pivot: {x: 0.5, y: 0.5}
 --- !u!222 &775263694455415374
 CanvasRenderer:
@@ -400,3 +597,130 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   TrackMarker: 1
+  UserId: 0
+--- !u!1001 &1421491235581791104
+PrefabInstance:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    m_TransformParent: {fileID: 6492558690037778736}
+    m_Modifications:
+    - target: {fileID: -1588137357764125696, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_Name
+      value: videocam-24px
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_LocalPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_LocalPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_LocalRotation.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_LocalRotation.w
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_RootOrder
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_LocalEulerAnglesHint.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_LocalEulerAnglesHint.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_LocalEulerAnglesHint.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_AnchoredPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_AnchoredPosition.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_SizeDelta.x
+      value: 20
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_SizeDelta.y
+      value: 20
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_AnchorMin.x
+      value: 0.5
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_AnchorMin.y
+      value: 0.5
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_AnchorMax.x
+      value: 0.5
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_AnchorMax.y
+      value: 0.5
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_Pivot.x
+      value: 0.5
+      objectReference: {fileID: 0}
+    - target: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+        type: 3}
+      propertyPath: m_Pivot.y
+      value: 0.5
+      objectReference: {fileID: 0}
+    m_RemovedComponents: []
+  m_SourcePrefab: {fileID: 7243324766535440047, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+    type: 3}
+--- !u!224 &8938162049854063809 stripped
+RectTransform:
+  m_CorrespondingSourceObject: {fileID: -1175266087227175103, guid: 9c6bb3a8efc75f8439688b432c5b9419,
+    type: 3}
+  m_PrefabInstance: {fileID: 1421491235581791104}
+  m_PrefabAsset: {fileID: 0}

+ 9 - 4
Assets/Resources/GameObjects/Toggle.prefab

@@ -55,7 +55,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 299617132388312207}
   m_Enabled: 1
   m_EditorHideFlags: 0
-  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
@@ -73,6 +73,7 @@ MonoBehaviour:
   m_FillClockwise: 1
   m_FillOrigin: 0
   m_UseSpriteMesh: 0
+  m_PixelsPerUnitMultiplier: 1
 --- !u!1 &760345865048027404
 GameObject:
   m_ObjectHideFlags: 0
@@ -120,7 +121,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 760345865048027404}
   m_Enabled: 1
   m_EditorHideFlags: 0
-  m_Script: {fileID: 2109663825, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
   m_Navigation:
@@ -134,17 +135,20 @@ MonoBehaviour:
     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: Highlighted
     m_DisabledTrigger: Disabled
   m_Interactable: 1
   m_TargetGraphic: {fileID: 1125017703437484849}
@@ -209,7 +213,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 4310993346715373821}
   m_Enabled: 1
   m_EditorHideFlags: 0
-  m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}
@@ -227,6 +231,7 @@ MonoBehaviour:
   m_FillClockwise: 1
   m_FillOrigin: 0
   m_UseSpriteMesh: 0
+  m_PixelsPerUnitMultiplier: 1
 --- !u!1 &7981859408853238660
 GameObject:
   m_ObjectHideFlags: 0
@@ -281,7 +286,7 @@ MonoBehaviour:
   m_GameObject: {fileID: 7981859408853238660}
   m_Enabled: 1
   m_EditorHideFlags: 0
-  m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
+  m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
   m_Material: {fileID: 0}

+ 2 - 2
Assets/Scenes/Player.unity

@@ -22937,6 +22937,7 @@ MonoBehaviour:
   ZonesScroll: {fileID: 1296382291}
   UserInfo: {fileID: 1986755448}
   Editor: {fileID: 1379126276}
+  broadcast: 0
   load_location: 0
   users_load: 0
   beacons_load: 0
@@ -55068,8 +55069,7 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   TrackMarker: 0
-  UserInfo: {fileID: 0}
-  user_id: 0
+  UserId: 0
 --- !u!4 &8002323671399922981
 Transform:
   m_ObjectHideFlags: 0

+ 41 - 23
Assets/Scripts/Components/WallCreate.cs

@@ -19,10 +19,10 @@ public class WallCreate : MonoBehaviour
     public static Mode mode = Mode.Cursor;
     GameObject wall;
     Wall currentWall;
-    public static List<GameObject> WallObjects = new List<GameObject>();
-    public static List<Wall> Walls = new List<Wall>();
+    //public Dictionary<uint, GameObject> WallObjects = new Dictionary<uint, GameObject>();
+    public static Dictionary<uint, List<Wall>> Walls = new Dictionary<uint, List<Wall>>();
     //public static List<Wall> Rooms = new List<Wall>();
-    public static List<Zone> Zones = new List<Zone>();
+    public static Dictionary<uint, List<Zone>> Zones = new Dictionary<uint, List<Zone>>();
 
     private Vector3 screenPoint;
     private Vector3 offset;
@@ -80,6 +80,7 @@ public class WallCreate : MonoBehaviour
                     break;
                 case Mode.Zone:
                     wall = AddZone(Dialog, player, ZonesScroll);
+
                     break;
             }
         }
@@ -144,12 +145,28 @@ public class WallCreate : MonoBehaviour
     {
         //var end_pos = Camera.main.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, screenPoint.z));
         //Debug.Log($"end_pos = {end_pos}");
-        currentWall = new Wall { start_width = start_pos.x, start_height = start_pos.z, end_width = scale_x, end_height = scale_z, go=wall };
+        var location_id = player.locations_index[player.active_location];
+        if (mode == Mode.Room)
+        {
+            for (int i = 0; i < wall.transform.childCount; i++)
+            {
+                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 };
+                    Walls[location_id].Add(currentWall);
+                }
+            }
+        }
 
         //if (mode == Mode.Room) Rooms.Add(currentWall);
-        //else if (mode == Mode.Wall) Walls.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 };
+            Walls[location_id].Add(currentWall);
+        }
         
-        if (mode == Mode.Wall || mode == Mode.Room) Walls.Add(currentWall);
+        if (mode == Mode.Wall || mode == Mode.Room) /*Walls.Add(currentWall);*/
 
         canvas.SetActive(false);
 
@@ -171,7 +188,7 @@ public class WallCreate : MonoBehaviour
         if(scale != null) wall.transform.localScale = scale;
         var location = player.locations[player.locations_index[player.active_location]].location;
         wall.transform.SetParent(location.transform.GetChild(1).transform);
-        WallObjects.Add(wall);
+        //WallObjects.Add(wall);
         return wall;
     }
 
@@ -181,9 +198,9 @@ public class WallCreate : MonoBehaviour
         var location = player.locations[player.locations_index[player.active_location]].location;
         room.transform.SetParent(location.transform.GetChild(1).transform);
         LocationController.Cube(room, new Vector3(0.1f, 0.1f, 1));
-        for (var i = 0; i < room.transform.childCount; i++)
-            if (room.transform.GetChild(i).gameObject.activeSelf == true)            
-                WallObjects.Add(room.transform.GetChild(i).gameObject);
+        //for (var i = 0; i < room.transform.childCount; i++)
+        //    if (room.transform.GetChild(i).gameObject.activeSelf == true)            
+        //        WallObjects.Add(room.transform.GetChild(i).gameObject);
             
         return room;
     }
@@ -193,18 +210,19 @@ public class WallCreate : MonoBehaviour
         var zone = Instantiate(Resources.Load("GameObjects/Zone", typeof(GameObject))) as GameObject;
         //zone.transform.position = pos;
         var location = player.locations[player.locations_index[player.active_location]].location;
+        var location_id = player.locations_index[player.active_location];
         zone.transform.SetParent(location.transform.GetChild(2).transform);
 
         var panel_button = Instantiate(Resources.Load("GameObjects/Panel_Beacon", typeof(GameObject))) as GameObject;
         panel_button.transform.SetParent(ZonesScroll.transform);
         panel_button.name = $"Zone_{Zones.Count}";
         var button = panel_button.transform.GetChild(0).GetComponent<Button>();
-        button.transform.GetChild(0).GetComponent<Text>().text = $"Зона {Zones.Count + 1}";
-        zone.GetComponent<ZoneController>().TextMesh.text = $"Зона {Zones.Count+1}";
+        button.transform.GetChild(0).GetComponent<Text>().text = $"Зона {Zones[location_id].Count + 1}";
+        zone.GetComponent<ZoneController>().TextMesh.text = $"Зона {Zones[location_id].Count+1}";
         var active_zone = Zones.Count;
 
-        var location_id = player.locations_index[player.active_location];
-        if(z == null) z = new Zone { id=0, go=zone, buttons = panel_button, location_id=(uint) location_id };   
+        
+        if(z == null) z = new Zone { id=(uint)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);
@@ -235,18 +253,18 @@ public class WallCreate : MonoBehaviour
         {
             Destroy(zone);
             Destroy(panel_button);
-            Zones.Remove(z);
+            Zones[location_id].Remove(z);
         });
 
-        Zones.Add(z);
+        Zones[location_id].Add(z);
         return zone;
     }
 
-    public void SaveZones()
-    {
-        foreach(var z in Zones)
-        {
-            z.Save();
-        }
-    }
+    //public void SaveZones()
+    //{
+    //    foreach(var z in Zones)
+    //    {
+    //        z.Save();
+    //    }
+    //}
 }

+ 8 - 0
Assets/Scripts/Controllers/CameraController.cs

@@ -162,6 +162,14 @@ public class CameraController : MonoBehaviour
         {
             axes = RotationAxes.Mouse;
 
+            var player = PlayerController.instance;
+            if (player.UserInfo.activeSelf)
+            {
+                var client = Client.instance;
+                client.ImageStreamStopSend(player.user_broadcast.Value);
+                player.user_broadcast = null;
+                player.UserInfo.SetActive(false);
+            }
         }
     }
 }

+ 15 - 7
Assets/Scripts/Controllers/EditorController.cs

@@ -97,6 +97,8 @@ public class EditorController : MonoBehaviour
         }
     }
 
+    float sizex = 0;
+    float sizey = 0;
     // Update is called once per frame
     void Update()
     {      
@@ -109,10 +111,16 @@ public class EditorController : MonoBehaviour
             EditLocation = location;
         }
 
-        
-
-        SizeX.text = $"{EditLocation.plane.transform.localScale.x}";
-        SizeY.text = $"{EditLocation.plane.transform.localScale.z}";
+        if (EditLocation.plane.transform.localScale.x != sizex)
+        {
+            SizeX.text = $"{EditLocation.plane.transform.localScale.x}";
+            sizex = EditLocation.plane.transform.localScale.x;
+        }
+        if (EditLocation.plane.transform.localScale.z != sizey)
+        {
+            SizeY.text = $"{EditLocation.plane.transform.localScale.z}";
+            sizey = EditLocation.plane.transform.localScale.z;
+        }
         
         if (ToggleScalePanel.isOn != plane.GetComponent<TouchScript>().activeScript) plane.GetComponent<TouchScript>().activeScript = ToggleScalePanel.isOn;
 
@@ -158,11 +166,11 @@ public class EditorController : MonoBehaviour
                 location = EditLocation;
                 location.name = Name.text;
                 location.texture_url = Image.text;
-                location.walls.AddRange(WallCreate.Walls);
-                location.zones.AddRange(WallCreate.Zones);
+                location.walls.AddRange(WallCreate.Walls[EditLocation.id]);
+                location.zones.AddRange(WallCreate.Zones[EditLocation.id]);
                 location.beacons.AddRange(Beacons);
             }
-            else location = location = new Location { id = 0, name = Name.text, beacons = Beacons, zones = WallCreate.Zones, walls = WallCreate.Walls, texture_url = Image.text, plane = plane, location = NewLocation };
+            else location = location = new Location { id = 0, name = Name.text, beacons = Beacons, zones = WallCreate.Zones[EditLocation.id], walls = WallCreate.Walls[EditLocation.id], texture_url = Image.text, plane = plane, location = NewLocation };
                       
             player.DropdownLocation.options.Last().text = location.name;
 

+ 21 - 3
Assets/Scripts/Controllers/LabelObjectScript.cs

@@ -10,9 +10,10 @@ public class LabelObjectScript : MonoBehaviour
 {
     RectTransform canvasRect;
     GameObject text;
+    Button button;
     public bool TrackMarker = true;
 
-    public uint user_id;
+    public uint UserId;
 
     // Start is called before the first frame update
     void Start()
@@ -21,6 +22,9 @@ public class LabelObjectScript : MonoBehaviour
         cameraController = Camera.main.GetComponent<CameraController>();
         canvasRect = transform.GetChild(0).GetComponent<RectTransform>();
         text = transform.GetChild(0).GetChild(0).GetChild(0).gameObject;
+
+        button = transform.GetChild(0).GetChild(0).GetChild(1).GetComponent<Button>();
+        button.onClick.AddListener(() => BroadcastStart());
     }
 
     // Update is called once per frame
@@ -57,8 +61,22 @@ public class LabelObjectScript : MonoBehaviour
             cameraController.target = transform;
             cameraController.axes = CameraController.RotationAxes.TrackMarker;
 
-            var client = Client.instance;
-            client.ImageStreamStartSend(user_id);
+          
+        }
+    }
+
+    void BroadcastStart()
+    {
+  var player = PlayerController.instance;
+        if (player.user_broadcast != UserId)
+        {
+            if (player.user_broadcast != null)
+            {
+                var client = Client.instance;
+                client.ImageStreamStopSend(player.user_broadcast.Value);
+            }
+            player.user_broadcast = UserId;
+            player.broadcast = true;
         }
     }
 }

+ 18 - 11
Assets/Scripts/Controllers/PlayerController.cs

@@ -43,6 +43,9 @@ public class PlayerController : MonoBehaviour
 
     public GameObject Editor;
 
+    public uint? user_broadcast = null;
+    public bool broadcast = false;
+
     public enum Mode { RealTime = 0, History = 1, Stop = 2 };
     public static Mode active_mode = Mode.Stop;
     int mode = 0;
@@ -219,7 +222,7 @@ public class PlayerController : MonoBehaviour
         //    LoadLocation(locations[active_location]);
         //}
 
-
+        Broadcast();
     }
 
     /// <summary>
@@ -228,10 +231,11 @@ public class PlayerController : MonoBehaviour
     /// <param name="acc_id"></param>
     void WorkerMarker(User user, Color color)
     {
-        var toggle = Instantiate(Resources.Load("GameObjects/Toggle", typeof(Toggle))) as Toggle;
-        toggle.name = $"{user.id}";
+        var toggle_user = Instantiate(Resources.Load("GameObjects/ToggleUser", typeof(GameObject))) as GameObject;
+        toggle_user.name = $"{user.id}";
+        var toggle = toggle_user.transform.GetChild(0).GetComponent<Toggle>();
         toggle.transform.GetChild(1).gameObject.GetComponent<Text>().text = $"{user.id} {user.name}";
-        toggle.transform.SetParent(WorkersList.transform);
+        toggle_user.transform.SetParent(WorkersList.transform);
         toggle.isOn = false;
 
         var marker = Instantiate(Resources.Load("GameObjects/Capsule", typeof(GameObject))) as GameObject;
@@ -239,7 +243,7 @@ public class PlayerController : MonoBehaviour
         marker.transform.GetChild(0).transform.GetChild(0).transform.GetChild(0).GetComponent<Text>().text = $"{user.id}";
         marker.transform.SetParent(GameObject.Find("Markers").transform);
         marker.GetComponent<Renderer>().material.color = color; // UnityEngine.Random.ColorHSV(0f, 1f, 1f, 1f, 0.5f, 1f);
-        marker.GetComponent<LabelObjectScript>().user_id = user.id;
+        marker.GetComponent<LabelObjectScript>().UserId = user.id;
 
         var marker_line = Instantiate(Resources.Load("GameObjects/Line", typeof(LineRenderer))) as LineRenderer;
         marker_line.name = $"marker_line_{user.id}";
@@ -248,7 +252,7 @@ public class PlayerController : MonoBehaviour
         marker_line.material.color = color;
         marker_line.transform.SetParent(GameObject.Find("Markers").transform);
 
-        markers.Add(new Marker { acc_id = user.id, marker = marker, toggle = toggle, marker_line = marker_line });
+        markers.Add(new Marker { acc_id = user.id, marker = marker, toggle = toggle, marker_line = marker_line, toggle_user = toggle_user });
     }
 
     /// <summary>
@@ -518,7 +522,7 @@ public class PlayerController : MonoBehaviour
         {
             Destroy(m.marker.gameObject);
             Destroy(m.marker_line.gameObject);
-            Destroy(m.toggle.gameObject);
+            Destroy(m.toggle_user);
         }
         markers = new List<Marker>();
         Location.LocationsRequest(0);
@@ -640,11 +644,14 @@ public class PlayerController : MonoBehaviour
         }
     }
 
-    public void CameraCapture(string name, Sprite sprite)
+    public void Broadcast()
     {
-        var ui = UserInfo.GetComponent<UserInfo>();
-        ui.Text.text = $"";
-        ui.Image.sprite = sprite;
+        if (user_broadcast != null && broadcast)
+        {
+            broadcast = false;
+            var client = Client.instance;
+            client.ImageStreamStartSend(user_broadcast.Value);
+        }
     }
 }
 

+ 8 - 7
Assets/Scripts/Models/Marker.cs

@@ -6,11 +6,12 @@ using System.Threading.Tasks;
 using UnityEngine;
 using UnityEngine.UI;
 
- public class Marker
-    {
-        public Toggle toggle { get; set; }
-        public GameObject marker { get; set; }
-        public LineRenderer marker_line { get; set; }
-        public uint acc_id { get; set; }
-    }
+public class Marker
+{
+    public Toggle toggle { get; set; }
+    public GameObject toggle_user { get; set; }
+    public GameObject marker { get; set; }
+    public LineRenderer marker_line { get; set; }
+    public uint acc_id { get; set; }
+}
 

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

@@ -32,14 +32,14 @@ public class Wall
         Client.SendEnqueue(tosend);        
     }
 
-    public static void SaveAll()
+    public static void SaveAll(uint lid)
     {
         Debug.Log("WallObjects count " + WallCreate.Walls.Count);
         if (WallCreate.Walls.Count > 0)
         {
             List<byte> list = new List<byte>();
 
-            foreach (var w in WallCreate.Walls)
+            foreach (var w in WallCreate.Walls[lid])
             {
                 list.AddRange(BitConverter.GetBytes(w.id));
                 list.AddRange(BitConverter.GetBytes(w.start_width));

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

@@ -30,14 +30,14 @@ public class Zone
         Client.SendEnqueue(tosend);
     }
 
-    public static void SaveAll()
+    public static void SaveAll(uint lid)
     {
         Debug.Log("Zone count " + WallCreate.Zones.Count);
         if (WallCreate.Zones.Count > 0)
         {
             List<byte> list = new List<byte>();
 
-            foreach (var z in WallCreate.Zones)
+            foreach (var z in WallCreate.Zones[lid])
             {
                 list.AddRange(BitConverter.GetBytes(z.id));
                 list.AddRange(BitConverter.GetBytes(z.start_width));