24 lines
676 B
C#
Raw Normal View History

2025-11-27 14:50:16 +08:00
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);
}
}
}
}