Esempio n. 1
0
        private static void AcceptProject(IDictionary <string, object> dictionary, IRegistry registry)
        {
            var projectId   = ParseId(GetValue(dictionary, "Id"));
            var projectName = GetValue <string>(dictionary, "Name");

            var project = registry.CreateProject(projectId, projectName);

            ParseRegistryObjectBase(project, dictionary);

            project.SerializedVersion = ParseInt(GetValue(dictionary, "Version"));

            IDictionary <string, object> settingsDictionary;

            if (TryGetValue(dictionary, "Settings", out settingsDictionary))
            {
                project.Settings.CanvasWidth      = ParseInt(GetValue(settingsDictionary, "CanvasWidth"));
                project.Settings.CanvasHeight     = ParseInt(GetValue(settingsDictionary, "CanvasHeight"));
                project.Settings.CanvasAutoResize = ParseBoolean(GetValue(settingsDictionary, "CanvasAutoResize"), true);

                // @HACK Backwards compatibility. Try to load from the formerly serialized name
                // This can be removed after one release
                ParseTextureSettings(project.Settings.DefaultTextureSettings, GetValue(settingsDictionary, "DefaultTextureFormat"));
                ParseTextureSettings(project.Settings.DefaultTextureSettings, GetValue(settingsDictionary, "DefaultTextureSettings"));
                ParseBaseAssetExportSettings(project.Settings.DefaultAudioClipSettings, GetValue(settingsDictionary, "DefaultAudioClipSettings"));

                project.Settings.EmbedAssets             = ParseBoolean(GetValue(settingsDictionary, "EmbedAssets"), true);
                project.Settings.LocalHTTPServerPort     = ParseInt(GetValue(settingsDictionary, "LocalHTTPServerPort"), UTinyProjectSettings.DefaultLocalHTTPServerPort);
                project.Settings.MemorySize              = ParseInt(GetValue(settingsDictionary, "MemorySize"), UTinyProjectSettings.DefaultMemorySize);
                project.Settings.SingleFileHtml          = ParseBoolean(GetValue(settingsDictionary, "SingleFileHtml"), false);
                project.Settings.IncludeWSClient         = ParseBoolean(GetValue(settingsDictionary, "IncludeWSClient"), true);
                project.Settings.IncludeWebPDecompressor = ParseBoolean(GetValue(settingsDictionary, "IncludeWebPDecompressor"), false);
                project.Settings.RunBabel = ParseBoolean(GetValue(settingsDictionary, "RunBabel"), true);
            }

            project.Module        = ParseModuleReference(GetValue(dictionary, "Module"));
            project.Configuration = ParseEntityReference(GetValue(dictionary, "Configuration"));
        }