Пример #1
0
        public static void loadAllTextureFilesToManager( ContentManager content, string path, FileInfo[] fileList, GenericManager<string, Texture2D> textureManager, string extension = null, bool append = false )
        {
            // Start loadAllTextureFiles.

            if ( !append )
            {
                textureManager.unlockList();
                textureManager.clearList();
            }
            else
                textureManager.unlockList();

            int listCount = fileList.Count();
            for (int i = 0; i < listCount; i++)
            {
                if( extension != null )
                    if( fileList[i].Extension != extension )
                        return;

                textureManager.addObject( fileList[i].ToString(), content.Load<Texture2D>( path + fileList[i].Name ) );
            }

            textureManager.lockList();
        }