コード例 #1
0
            public void Execute(ref EudiJobHandle <ContractUpdateSplines> handle, bool wasForcedToFinish = false)
            {
                for (int i = Iteration; i < MaxLength; i++)
                {
                    var currentPointsIndex = PointsIndexes[i];

                    var     entity      = Entities[i];
                    var     moduleIndex = entity.FastGet <CatmullromSplineModule>();
                    ref var spline      = ref EudiModuleGroup <CatmullromSplineModule> .Get(entity).ListObject[moduleIndex];

                    var usedPoints = new EudiStructList <Vector3>(spline.PointsLength);

                    for (int j = 0; j < usedPoints.Length; j++)
                    {
                        var p = Points[currentPointsIndex + j];
                        usedPoints[j] = p;
                        Debug.Log("points");
                    }

                    CatmullromSplineUtility.CalculateSpline(usedPoints,
                                                            ref spline.FillerArray,
                                                            spline.UsableSegments,
                                                            spline.Tension,
                                                            spline.IsLooping);

                    Debug.Log(spline.FillerArray.Length);

                    for (int j = 0; j < spline.FillerArray.Length; j++)
                    {
                        Debug.Log(spline.FillerArray[j]);
                    }

                    usedPoints.Dispose();
                }
コード例 #2
0
            // Unity jobs
            public void Execute(int index)
            {
                var currentPointsIndex = PointsIndexes[index];

                var spline     = Splines[index];
                var usedPoints = new EudiStructList <Vector3>(spline.PointsLength);

                for (int i = 0; i < usedPoints.Length; i++)
                {
                    usedPoints[i] = Points[currentPointsIndex + i];
                }

                CatmullromSplineUtility.CalculateSpline(usedPoints,
                                                        ref spline.FillerArray,
                                                        spline.UsableSegments,
                                                        spline.Tension,
                                                        spline.IsLooping);

                usedPoints.Dispose();
            }