Files
XRLib/Assets/Scripts/SampleProject/AppMain.cs

61 lines
2.1 KiB
C#
Raw Normal View History

2025-06-20 17:37:20 +09:00
using System;
2025-06-04 23:10:11 +09:00
using UnityEngine;
2025-06-20 17:37:20 +09:00
using UVC.Core;
2025-06-04 23:10:11 +09:00
using UVC.Data;
using UVC.UI.Tooltip;
2025-06-04 23:10:11 +09:00
2025-06-05 20:09:28 +09:00
namespace SampleProject
2025-06-04 23:10:11 +09:00
{
2025-06-20 17:37:20 +09:00
public class AppMain : SingletonApp<AppMain>
2025-06-04 23:10:11 +09:00
{
2025-06-20 17:37:20 +09:00
public Action Initialized;
private MQTTPipeLine mqttPipeLine;
public MQTTPipeLine MQTTPipeLine => mqttPipeLine;
/// <summary>
/// <20>ʱ<EFBFBD> ȭ <20>޼<EFBFBD><DEBC><EFBFBD><EFBFBD>Դϴ<D4B4>.
/// Awake <20>޼<EFBFBD><DEBC><EFBFBD><E5BFA1> ȣ<><C8A3><EFBFBD>Ǹ<EFBFBD>, MonoBehaviour<75><72> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>˴ϴ<CBB4>.
/// </summary>
protected override void Init()
2025-06-04 23:10:11 +09:00
{
Canvas rootCanvas = GameObject.FindFirstObjectByType<Canvas>();
if (rootCanvas != null && !TooltipManager.Instance.IsInitialized) TooltipManager.Instance.Initialize(rootCanvas.transform, rootCanvas);
2025-06-04 23:10:11 +09:00
2025-06-20 17:37:20 +09:00
SetNetworkInfo();
if (Initialized != null)
{
Initialized.Invoke();
}
}
void Start()
{
//Tester.RunAllTests();
2025-06-20 17:37:20 +09:00
}
2025-06-20 17:37:20 +09:00
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.Execute();
2025-06-04 23:10:11 +09:00
}
}
}