Esempio n. 1
0
        public static void CreateNewEmptyUsm()
        {
            var author = new ProjectSettings.Author
            {
                Name       = "Jakub Gereg",
                NickName   = "wramp",
                WebSiteUrl = "https://github.com/wramp"
            };

            var projectSettings = new ProjectSettings
            {
                GameName    = "Skeleton Game",
                Description = $"This is description created in Unity Skeleton Maker v{_usmJsonVersion}",
                Url         = "https://github.com/wramp",
                ImageUrl    = "https://media.giphy.com/media/MX9r4jOTStUeA/giphy.gif",
                Authors     = new List <ProjectSettings.Author> {
                    author
                }
            };


            var model = new UsmJsonModel
            {
                UsmJsonVersion  = _usmJsonVersion,
                ProjectSettings = projectSettings
            };
            /*Add other settings if model changes*/



            var result = JsonConvert.SerializeObject(model);

            File.WriteAllText("ResultFromHelper.txt", result);
        }
Esempio n. 2
0
        public static void ExtractPackage(string packagename, string projectbasedir, UsmJsonModel projectUsm, Action <string> error = null)
        {
            packagename += UsmPackagefilesuffix;
            var skeletonFolderPath = GetSkeletonsFolderPath();
            var cb = Path.Combine(skeletonFolderPath, packagename);

            try
            {
                ZipFile.ExtractToDirectory(cb, projectbasedir);
            }
            catch (Exception ex)
            {
                error?.Invoke(ex.Message);
            }
            ReadmeCreator.CreateReadme(projectbasedir, projectUsm.ProjectSettings);
        }