Exemple #1
0
        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));
        }
Exemple #2
0
        // 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));
        }