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.

Declaration

public static void SetActiveSquares(int level)

Parameters

NameDescription

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