24 lines
676 B
C#
24 lines
676 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class SetPrefabs : MonoBehaviour
|
|
{
|
|
[SerializeField] private List<GameObject> cardPrefabs;
|
|
[SerializeField] private List<GameObject> characterPrefabs;
|
|
[SerializeField] private int cardNumber;
|
|
|
|
|
|
private void Start()
|
|
{
|
|
foreach (GameObject go in characterPrefabs)
|
|
{
|
|
for (int i = 0; i < cardNumber; i++)
|
|
{
|
|
GameObject cardPrefab = cardPrefabs[UnityEngine.Random.Range(0, cardPrefabs.Count)];
|
|
go.GetComponent<Character>().ownedCardPrefabList.Add(cardPrefab);
|
|
}
|
|
}
|
|
}
|
|
} |