Beispiel #1
0
        public static void GetInfoPostHook(AnimationKeyInfo __instance, bool __result, float __state, string name, float rate, ref Vector3[] value, bool[] flag)
        {
            if (!__result)
            {
                return;
            }

            rate = __state;

            if (rate < 0f || rate > 1f)
            {
                var dictInfo = (Dictionary <string, List <AnimationKeyInfo.AnmKeyInfo> >)akf_dictInfo.GetValue(__instance);

                List <AnimationKeyInfo.AnmKeyInfo> list = dictInfo[name];


                if (flag[0])
                {
                    value[0] = SliderMath.CalculatePosition(list, rate);
                }
                if (flag[1])
                {
                    value[1] = SliderMath.SafeCalculateRotation(value[1], name, list, rate);
                }
                if (flag[2])
                {
                    value[2] = SliderMath.CalculateScale(list, rate);
                }
            }
        }
Beispiel #2
0
        public static void GetInfoSingularPostHook(AnimationKeyInfo __instance, bool __result, float __state, string name, float rate, ref Vector3 value, byte type)
        {
            if (!__result)
            {
                return;
            }

            rate = __state;

            if (rate < 0f || rate > 1f)
            {
                var dictInfo = (Dictionary <string, List <AnimationKeyInfo.AnmKeyInfo> >)akf_dictInfo.GetValue(__instance);

                List <AnimationKeyInfo.AnmKeyInfo> list = dictInfo[name];

                switch (type)
                {
                case 0:
                    value = SliderMath.CalculatePosition(list, rate);
                    break;

                case 1:
                    value = SliderMath.SafeCalculateRotation(value, name, list, rate);
                    break;

                default:
                    value = SliderMath.CalculateScale(list, rate);
                    break;
                }
            }
        }