using System.Collections; using System.Collections.Generic; using UnityEngine; public class PrefabManager : Singleton { public void Init() { DontDestroyOnLoad(this); } public AssetBundleManager assetBundle = new AssetBundleManager(); #if false public GameObject PrefabGet(string name) { return assetBundle.GetPrefab(name); } #else Bundle bundlePrefab = new Bundle(); public GameObject PrefabGet(string name) { GameObject prefab = bundlePrefab.Get(name); if (prefab == null) { prefab = Resources.Load($"Prefab/{name}") as GameObject; if (prefab != null) bundlePrefab.Add(name, prefab); } return prefab; } #endif }