30 lines
460 B
C#
30 lines
460 B
C#
using UnityEngine;
|
|
|
|
namespace BitStrap
|
|
{
|
|
public class NestedPrefab : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private Transform attachTo;
|
|
|
|
[SerializeField]
|
|
private GameObject[] prefabs;
|
|
|
|
private void Awake()
|
|
{
|
|
if (attachTo == null)
|
|
{
|
|
attachTo = base.transform;
|
|
}
|
|
GameObject[] array = prefabs;
|
|
foreach (GameObject gameObject in array)
|
|
{
|
|
if (gameObject != null)
|
|
{
|
|
Create.Prefab(gameObject, attachTo);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|