예제 #1
0
        private static IEnumerable <Vector3> NewCatmullRom <T>(IList nodes, WeaponTrail.ToVector3 <T> toVector3, int slices, bool loop)
        {
            if (nodes.get_Count() >= 2)
            {
                yield return(toVector3((T)((object)nodes.get_Item(0))));

                int num  = nodes.get_Count() - 1;
                int num2 = 0;
                while (loop || num2 < num)
                {
                    if (loop && num2 > num)
                    {
                        num2 = 0;
                    }
                    int num3 = (num2 == 0) ? (loop ? num : num2) : (num2 - 1);
                    int num4 = num2;
                    int num5 = (num2 == num) ? (loop ? 0 : num2) : (num2 + 1);
                    int num6 = (num5 == num) ? (loop ? 0 : num5) : (num5 + 1);
                    int num7 = slices + 1;
                    int num8;
                    for (int i = 1; i <= num7; i = num8 + 1)
                    {
                        yield return(WeaponTrail.CatmullRom(toVector3((T)((object)nodes.get_Item(num3))), toVector3((T)((object)nodes.get_Item(num4))), toVector3((T)((object)nodes.get_Item(num5))), toVector3((T)((object)nodes.get_Item(num6))), (float)i, (float)num7));

                        num8 = i;
                    }
                    num8 = num2;
                    num2 = num8 + 1;
                }
            }
            yield break;
        }
예제 #2
0
        private static IEnumerable <Vector3> NewCatmullRom <T>(IList nodes, WeaponTrail.ToVector3 <T> toVector3, int slices, bool loop)
        {
            if (nodes.Count >= 2)
            {
                yield return(toVector3((T)((object)nodes[0])));

                int num  = nodes.Count - 1;
                int num2 = 0;
                while (loop || num2 < num)
                {
                    if (loop && num2 > num)
                    {
                        num2 = 0;
                    }
                    int index  = (num2 != 0) ? (num2 - 1) : ((!loop) ? num2 : num);
                    int index2 = num2;
                    int num3   = (num2 != num) ? (num2 + 1) : ((!loop) ? num2 : 0);
                    int index3 = (num3 != num) ? (num3 + 1) : ((!loop) ? num3 : 0);
                    int num4   = slices + 1;
                    for (int i = 1; i <= num4; i++)
                    {
                        yield return(WeaponTrail.CatmullRom(toVector3((T)((object)nodes[index])), toVector3((T)((object)nodes[index2])), toVector3((T)((object)nodes[num3])), toVector3((T)((object)nodes[index3])), (float)i, (float)num4));
                    }
                    num2++;
                }
            }
            yield break;
        }
예제 #3
0
 public static IEnumerable <Vector3> NewCatmullRom(Vector3[] points, int slices, bool loop)
 {
     if (WeaponTrail.< > f__mg$cache1 == null)
     {
         WeaponTrail.< > f__mg$cache1 = new WeaponTrail.ToVector3 <Vector3>(WeaponTrail.CastVector3Func);
     }
     return(WeaponTrail.NewCatmullRom <Vector3>(points, WeaponTrail.< > f__mg$cache1, slices, loop));
 }
예제 #4
0
 public static IEnumerable <Vector3> NewCatmullRom(Transform[] nodes, int slices, bool loop)
 {
     if (WeaponTrail.< > f__mg$cache0 == null)
     {
         WeaponTrail.< > f__mg$cache0 = new WeaponTrail.ToVector3 <Transform>(WeaponTrail.TransformDotPosition);
     }
     return(WeaponTrail.NewCatmullRom <Transform>(nodes, WeaponTrail.< > f__mg$cache0, slices, loop));
 }