Exemplo n.º 1
0
        private int seekRightKeyFrame(int aboveFrameNumber, ShapeElement forElement, int forFlag)
        {
            int firstIndex = -1;

            for (int i = 0; i < KeyFrames.Length; i++)
            {
                AnimationKeyFrame keyframe = KeyFrames[i];

                AnimationKeyFrameElement kelem = keyframe.GetKeyFrameElement(forElement);
                if (kelem != null && kelem.IsSet(forFlag))
                {
                    if (firstIndex == -1)
                    {
                        firstIndex = i;
                    }
                    if (keyframe.Frame <= aboveFrameNumber)
                    {
                        continue;
                    }

                    return(i);
                }
            }

            return(firstIndex);
        }
Exemplo n.º 2
0
        private int seekLeftKeyFrame(int leftOfKeyFrameIndex, ShapeElement forElement, int forFlag)
        {
            for (int i = 0; i < KeyFrames.Length; i++)
            {
                int index = GameMath.Mod(leftOfKeyFrameIndex - i - 1, KeyFrames.Length);
                AnimationKeyFrame keyframe = KeyFrames[index];

                AnimationKeyFrameElement kelem = keyframe.GetKeyFrameElement(forElement);
                if (kelem != null && kelem.IsSet(forFlag))
                {
                    return(index);
                }
            }

            return(-1);
        }