void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (generateCards) { cardGenerator.GenerateCards(labels.Values.ToList()); timer = FindObjectOfType <Timer>(); timer.SetTimer(30 * labels.Count); } }
void Awake() { cardPrefab = Resources.Load <GameObject>("CardPrefab4"); cardGenerator = gameObject.GetComponent <CardGenerator>(); touchController = GameObject.Find("TouchController").GetComponent <TouchController>(); FoodCards = cardGenerator.GenerateCards(cardPrefab, foodCount); }
/// <summary> /// Does not utilize any preferences - just places card anywhere on the map that is grass or path a /// and does not have another prop on it /// </summary> private void PlaceCards() { cards = cardGenerator.GenerateCards(); for (int i = 0; i < cards.Length; ++i) { var rndGoodCell = hexgrid.GetRandomGrassOrPathCell(); while (propLocs.Contains(rndGoodCell)) { rndGoodCell = hexgrid.GetRandomGrassOrPathCell(); } cards[i].transform.position = rndGoodCell.transform.position; propLocs.Add(rndGoodCell); walkableLocs.Add(rndGoodCell); } OnePlacementComplete(); }
public void GenerateCards_WithWidthOf8_Generates64Cards() { var result = _sut.GenerateCards(8); result.Count.ShouldBe(64); }