using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; /// /// опт /// public class BeaconsEditorController : MonoBehaviour { public Dictionary Beacons = new Dictionary(); // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } public Beacon CreateBeacon(uint loaction_id) { var beacon = new Beacon { id = Convert.ToUInt32(4000000000 + Beacons.Count), location_id = loaction_id, enabled = true }; AddBeacon(beacon); return beacon; } public void EditBeacon(Beacon beacon, string name) { } /// /// опт /// /// public void AddBeacon(Beacon b) { var beacon = Instantiate(Resources.Load("GameObjects/Beacon", typeof(GameObject))) as GameObject; if (ModeController.editor) beacon.GetComponent().mode = BeaconController.Mode.Editor; beacon.name = $"Beacon_{b.id}"; beacon.transform.position = new Vector3(b.x, 0.5f, b.y); var beaconController = beacon.GetComponent(); beaconController.InformationPanel(b); beaconController.id = $"{b.id}"; beaconController.BeaconEnabled(b, b.enabled); beacon.transform.SetParent(transform); var name_beacon = $"Маяк {b?.id.ToString() ?? Beacons.Count.ToString()}"; //PanelBeaconEdit.transform.GetChild(0).GetComponent().text = name_beacon; var panel_button = Instantiate(Resources.Load("GameObjects/Panel_Beacon", typeof(GameObject))) as GameObject; // panel_button.name = $"Beacon_{b?.id.ToString() ?? Beacons.Count.ToString()}"; var button = panel_button.transform.GetChild(0).GetComponent