Ejemplo n.º 1
0
 /// <summary>
 /// 移除SVN资源
 /// </summary>
 private static void RemoveSVNResources()
 {
     for (int i = s_CopyFolder.Count - 1; s_CopyFolder.Count > 0 && i >= 0; --i)
     {
         HS_Base.SystemDeleteFolder(s_CopyFolder[i]);
     }
     HS_File.Delete(Application.streamingAssetsPath + @"/Mainfest.data");
 }
Ejemplo n.º 2
0
        static public void BuildForWindows(HS_EditDefine.HS_ChannelDefine channelDefine)
        {
            LoadConfig();

            ChannelConfig channelConfig = S_AllChannelConfig[channelDefine.ToString()];
            //string channel = channelConfig.channel;
            string packerName = channelConfig.packerName;
            string rootPath   = S_RootPath;

            PlayerSettings.bundleIdentifier            = packerName;
            PlayerSettings.defaultInterfaceOrientation = UIOrientation.LandscapeLeft;
            string path = rootPath + "/Client/Windows";

            HS_Directory.CreateDirectory(path);

            try
            {
                HS_Base.SystemDeleteFolder(path);
            }
            catch (System.Exception _e)
            {
                D.LogForce("Ignore: " + _e.ToString());
            }

            string lastDefineSymbols = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone);

            if (!string.IsNullOrEmpty(channelConfig.defineSymbols))
            {
                PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, channelConfig.defineSymbols);
            }
            else
            {
                PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone, "");
            }
            if (!string.IsNullOrEmpty(lastDefineSymbols))
            {
                PlayerSettings.SetScriptingDefineSymbolsForGroup(BuildTargetGroup.Android, lastDefineSymbols);
            }

            path += "/" + packerName + ".exe";

            //FilterEditorDLL(FilterEditorDLLModel.Assets2Backups);
            //更新SVN并且拷贝到streamingAssets
            SVNUpdate(RuntimePlatform.WindowsPlayer);

            BuildPipeline.BuildPlayer(GetBuildScenes(), path, BuildTarget.StandaloneWindows64, BuildOptions.None);
            //FilterEditorDLL(FilterEditorDLLModel.Backups2Assets);
            RemoveSVNResources();
            AssetDatabase.Refresh();
            System.Diagnostics.Process.Start(HS_Path.GetDirectoryName(path));
        }
Ejemplo n.º 3
0
        public static void SVNUpdate(RuntimePlatform platform)
        {
            string platformAssets = HS_PlatformRes.Directory[platform];

            SVNSetiingWindows.Update();
            string streamingAssetsPath = Application.streamingAssetsPath;

            HS_Directory.CreateDirectory(streamingAssetsPath);

            s_CopyFolder.Clear();
            foreach (string p in SVNSetiingWindows.UpdatePaths)
            {
                string folderName     = HS_Path.GetCurrentFolder(p);
                string fullFolderName = streamingAssetsPath + @"/" + folderName;
                try
                {
                    HS_Base.SystemDeleteFolder(fullFolderName);
                }
                catch (System.Exception _e)
                {
                    D.LogForce("Ignore: " + _e.ToString());
                }
            }
            AssetDatabase.Refresh();

            foreach (string p in SVNSetiingWindows.UpdatePaths)
            {
                string dstPath = streamingAssetsPath + @"/";

                if (p.Contains("Assets"))
                {
                    if (!p.Contains(platformAssets))
                    {
                        continue;
                    }
                    dstPath += platformAssets;
                }
                else
                {
                    dstPath += HS_Path.GetCurrentFolder(p);
                }
                s_CopyFolder.Add(dstPath);
                HS_Base.SystemCopyDirectory(p, dstPath, new string[] { ".svn", ".bat", ".dll" });
            }
            AssetDatabase.Refresh();
            HS_GenerateMD5.GenerateMD5(streamingAssetsPath, "");
        }