using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class SceneResMgr : MonoBehaviour { [SerializeField] GameObject[] prefabs; public static SceneResMgr ins; void Awake() { ins = this; } void OnDestroy() { if (ins == this) ins = null; } public GameObject GetPrefab(string prefabName) { foreach (var item in prefabs) { if (item.name == prefabName) return item; } return null; } }