/// <summary>
/// Gets the resource tile cache at world position.
/// </summary>
/// <returns>
/// true if able to retrieve a cache at the specified position, otherwise false.
/// </returns>
/// <param name='worldPosition'>
/// World position.
/// </param>
/// <param name='tile'>
/// The cache at the specified position.
/// </param>
public static bool GetResourceTileCacheAtWorldPosition(Vector3 position, out ResourceTileLite tile)
{
position = use.terrain.transform.InverseTransformPoint(position);
try {
tile = use.resourceTileCache[(int)position.z, (int)position.x];
return (!tile.Equals(ResourceTileLite.Empty()));
}
catch (System.IndexOutOfRangeException) {
tile = ResourceTileLite.Empty();
return false;
}
}