BezierCurves.BezierCurve3DEditor.CreateBezeirCurve C# (CSharp) Method

CreateBezeirCurve() private method

private CreateBezeirCurve ( ) : void
return void
        private static void CreateBezeirCurve()
        {
            BezierCurve3D curve = new GameObject("Bezier Curve", typeof(BezierCurve3D)).GetComponent<BezierCurve3D>();
            Vector3 position = Vector3.zero;
            if (Camera.current != null)
            {
                position = Camera.current.transform.position + Camera.current.transform.forward * 10f;
            }

            curve.transform.position = position;

            BezierCurve3DEditor.AddDefaultPoints(curve);

            Undo.RegisterCreatedObjectUndo(curve.gameObject, "Create Curve");

            Selection.activeGameObject = curve.gameObject;
        }