using Cysharp.Threading.Tasks; using System; using UnityEngine; using UVC.Core; using UVC.Data; using UVC.Tests; namespace SampleProject { [DefaultExecutionOrder(100)] public class AppMain : SingletonApp { public Action Initialized; private MQTTPipeLine mqttPipeLine; public MQTTPipeLine MQTTPipeLine => mqttPipeLine; /// /// Ãʱâ È­ ¸Þ¼­µåÀÔ´Ï´Ù. /// Awake ¸Þ¼­µå¿¡¼­ È£ÃâµÇ¸ç, MonoBehaviour°¡ »ý¼ºµÉ ¶§ ÇÑ ¹ø¸¸ ½ÇÇàµË´Ï´Ù. /// protected override void Init() { SetNetworkInfo(); if (Initialized != null) { Initialized.Invoke(); } } void Start() { //Tester.RunAllTests(); } private void SetNetworkInfo() { URLList.Add("baseinfo", "http://localhost:8888/baseinfo/00:00"); URLList.Add("AGV", "http://localhost:8888/AGV/00:00"); URLList.Add("STOCKER_STACK", "http://localhost:8888/STOCKER_STACK/00:00"); URLList.Add("CARRIER", "http://localhost:8888/CARRIER/00:00"); URLList.Add("EQUIPMENT", "http://localhost:8888/EQUIPMENT/00:00"); URLList.Add("PORT", "http://localhost:8888/PORT/00:00"); URLList.Add("RACK", "http://localhost:8888/RACK/00:00"); URLList.Add("TWIN_FORK", "http://localhost:8888/TWIN_FORK/00:00"); URLList.Add("HVC_PLC", "http://localhost:8888/HVC_PLC/00:00"); URLList.Add("HVC_CRANE", "http://localhost:8888/HVC_CRANE/00:00"); URLList.Add("ALARM", "http://localhost:8888/ALARM/00:00"); URLList.Add("Dashboard", "http://localhost:8888/Dashboard/00:00"); URLList.Add("SIMULATION_RANK", "http://localhost:8888/SIMULATION_RANK/00:00"); mqttPipeLine = new MQTTPipeLine("localhost", 1883); mqttPipeLine.AddTopic("AGV"); //mqttPipeLine.AddTopic("ALARM"); mqttPipeLine.Execute(); //10ÃÊ ÈÄ Á¤Áö //UniTask.Delay(TimeSpan.FromSeconds(10)).ContinueWith(() => //{ // mqttPipeLine.Stop(); //}); } } }