private void CreateWalkers(MapWalkersRouter router, MapWalkerData data, Vector2Int position, int count) { for (var i = 0; i < count; i++) { router.CreateWalker(data, position); } }
public void TryCreateWalker(float chance, MapWalkerData data, int maxCount) { if (CheckChance(chance) == false) { return; } if (_walkers.Count >= maxCount) { return; } var index = Random.Range(0, _walkers.Count); CreateWalker(data, _walkers[index].Position); }
public MapWalker(MapWalkerData data, Vector2Int position, RectInt borders) { _data = data ? data : throw new ArgumentException("Map Walker Data is invalid!"); _borders = borders; Position = position; }
public void CreateWalker(MapWalkerData data, Vector2Int position) { var walker = new MapWalker(data, position, _borders); _walkers.Add(walker); }