/
vasandi
/
AirSim
Обзор
Документация
Войти
/
vasandi
/
AirSim
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
Unity/UnityDemo/Assets/AirSimAssets/Scripts/Utilities/AirSimServer.cs
37 строк
1 KB
Андрей Васильченко
сборка под ubuntu 26.04
08 июл 2026, 10:15
08 июл 2026, 10:15
d53c5a2
Код
Авторство
О чём код?
using System.Collections; using System.Collections.Generic; using UnityEngine; using System; using AirSimUnity.DroneStructs; using System.Threading; using UnityEditor; namespace AirSimUnity { public class AirSimServer : MonoBehaviour { private const string DRONE_MODE = "Multirotor"; // Start is called before the first frame update void Start() { string simMode = AirSimSettings.GetSettings().SimMode; int basePortId = AirSimSettings.GetSettings().GetPortIDForVehicle(simMode == DRONE_MODE); bool isServerStarted = PInvokeWrapper.StartServer(simMode, basePortId); if (isServerStarted == false) { #if UNITY_EDITOR EditorUtility.DisplayDialog("Problem in starting AirSim server!!!", "Please check logs for more information.", "Exit"); #else Application.Quit(); #endif } } protected void OnApplicationQuit() { PInvokeWrapper.StopServer(); } } }