https://github.com/sunsided/unity-bezier-splines
Bezier splines and editor scripting in Unity
https://github.com/sunsided/unity-bezier-splines
bezier-curves editor-scripting unity unity3d
Last synced: about 1 month ago
JSON representation
Bezier splines and editor scripting in Unity
- Host: GitHub
- URL: https://github.com/sunsided/unity-bezier-splines
- Owner: sunsided
- License: mit
- Created: 2019-08-25T14:56:11.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-02-21T11:23:05.000Z (about 5 years ago)
- Last Synced: 2025-02-13T08:27:43.750Z (3 months ago)
- Topics: bezier-curves, editor-scripting, unity, unity3d
- Language: C#
- Size: 174 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unity Bezier Curves / Editor Scripting
Some experiments with Unity Editor scripting and Bezier Splines. This code
draws some inspiration from the [Bezier Curve Editor](https://assetstore.unity.com/packages/tools/bezier-curve-editor-11278) Unity asset; especially borrowing the
technique to render _all_ handles even if a specific waypoint object is selected.Implemented features:
- Game objects transforms as waypoints,
- Gizmos for rendering the curve outside the editor,
- Editor GUI handles for modifying control points,
- Re-using the same Editor GUI for both node and path components,
- Connected, symmetric and broken handles,
- Open and closed curves.
The inspector GUI dynamically generates the list of waypoints from the child
objects of the path and provides a context menu for appending and prepending
nodes, as well as clearing the path entirely.
Lastly, here's a video of the path being edited:
