public T GetObject <T>(string category, string prefabName) where T : UnityEngine.Object { if (!collections.ContainsKey(category)) { collections.Add(category, new UnityObjectCollection(category, this)); } UnityObjectCollection TargetCollection = collections[category]; return(TargetCollection.GetObject <T>(prefabName)); }
// Support for Unity Inspector Prefab Initialization. (recommend) public Define.Result SetPrefab <T>(string category, string prefabName, UnityEngine.Object prefab, Transform parent) where T : UnityEngine.Object { if (!collections.ContainsKey(category)) { collections.Add(category, new UnityObjectCollection(category, this)); } UnityObjectCollection TargetCollection = collections[category]; return(TargetCollection.SetPrefab <T>(prefabName, prefab, parent)); }