Пример #1
0
        private void FindAnimStatesInModule(Animation[] animations, PartModule m, string fieldName)
        {
            if (FARAnimOverrides.FieldNameForModule(m.moduleName) == fieldName)
            {
                return;
            }
            FieldInfo field = m.GetType().GetField(fieldName);

            if (field != null)        //This handles stock and Firespitter deployment animations
            {
                string animationName = (string)field.GetValue(m);
                for (int i = 0; i < animations.Length; ++i)
                {
                    Animation anim = animations[i];

                    if (anim != null)
                    {
                        AnimationState state = anim[animationName];
                        if (state)
                        {
                            animStates.Add(state);
                            animStateTime.Add(state.time);
                        }
                    }
                }
            }
        }
Пример #2
0
        private void FindAnimStatesInModule(Animation[] animations, PartModule m, string fieldName)
        {
            if (FARAnimOverrides.FieldNameForModule(m.moduleName) == fieldName)
            {
                return;
            }
            FieldInfo field = m.GetType().GetField(fieldName);

            if (field == null)
            {
                return;
            }
            //This handles stock and Firespitter deployment animations
            string animationName = (string)field.GetValue(m);

            foreach (Animation anim in animations)
            {
                if (anim == null)
                {
                    continue;
                }
                AnimationState state = anim[animationName];
                if (!state)
                {
                    continue;
                }
                animStates.Add(state);
                animStateTime.Add(state.time);
            }
        }