Class VehicleSpawnerExtensions
Inheritance
System.Object
VehicleSpawnerExtensions
Namespace: OpenMod.Extensions.Games.Abstractions.Vehicles
Assembly: OpenMod.Extensions.Games.Abstractions.dll
Syntax
public static class VehicleSpawnerExtensions : object
Methods
| Improve this Doc View SourceSpawnVehicleAsync(IVehicleSpawner, IPlayer, String)
Declaration
public static Task<IVehicle> SpawnVehicleAsync(this IVehicleSpawner vehicleSpawner, IPlayer player, string vehicleAssetId)
Parameters
| Type | Name | Description |
|---|---|---|
| IVehicleSpawner | vehicleSpawner | |
| IPlayer | player | |
| System.String | vehicleAssetId |
Returns
| Type | Description |
|---|---|
| Task<IVehicle> |
SpawnVehicleAsync(IVehicleSpawner, Vector3, String, IVehicleState)
Spawns a vehicle at the given position.
Declaration
public static Task<IVehicle> SpawnVehicleAsync(this IVehicleSpawner vehicleSpawner, Vector3 position, string vehicleAssetId, IVehicleState state = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IVehicleSpawner | vehicleSpawner | The vehicle spawner. |
| Vector3 | position | The position to spawn the vehicle at. |
| System.String | vehicleAssetId | The ID of the vehicle asset. |
| IVehicleState | state | The optional state of the vehicle. |
Returns
| Type | Description |
|---|---|
| Task<IVehicle> | The spawned vehicle if successful; otherwise, null. |