using Assets.Scripts.Models; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Threading; using UnityEngine; using UnityEngine.SceneManagement; using UnityEngine.UI; public class PlayerController : MonoBehaviour { public static PlayerController instance; public Dictionary> Workers = new Dictionary>(); public List TestStructures = new List(); public List Beacons = new List(); public GameObject WorkersList; // scroll content public GameObject DateTimePanel; public GameObject StartHour; public GameObject StartMin; public GameObject StartSec; public GameObject EndHour; public GameObject EndMin; public GameObject EndSec; public GameObject StartStopButton; //public GameObject ErrorDialog; public Dropdown DropdownMode; public Toggle ToggleLine; public Toggle ToggleDisappearance; public GameObject DatePicker; Camera camera; public Toggle projection; //public GameObject LocationGameObject; public GameObject UserInfo; public GameObject Editor; public uint? user_broadcast = null; public bool broadcast = false; public List markers; public enum Mode { RealTime = 0, History = 1, Stop = 2 }; public static Mode active_mode = Mode.Stop; int mode = 0; //public GameObject Time; Client client; static EditorController editor; CompanyController company; DateTimePicker Date; //public List maps; static bool starting = false; // флаг остановки public Dictionary end_send = new Dictionary(); // флаги завершения загрузки Dictionary moving = new Dictionary(); // флаги начала движения float interpolationPeriod = 0.1f; //float time_realtime = 0; float time_draw = 0; public List users = new List(); public bool users_load = false; public bool beacons_load = false; //List StartStop = new List(); private void Awake() { instance = this; } // Start is called before the first frame update void Start() { DebugHelper.ActivateConsole(); client = Client.instance; company = CompanyController.instance; editor = Editor.GetComponent(); camera = Camera.main; markers = new List(); Date = DatePicker.GetComponent(); //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)); //for (int i = 0; i < Locations.transform.childCount; i++) // maps.Add(Locations.transform.GetChild(i).gameObject); //Client.LocationsRequest(); var broadcast_stop = UserInfo.transform.GetChild(1).GetChild(1).GetComponent