public static T GetObject <T>(string key, Vector3 pos) where T : Component { T t = null; BlockPool bPool = null; if (objPools.TryGetValue(key, out bPool)) { t = bPool.GetObject <T>(pos); } if (t == null) { GameLog.Error(string.Format("{0} cache get err!", key)); } return(t); }
public static GameObject GetObject(string key, Vector3 pos) { GameObject cacheGo = null; BlockPool bPool = null; if (objPools.TryGetValue(key, out bPool)) { cacheGo = bPool.GetObject(pos); } if (cacheGo == null) { GameLog.Error(string.Format("{0} cache get err!", key)); } return(cacheGo); }