public static PedestrianCompanion GetPedestrianCompanion(Pedestrian ped, string pedestrianName) { var companion = new PedestrianCompanion(); companion.pedestrianName = pedestrianName; companion.pedestrianPtr = ped; Pedestrians.Add(companion); Debug.LogWarning("Number of pedestrians: " + Pedestrians.Count.ToString() + ". Added - " + companion.pedestrianName); return(companion); }
public void Start() { pedestrian_name = transform.GetComponentInParent <PedestrianOverhead>().name; InitialisePedestrian(); pedestrianInterface = PedestrianCompanion.GetPedestrianCompanion(this, pedestrian_name); isServerStarted = pedestrianInterface.StartPedestrianServer(AirSimSettings.GetSettings().GetPort(AirSimSettings.AgentType.Pedestrian)); if (isServerStarted == false) { #if UNITY_EDITOR EditorUtility.DisplayDialog("Problem in starting AirSim server!!!", "Please check logs for more information.", "Exit"); EditorApplication.Exit(1); #else Application.Quit(); #endif } //AirSimGlobal.Instance.Weather.AttachToVehicle(this); //count = UnityEngine.Random.Range(0, 10); pedestrianControls = new PedestrianControls(0, 0); }
// Remove pedestrian private static bool RemovePedestrian(string vehicle_name) // Take in init pose and path? { PedestrianCompanion.DestroyPedestrian(vehicle_name); return true; }