2014-10-07 17:49:48 +00:00
|
|
|
|
using System;
|
2014-10-12 08:22:41 +00:00
|
|
|
|
using System.Collections.Generic;
|
2014-10-07 17:49:48 +00:00
|
|
|
|
using MultiTheftAuto;
|
|
|
|
|
|
|
|
|
|
namespace Test
|
|
|
|
|
{
|
2014-10-12 08:22:41 +00:00
|
|
|
|
public class Resource
|
|
|
|
|
{
|
|
|
|
|
public Resource()
|
|
|
|
|
{
|
2014-10-17 08:34:42 +00:00
|
|
|
|
var vehicles = new List<Vehicle>( 10 );
|
2014-10-07 17:49:48 +00:00
|
|
|
|
|
2014-10-12 08:22:41 +00:00
|
|
|
|
for( int i = 0; i < vehicles.Capacity; i++ )
|
|
|
|
|
{
|
2014-10-17 08:34:42 +00:00
|
|
|
|
Vehicle vehicle = new Vehicle( 562, new Vector3( 192.0f, 168.0f, 10.0f ) * i, new Vector3( 0.0f, 0.0f, 0.0f ) );
|
2014-10-12 08:22:41 +00:00
|
|
|
|
|
2014-10-17 08:34:42 +00:00
|
|
|
|
if( vehicle.IsValid() )
|
2014-10-12 08:22:41 +00:00
|
|
|
|
{
|
|
|
|
|
vehicles.Add( vehicle );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug.Error( "Failed to create vehicle" );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-10-17 08:34:42 +00:00
|
|
|
|
foreach( Vehicle vehicle in vehicles )
|
2014-10-12 08:22:41 +00:00
|
|
|
|
{
|
2014-10-17 08:34:42 +00:00
|
|
|
|
Debug.Log( "{0} {1}", vehicle, vehicle.GetPosition() );
|
2014-10-12 08:22:41 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-10-07 17:49:48 +00:00
|
|
|
|
}
|