|
@@ -26,6 +26,7 @@ public class PlayerController : MonoBehaviour
|
|
|
public GameObject EndMin;
|
|
|
public GameObject EndSec;
|
|
|
public GameObject StartStopButton;
|
|
|
+ public LocationZones locationZones;
|
|
|
//public GameObject ErrorDialog;
|
|
|
public Dropdown DropdownMode;
|
|
|
public Toggle ToggleLine;
|
|
@@ -163,7 +164,11 @@ public class PlayerController : MonoBehaviour
|
|
|
{
|
|
|
users_load = false;
|
|
|
foreach (var u in users.OrderBy(u => u.id))
|
|
|
+ {
|
|
|
WorkerMarker(u, Color.green);
|
|
|
+ if(DropdownMode.value == 0) markers[u.id].toggle_user.SetActive(u.online);
|
|
|
+ else markers[u.id].toggle_user.SetActive(true);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//LoadMaps(DropdownLocation, Locations);
|
|
@@ -354,11 +359,16 @@ public class PlayerController : MonoBehaviour
|
|
|
else moving[m.acc_id] = new MarkerMoving();
|
|
|
|
|
|
var worker = Workers[m.acc_id];
|
|
|
- Debug.LogWarning($"worker coord count {m.acc_id} {worker.Count}");
|
|
|
+ Debug.LogWarning($"worker coord count {m.acc_id} {worker.Count}");
|
|
|
+
|
|
|
if (active_mode == Mode.RealTime) worker = worker.OrderBy(wr => wr.ts).ToList();
|
|
|
if (worker.Any())
|
|
|
{
|
|
|
var w = worker[i];
|
|
|
+
|
|
|
+ var user = users.Single(u => u.id == m.acc_id);
|
|
|
+ locationZones.UserPosition(user, w);
|
|
|
+
|
|
|
var start_pos = m.marker.transform.position;
|
|
|
if (i != 0) start_pos = new Vector3(worker[i - 1].coord_x, 0.5f, worker[i - 1].coord_y);
|
|
|
if (active_mode == Mode.History && i == 0) start_pos = new Vector3(w.coord_x, 0.5f, w.coord_y);
|
|
@@ -432,9 +442,13 @@ public class PlayerController : MonoBehaviour
|
|
|
{
|
|
|
case 0:
|
|
|
DateTimePanel.SetActive(false);
|
|
|
+ foreach(var u in users)
|
|
|
+ markers[u.id].toggle_user.SetActive(u.online);
|
|
|
break;
|
|
|
case 1:
|
|
|
DateTimePanel.SetActive(true);
|
|
|
+ foreach (var u in users)
|
|
|
+ markers[u.id].toggle_user.SetActive(true);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
@@ -450,13 +464,15 @@ public class PlayerController : MonoBehaviour
|
|
|
|
|
|
if (active_mode == Mode.RealTime && m.Value.toggle.isOn && !Workers.ContainsKey(m.Value.acc_id))
|
|
|
{
|
|
|
- Debug.LogWarning($"send coord user {m.Value.acc_id}");
|
|
|
+ Debug.LogWarning($"send coord user {m.Value.acc_id}");
|
|
|
var index = company.locations_index[company.active_location];
|
|
|
client.CoordinatesRequest(0, 0, 1, company.locations[index].id, m.Value.acc_id);
|
|
|
+
|
|
|
+ m.Value.toggle_user.SetActive(users.Single(u => u.id ==m.Value.acc_id).online);
|
|
|
}
|
|
|
|
|
|
if (m.Value.toggle.isOn && Workers.ContainsKey(m.Value.acc_id) && active_mode != Mode.Stop/*&& starting*/ /*&& end_send[m.value.acc_id]*/)
|
|
|
- {
|
|
|
+ {
|
|
|
StartingAccPositiong(m.Value);
|
|
|
|
|
|
if (active_mode == Mode.History && !Workers.Any())
|