コード例 #1
0
    void Calculate()
    {
        if (selcount == 0)
        {
            return;
        }
        pos = new UnityEngine.Vector3[selcount];
        up  = new UnityEngine.Vector3[selcount];
        tan = new UnityEngine.Vector3[selcount];

        for (int i = 0; i < selcount; i++)
        {
            pos[i] = (UseWorldUnits) ? Spline.InterpolateByDistance(StartOffset + Step * i) : Spline.Interpolate(StartOffset + Step * i);
            up[i]  = (UseWorldUnits) ? Spline.GetOrientationUpFast(Spline.DistanceToTF(StartOffset + Step * i)) : Spline.GetOrientationUpFast(StartOffset + Step * i);
            tan[i] = (UseWorldUnits) ? Spline.GetTangentByDistance(StartOffset + Step * i) : Spline.GetTangent(StartOffset + Step * i);
        }
    }