Пример #1
0
 public void ConvertAnimationEvents()
 {
     for (int i = 0; i < m_eventList.Count; ++i)
     {
         AnimationEventInfo animationEventInfo = m_eventList[i];
         AnimationEventUtil.Serialize(out animationEventInfo.param, animationEventInfo.attribute);
     }
 }
Пример #2
0
        public AnimationEventInfo EditorClone()
        {
            AnimationEventInfo animationEventInfo = new AnimationEventInfo();

            animationEventInfo.Frame        = m_frame;
            animationEventInfo.FunctionName = m_functionName;
            animationEventInfo.param        = param;
            animationEventInfo.NomalizeTime = m_nomalizeTime;
            animationEventInfo.Time         = m_time;
            animationEventInfo.EventOnExit  = m_eventOnExit;

            animationEventInfo.attribute = AnimationEventUtil.CreateAttribute(FunctionName, param);
            return(animationEventInfo);
        }
        private static void DeserializeAnimationEvent(string line, AnimationEventState eventState)
        {
            string[] tokens = line.Split(charSeparators, System.StringSplitOptions.None);

            if (tokens.Length >= 4)
            {
                string functionName = tokens[0];
                int    frame        = int.Parse(tokens[1]);

                float time = 0.0f;
                if (tokens.Length >= 3)
                {
                    float.TryParse(tokens[2], out time);
                }

                string param = "";
                if (tokens.Length >= 4)
                {
                    param = tokens[3];
                }

                bool eventOnExit = false;
                if (tokens.Length >= 5)
                {
                    bool.TryParse(tokens[4], out eventOnExit);
                }


                AnimationEventInfo animationEventInfo = new AnimationEventInfo();
                animationEventInfo.FunctionName = functionName;

                animationEventInfo.Frame = frame;
                //animationEvent.Param = param;
                animationEventInfo.attribute = AnimationEventUtil.CreateAttribute(functionName, param);
                AnimationEventUtil.Serialize(out param, animationEventInfo.attribute);
                animationEventInfo.param        = param;
                animationEventInfo.Time         = time;
                animationEventInfo.EventOnExit  = eventOnExit;
                animationEventInfo.NomalizeTime = time / eventState.AnimationTime;

                eventState.AddAnimationEvent(animationEventInfo);
            }
        }