Browse Source

Списки в классе локации

Виктор Шейко 4 years ago
parent
commit
43f8e105fb

+ 4 - 4
Assets/Scenes/Player.unity

@@ -719,7 +719,7 @@ GameObject:
   m_Icon: {fileID: 0}
   m_NavMeshLayer: 0
   m_StaticEditorFlags: 0
-  m_IsActive: 0
+  m_IsActive: 1
 --- !u!114 &60701536
 MonoBehaviour:
   m_ObjectHideFlags: 0
@@ -4499,11 +4499,11 @@ MonoBehaviour:
     m_PersistentCalls:
       m_Calls: []
   m_FontData:
-    m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
-    m_FontSize: 14
+    m_Font: {fileID: 12800000, guid: 74d3785fa719d15429525fe4a1584744, type: 3}
+    m_FontSize: 12
     m_FontStyle: 0
     m_BestFit: 0
-    m_MinSize: 10
+    m_MinSize: 1
     m_MaxSize: 40
     m_Alignment: 3
     m_AlignByGeometry: 0

+ 3 - 3
Assets/Scripts/Controllers/AuthorizationController.cs

@@ -12,9 +12,9 @@ public class AuthorizationController : MonoBehaviour
     public GameObject Error;
     public GameObject loading;
 
-    public static bool send = false;
-    public static bool success = false;
-    public static bool error = false;
+    public static bool send = false; // маяк для client
+    public static bool success = false; // маяк для client
+    public static bool error = false; // маяк для client
     static string textError = "Неправильный логин или пароль";
 
     Client client;

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

@@ -18,6 +18,9 @@ public class EditorController : MonoBehaviour
     public GameObject plane;
     public GameObject BeaconsContent;
     public GameObject PanelBeaconEdit;
+    public GameObject Player;
+    public GameObject ButtonMode;
+    public GameObject EditorTools;
     public Toggle ToggleGrid;
     public Toggle ToggleScalePanel;
     public Toggle projection;
@@ -26,6 +29,7 @@ public class EditorController : MonoBehaviour
     public Transform Locations;
     public Button ButtonAddBeacon;
 
+
     public List<Beacon> Beacons = new List<Beacon>();
 
     PlayerController player;
@@ -37,9 +41,9 @@ public class EditorController : MonoBehaviour
     void Start()
     {
         client = Client.instance;
-        player = GameObject.Find("Canvas").transform.GetChild(2).GetComponent<PlayerController>();
-        mode = GameObject.Find("ButtonMode").GetComponent<ModeController>();
-        tools = GameObject.Find("EditorTools").GetComponent<ToolsController>();
+        player = Player.GetComponent<PlayerController>();
+        mode = ButtonMode.GetComponent<ModeController>();
+        tools = EditorTools.GetComponent<ToolsController>();
 
         ButtonAddBeacon.onClick.AddListener(() => {
             AddBeacon();

+ 8 - 3
Assets/Scripts/Models/Location.cs

@@ -3,11 +3,16 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
+using UnityEngine;
 
-
-    public class Location
+public class Location
     {
     public int id { get; set; }
     public string name { get; set; }
-    }
+    public List<Wall> walls { get; set; }
+    public List<Beacon> beacons { get; set; }
+    public GameObject plane { get; set; }
+    public string texture_url { get; set; }
+    public List<Zone> zones { get; set; }
+}
 

+ 12 - 0
Assets/Scripts/Models/Zone.cs

@@ -0,0 +1,12 @@
+// имя, id, координаты углов, id локации
+public class Zone
+    {
+    public uint id { get; set; }
+    public uint location_id { get; set; }
+    public string name { get; set; }
+    public float pos_x { get; set; }
+    public float pos_y { get; set; }
+    public float pos_z { get; set; }
+
+}
+