Ejemplo n.º 1
0
        public override async Task OnAccept()
        {
            // When user accepts, continue
            InitBlip();

            try
            {
                // Spawn the on-scene emergency cars (if any)
                await SpawnOnSceneEmergencyCars();
            }
            catch (Exception exception)
            {
                Debug.WriteLine($"[Vehicle Collisions] Unable to spawn emergency cars for scene: {exception}");
            }

            try
            {
                // Spawn the on-scene emergency peds
                await SpawnOnSceneEmergencyPeds();
            }
            catch (Exception exception)
            {
                Debug.WriteLine($"[Vehicle Collisions] Unable to spawn emergency peds for scene: {exception}");
            }

            try
            {
                // Spawn the scene objects
                await SpawnObjects();
            }
            catch (Exception exception)
            {
                Debug.WriteLine($"[Vehicle Collisions] Unable to spawn objects for scene: {exception}");
            }

            try
            {
                // Spawn crashed cars
                await SpawnCrashedCars();
            }
            catch (Exception exception)
            {
                Debug.WriteLine($"[Vehicle Collisions] Unable to spawn crashed cars for scene: {exception}");
            }

            try
            {
                // Spawn the civilians for the cars
                await SpawnCivilians();
            }
            catch (Exception exception)
            {
                Debug.WriteLine($"[Vehicle Collisions] Unable to spawn civilian peds for scene: {exception}");
            }

            // Run the notifications
            RunNotifications();

            // Run the accept method
            _scene.Accept();
        }