Populate game objects from a list?? (C#)

So I’m fairly new to unity and programming but my goal is to take the variables from my list items here:

    List<Cards> cardValue = new List<Cards> ();

	cardValue.Add (new Cards ("One", 1, 1, 1, 1));
	cardValue.Add (new Cards ("Two", 2,2,2,2));
	cardValue.Add (new Cards ("Three", 3,3,3,3));
	cardValue.Add (new Cards ("Four", 4,4,4,4));
	cardValue.Add (new Cards ("Five", 5,5,5,5));
	cardValue.Add (new Cards ("Six", 6,6,6,6));
	cardValue.Add (new Cards ("Seven", 7,7,7,7));
	cardValue.Add (new Cards ("Eight", 8,8,8,8));
	cardValue.Add (new Cards ("Nine", 9,9,9,9));
	cardValue.Add (new Cards ("Ten", 10, 10, 10, 10));

And have these values pass onto “cards” in my scene but I am unsure how to go about doing this. In my scene I simply have 10 game objects all listed as Card1, Card2, etc up to Card10. I want to be able to pass “one” onto Card1 along with the values in that line, “Two” onto Card2 and it’s values, Etc.

Any solution or even a nudge in the right direction would be so helpful :frowning:

You probably want to have a single “Card” prefab, which you can instantiate as needed from another script that’s on a GameManager sort of gameObject.
On this Card prefab, you can have a behaviour that’s called something like CardScript.cs and inside that, you can have public variables for whatever data you want your cards to have: i.e. string cardName; int cardValue; etc.

So you’d do something like:

CardScript cs = Instantiate("Card", position, rotation) as CardScript;
//and access its variables via cs
cs.cardName = cardValue[0].name;