Exemplo n.º 1
0
        public static ModelLoader GetModelLoader(string resourceName, string childPath)
        {
            ModelLoader loader = null;

            if (cacheLoaders.ContainsKey(resourceName))
            {
                loader           = cacheLoaders[resourceName];
                loader.m_RefNum += 1;
            }
            else
            {
                loader = new ModelLoader(resourceName, childPath);
                cacheLoaders.Add(resourceName, loader);
            }
            return(loader);
        }
Exemplo n.º 2
0
        private IEnumerator LoadBody()
        {
            bool        isSkinLoadSuc  = false;
            bool        isModelLoadSuc = false;
            IEnumerator itor           = null;

            if (m_SkinLoader == null)
            {
                m_SkinLoader = SkinnLoader.GetkinnedMeshRendererLoader(m_ResuceName, m_ChildPath);
            }
            if (m_SkinLoader != null)
            {
                itor = m_SkinLoader.LoadMeshRenderer();
                while (itor.MoveNext())
                {
                    yield return(null);
                }
                isSkinLoadSuc = m_SkinLoader.IsLoadSuc;
            }
            if (m_ModelLoader == null)
            {
                m_ModelLoader = ModelLoader.GetModelLoader(m_ResuceName, m_ChildPath);
            }
            if (m_ModelLoader != null)
            {
                itor = m_ModelLoader.LoadModel();
                while (itor.MoveNext())
                {
                    yield return(null);
                }
                isModelLoadSuc = m_ModelLoader.IsLoadSuc;
            }

            if (m_callBackDownLoadFinish != null)
            {
                m_callBackDownLoadFinish(this, isSkinLoadSuc || isModelLoadSuc);
            }
        }