예제 #1
0
        public bool Save(string targetLocation)
        {
            if (!SysUtil.InTheSameDrive(GState.AssetRoot, targetLocation))
            {
                Logging.Instance.Log("将要保存的 {0} 文件与资源路径不在同一个分区,无法使用相对路径。", ConstDefault.LayoutPostfix);
                Logging.Instance.Log("    请将 {0} 文件保存到分区 {1}。", ConstDefault.LayoutPostfix, Path.GetPathRoot(GState.AssetRoot));
                Logging.Instance.Log("    目标路径:{0}", targetLocation);
                Logging.Instance.Log("    资源路径:{1}", GState.AssetRoot);
                return(false);
            }

            string folderPath = Path.GetDirectoryName(targetLocation);

            m_root.Assets.AssetRoot = SysUtil.ToUnixPath(SysUtil.GetRelativePath(GState.AssetRoot, folderPath));

            if (!m_archiveSys.Save(m_root, targetLocation))
            {
                m_root.Assets.AssetRoot = GState.AssetRoot;
                return(false);
            }

            if (m_currentFilePath != targetLocation)
            {
                m_currentFilePath = targetLocation;
            }
            return(true);
        }