Exemplo n.º 1
0
        protected static int GetFrameOffset(PoseData poseData)
        {
            int frameOffset = 0;

            switch (poseData.Pose)
            {
            case (CreaturePose.Stand):
                frameOffset = 1;
                break;

            case (CreaturePose.Walk):
                double lerp = LerpHelper.ForwardReverse(0, 2, (poseData.Frame / 50.0) % 1);
                frameOffset = (int)Math.Round(lerp);
                break;

            case (CreaturePose.Attack):
                frameOffset = 3;
                break;

            case (CreaturePose.Cast):
                frameOffset = 4;
                break;
            }

            return(frameOffset);
        }