Пример #1
0
        public static void ImportLegacyData(this TextFxAnimationManager effect_manager, string data)
        {
            List <object> data_list = data.StringToList();

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

            effect_manager.m_master_animations = new List <LetterAnimation> ();

            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_on_finish_action":
                    effect_manager.m_on_finish_action = (ON_FINISH_ACTION)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;
                }
            }
        }