public void SetupGame() { // Get a reference to the card database CSVScriptReader database = FindObjectOfType <CSVScriptReader>(); List <Card> cardDatabase = database.GetCards(); // Get a reference to the GameDatabase GameSettings gameDatabase = FindObjectOfType <GameSettings>(); // Go over each card in the database for (int i = 0; i < cardDatabase.Count; i++) { // Go over each chosen tag for (int j = 0; j < addedTags.Count; j++) { // If the tag is the same as the one on the card in the database .. if (cardDatabase[i].culture == addedTags[j]) { // .. Then add the card to the gamedatabase gameDatabase.AddCard(cardDatabase[i]); } } } // Set the gamemode //gameDatabase.SetGamemode(dropdown.options[dropdown.value].text); }
private void CreateCardDatabase() { GameObject GO = new GameObject("Card Database"); GO.AddComponent <CSVScriptReader>(); backupDatabase = GO.GetComponent <CSVScriptReader>(); }