using System; using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; using uc; #if UNITY_EDITOR using UnityEditor; using UnityEditor.SceneManagement; #endif using UnityEngine.SceneManagement; public class PoolBase : MonoBehaviour where Instance : PoolBase { static Instance pool_base; public static Instance Singleton { get { if (pool_base == null) { Instance tmp_pool_base = FindObjectOfType(); string typename = typeof(Instance).Name; if (tmp_pool_base == null) { Debug.LogWarning(typename + " component required - adding dynamically now"); GameObject go = new GameObject(typename); tmp_pool_base = go.AddComponent(); } if(Application.isPlaying) DontDestroyOnLoad(tmp_pool_base.gameObject); pool_base = tmp_pool_base; } return pool_base; } } protected FileInfo GetFileInfo(string filename) { //return new FileInfo(PoolRoot.FullName + @"\" + filename); return new FileInfo(filename); } }