Beispiel #1
0
        public static void ImportLegacyData(this EffectManager effect_manager, string data)
        {
            List <object> data_list = data.StringToList();

            KeyValuePair <string, string> value_pair;
            string key, value;
            int    anim_idx = 0;

            for (int idx = 0; idx < data_list.Count; idx++)
            {
                value_pair = (KeyValuePair <string, string>)data_list[idx];
                key        = value_pair.Key;
                value      = value_pair.Value;

                switch (key)
                {
                case "m_animate_per":
                    effect_manager.m_animate_per = (AnimatePerOptions)int.Parse(value); break;

                case "m_begin_delay":
                    effect_manager.m_begin_delay = float.Parse(value); break;

                case "m_begin_on_start":
                    effect_manager.m_begin_on_start = bool.Parse(value); break;

                case "m_character_size":
                    effect_manager.m_character_size = float.Parse(value); break;

                case "m_display_axis":
                    effect_manager.m_display_axis = (TextDisplayAxis)int.Parse(value); break;

                case "m_line_height":
                    effect_manager.m_line_height_factor = float.Parse(value); break;

                case "m_max_width":
                    effect_manager.m_max_width = float.Parse(value); break;

                case "m_on_finish_action":
                    effect_manager.m_on_finish_action = (ON_FINISH_ACTION)int.Parse(value); break;

                case "m_px_offset":
                    effect_manager.m_px_offset = value.StringToVector2(); break;

                //				case "m_text":
                //					effect_manager.m_text = value; break;
                case "m_text_alignment":
                    effect_manager.m_text_alignment = (TextAlignment)int.Parse(value); break;

                case "m_text_anchor":
                    effect_manager.m_text_anchor = (TextAnchor)int.Parse(value); break;

                case "m_time_type":
                    effect_manager.m_time_type = (AnimationTime)int.Parse(value); break;

                case "ANIM_DATA_START":
                    if (anim_idx == effect_manager.NumAnimations)
                    {
                        effect_manager.AddAnimation();
                    }
                    idx = effect_manager.GetAnimation(anim_idx).ImportLegacyData(data_list, idx + 1);
                    anim_idx++;
                    break;
                }
            }
        }