Пример #1
0
        private void AppendPoint(Spline instance, Vector3 position, Quaternion rotation, Vector3 scale)
        {
            Undo.RegisterCompleteObjectUndo(instance, "AppendPoint");

            // if we want to place the point at the beginning,
            // just reverse the array, place, then reverse again
            if (PlacePosition == SplinePlacePosition.Beginning)
            {
                instance.ReversePoints();
            }

            instance.AppendPoint(position, rotation, scale);

            // un-reverses the previous reverse
            if (PlacePosition == SplinePlacePosition.Beginning)
            {
                instance.ReversePoints();
            }

            EditorUtility.SetDirty(instance);
        }