Пример #1
0
    public bool LoadProject(string projectName)
    {//打开工程
        bool bRet = true;

        do
        {
            //清空当前工程
            ClearCurrentProject();

            //创建新工程
            m_Project = new AtlasProject();

            //读取工程文件
            m_Project.Load(projectName);

            //依次载入工程中全部小图
            List <AtlasSpriteImage> sprites = m_Project.GetAllSprites();
            foreach (var sprite in sprites)
            {
                LoadSpriteImage(sprite.Path);
                if (onSpriteImageLoad != null)
                {
                    onSpriteImageLoad(sprite.Path);
                }
            }

            //设定工程类型
            m_Project.ProjectType = PROJECT_TYPE.PROJECT_TYPE_EXIST;

            WriteRecentOpenProjectPath(m_Project.Path);
        } while (false);


        return(bRet);
    }
Пример #2
0
    private List <string> GetAllSpritePathInProject(AtlasProject project)
    {
        List <string> spriteNameTbl = new List <string>();

        if (null == project)
        {
            return(spriteNameTbl);
        }

        List <AtlasSpriteImage> spriteTable = project.GetAllSprites();

        foreach (var item in spriteTable)
        {
            spriteNameTbl.Add(item.Path);
        }

        return(spriteNameTbl);
    }