Ejemplo n.º 1
0
        public AudioClip GetAudioClip(string name)
        {
            AudioClip red = ResourcesManager.Load <AudioClip>(name);

            if (red != null)
            {
                return(red);
            }
            Debug.LogError("Can not find AudioClip:" + name);
            return(null);
        }
Ejemplo n.º 2
0
        private GameObject AddObject(string key)
        {
            GameObject prefab = ResourcesManager.Load <GameObject>(key);

            if (prefab == null)
            {
                Debug.LogError("cant load resource " + key);
            }
            GameObject go = GameObject.Instantiate(prefab);

            go.name = prefab.name;
            //if (!m_cacheList.ContainsKey(key))
            //{
            //    m_cacheList.Add(key, new List<GameObject>());
            //}
            //m_cacheList[key].Add(go);

            return(go);
        }
Ejemplo n.º 3
0
        private GameObject AddObject(string key)
        {
            GameObject prefab = ResourcesManager.Load <GameObject>(key);

            if (prefab == null)
            {
                Debug.LogError("cant load resource " + key);
            }
            GameObject go = GameObject.Instantiate(prefab);

            go.name = go.name.Replace("(Clone)", "");

            if (!go.GetComponent <PrefabData>())
            {
                go.AddComponent <PrefabData>().pathName = key;
            }
            //if (!m_cacheList.ContainsKey(key))
            //{
            //    m_cacheList.Add(key, new List<GameObject>());
            //}
            //m_cacheList[key].Add(go);

            return(go);
        }