SetActiveSquares
Description
Set how far away from the player the active intersections should be -> default is 1.
If set to 2 -> intersections will update on a 2 square distance from the player.
Read more about active squares and how they work Active Squares Levels
Declaration
public static void SetActiveSquares(int level)
Parameters
Name
Description
level
How many squares away should intersections be updated.
Example
using Gley.TrafficSystem;
using UnityEngine;
public class Test : MonoBehaviour
{
//a reference to vehicle pool and player assigned in inspector
public VehiclePool vehiclePool;
public Transform player;
void Start()
{
API.Initialize(player, 20, vehiclePool);
}
public void ChangeLevels()
{
API.SetActiveSquares(2);
}
}
Last updated