Beispiel #1
0
        public static string ToJson(string Name, SceneAnim sceneAnim)
        {
            var config = new AnimConfig();

            config.ToYaml(sceneAnim);
            return(JsonConvert.SerializeObject(config, Formatting.Indented));
        }
Beispiel #2
0
        public static string ToYaml(string Name, MaterialAnim MatAnim, FMAA.AnimationType animType)
        {
            var serializerSettings = new SerializerSettings()
            {
                //  EmitTags = false
            };

            serializerSettings.DefaultStyle          = YamlStyle.Any;
            serializerSettings.ComparerForKeySorting = null;
            serializerSettings.RegisterTagMapping("AnimConfig", typeof(AnimConfig));

            var config = new AnimConfig();

            config.ToYaml(MatAnim, animType);

            var    serializer = new Serializer(serializerSettings);
            string yaml       = serializer.Serialize(config, typeof(AnimConfig));

            return(yaml);
        }