public void GetStarted(int numberOfCheckpoints, Dictionary <int, List <Hexagon> > checkpointTiles, Tiles tiles, Camera cam, CheckpointCounter checkpointCounter) { this.tiles = tiles; this.checkpointTiles = checkpointTiles; this.numberOfCheckpoints = numberOfCheckpoints; this.checkpointTilesColor = tiles.GetComponent <TileColorsPermanent>().GetCheckpointTilesColor(); this.cam = cam; this.checkpointCounter = checkpointCounter; checkpointCounter.Appear(); checkpointCounter.SetCounter(numberOfCheckpoints); cam.orthographicSize = (cam.orthographicSize + cam.GetComponent <CameraFollow>().GetOffset().y) / 2.25f; Debug.Log("Choose " + numberOfCheckpoints + " path tiles as checkpoints now"); }
// Start is called before the first frame update void Start() { Checkpoint[] checkpoints = FindObjectsOfType <Checkpoint>(); foreach (Checkpoint cp in checkpoints) { if (cp.checkpointNumber > lastCheckpoint) { lastCheckpoint = cp.checkpointNumber; } } raceTimer = FindObjectOfType <RaceTimer>(); counter = FindObjectOfType <CheckpointCounter>(); }