Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
NotificationsYou must be signed in to change notification settings

erdemgonul/UnityBezierCurve

Repository files navigation

Unity 2D Curve Draw & Collider is a component for drawing Bezier Curves and colliding them automatically from Script.

Preview

Tinypic.com Preview Image of Collider

Installation:

Method 1:

* Open your Unity project* Go to Assets > Import Package > Custom Package > Browse * Select beziercurve.unitypackage * Select all the files* Click on Import

Method 2:

* Simply drag the Unity Bezier Curve folder to your project

Usage

From Script

You can add the Bezier Curve Drawer and Bezier Curve Collider2D from script

EdgeCollider2Dcollider=lineRenderer.AddComponent<EdgeCollider2D>();BezierCurve2DcurveDrawer=lineRenderer.AddComponent<BezierCurve2D>();curveDrawer.drawQuadraticCurve(lineRenderer,500,startPoint,edgePoint,endPoint);BezierCurve2DCollidercurveCollider=linePart.AddComponent<BezierCurve2DCollider>();curveCollider.CreateColliderQuadraticCurve2D(collider,500,startPoint,edgePoint,endPoint);

drawQuadraticCurve() draws a line according to given parameters.

Parameters of drawQuadraticCurve()
  • LineRenderer
  • Point number between the start point and end point
  • Starting Vector3 of the Line
  • EdgePoint Vector3 of the Line
  • EndPoint Vector3 of the Line

CreateColliderQuadraticCurve2D() creates a EdgeCollider2D according to given parameters at the specified line.

Parameters of CreateColliderQuadraticCurve2D()
  • EdgeCollider2D of the lineRenderer
  • Point number between the start point and end point
  • Starting Vector3 of the Line
  • EdgePoint Vector3 of the Line
  • EndPoint Vector3 of the Line

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp