using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AppleMgr : MonoBehaviour
{
public class AppleCreator
{
private static GameObject[] s_appleListPrefab = new GameObject[2];
public static void RandomCreate(Vector3 startPos)
{
var id = Random.Range(0, 2);
if (null == s_appleListPrefab[id])
{
s_appleListPrefab[id] = Resources.Load<GameObject>("AppleList" + id);
}
var appleListRoot = Object.Instantiate(s_appleListPrefab[id]);
var appleBhv = appleListRoot.AddComponent<Apple>();
appleBhv.SetPos(startPos);
}
}
}
