{"id":14960760,"url":"https://github.com/tylertemp/saintsdraw","last_synced_at":"2025-10-24T19:30:23.338Z","repository":{"id":205577805,"uuid":"714579718","full_name":"TylerTemp/SaintsDraw","owner":"TylerTemp","description":"draw arrow, circle, and arc in Unity, using Gizmos or LineRenderer","archived":false,"fork":false,"pushed_at":"2024-09-10T08:42:05.000Z","size":355,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-09-22T11:31:13.795Z","etag":null,"topics":["unity","unity-editor","unity-gizmos","unity3d"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TylerTemp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-05T09:35:54.000Z","updated_at":"2024-09-13T07:43:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"323f4b50-9cf7-4439-bba7-70d1e3c25874","html_url":"https://github.com/TylerTemp/SaintsDraw","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"08d6f0b43e77eb19b06b332fbbedfa1639eef853"},"previous_names":["tylertemp/saintsdraw"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerTemp%2FSaintsDraw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerTemp%2FSaintsDraw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerTemp%2FSaintsDraw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TylerTemp%2FSaintsDraw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TylerTemp","download_url":"https://codeload.github.com/TylerTemp/SaintsDraw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219867815,"owners_count":16554365,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["unity","unity-editor","unity-gizmos","unity3d"],"created_at":"2024-09-24T13:22:54.899Z","updated_at":"2025-10-24T19:30:22.922Z","avatar_url":"https://github.com/TylerTemp.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SaintsDraw #\n\n[![openupm](https://img.shields.io/npm/v/today.comes.saintsdraw?label=openupm\u0026registry_uri=https://package.openupm.com)](https://openupm.com/packages/today.comes.saintsdraw/)\n[![openupm](https://img.shields.io/badge/dynamic/json?color=brightgreen\u0026label=downloads\u0026query=%24.downloads\u0026suffix=%2Fmonth\u0026url=https%3A%2F%2Fpackage.openupm.com%2Fdownloads%2Fpoint%2Flast-month%2Ftoday.comes.saintsdraw)](https://openupm.com/packages/today.comes.saintsdraw/)\n\n`SaintsDraw` allow you to draw arrow, circle, and arc in Unity, using Gizmos or LineRenderer\n\nDeveloped by: [TylerTemp](https://github.com/TylerTemp), [墨瞳](https://github.com/xc13308)\n\nUnity: 2019.1 or above\n\n## Installation ##\n\n*   Using [OpenUPM](https://openupm.com/packages/today.comes.saintsdraw/)\n\n    ```bash\n    openupm add today.comes.saintsdraw\n    ```\n\n*   Using git upm:\n\n    add this line to manifest.json in your project\n\n    ```javascript\n    {\n        \"dependencies\": {\n            \"today.comes.saintsdraw\": \"https://github.com/TylerTemp/SaintsDraw.git\",\n            // your other dependencies...\n        }\n    }\n    ```\n\n*   Using a unitypackage:\n\n    Go to the [Release Page](https://github.com/TylerTemp/SaintsDraw/releases) to download a desired version of unitypackage and import it to your project\n\n*   Using a git submodule:\n\n    ```bash\n    git submodule add https://github.com/TylerTemp/SaintsDraw.git Assets/SaintsDraw\n    ```\n\n## Change Log ##\n\n**1.0.4**\n\nMake the arrow drawing helper public\n\nSee [the full change log](https://github.com/TylerTemp/SaintsDraw/blob/master/CHANGELOG.md).\n\n## Draw ##\n\n### Arrow ###\n\n![arrow](https://github.com/TylerTemp/SaintsDraw/assets/6391063/603ec523-98de-45b0-87a6-50761a3d5a8c)\n\nUsing `Arrow.Draw` to draw an arrow, which has parameters:\n\n*   `Vector3 from` point where the arrow starts (tail)\n*   `Vector3 to` points where the arrow ends (head)\n*   `float arrowHeadLength  = 0.5f`\n*   `float arrowHeadAngle = 20.0f`\n*   `Vector3? up = null` up direction of the arrow, default is `Vector3.up`. This is useful when you have some rotation on the arrow. The arrow is always perpendicular to this `up` direction.\n\nAppend a `LineRenderer` as the first parameter to draw the arrow using `LineRenderer`\n\n```csharp\nusing SaintsDraw;\nArrow.Draw(Vector3.zero, Vector3.one);\n```\n\n### Circle (Disk) ###\n\n![circle](https://github.com/TylerTemp/SaintsDraw/assets/6391063/6eaef5f9-2b00-433c-86a9-368c04061ebe)\n\nUsing `Circle.Draw` to draw an circle (disk), which has parameters:\n\n*   `Vector3 center` center of the circle\n*   `float radius` radius of the circle\n*   `Vector3 upward` up direction of the circle. The circle is always perpendicular to this value. Usually `Vector3.up` is used\n*   `int numSegments` how many segments to draw for the arc. The bigger it is, the smoother the arc is\n\nUsing `Circle.DrawBySegCount` to draw an circle with fixed segment steps, which means each segment will have the same angle. It has the same parameters as `Circle.Draw` except `int numSegments` is replaced by `float segAngle`.\n\nAppend a `LineRenderer` as the first parameter to draw the arc using `LineRenderer`\n\n```csharp\nusing SaintsDraw;\nCircle.Draw(Vector3.zero, 5f, Vector3.up, 40);\n```\n\n### Arc ###\n\n![circle_arc](https://github.com/TylerTemp/SaintsDraw/assets/6391063/bb6ca2e8-cb52-405c-954a-c31773c0a629)\n\n\nUsing `Arc.Draw` to draw an arc, which has parameters:\n\n*   `Vector3 center` center of the arc\n*   `float radius` radius of the arc\n*   `float fromArc` angle to start\n*   `float toArc` angle to end\n*   `Vector3 upward` up direction of the arc. The arc is always perpendicular to this value. Usually `Vector3.up` is used\n*   `Vector3 plate` as the arc no has a plate which is perpendicular to the arc, this parameter is used to determine the plate's start point. It'll be automatically put on the plate defined by the `upward` direction.\n\n    Usually `Vector3.left` or `Vector3.forward` is used\n\n*   `int numSegments` how many segments to draw for the arc. The bigger it is, the smoother the arc is\n\nUsing `Arc.DrawBySegCount` to draw an with fixed segment steps, which means each segment will have the same angle. It has the same parameters as `Arc.Draw` except `int numSegments` is replaced by `float segAngle`.\n\n\nAppend a `LineRenderer` as the first parameter to draw the arc using `LineRenderer`\n\n```csharp\nusing SaintsDraw;\nArc.Draw(Vector3.zero, 5f, 60f, 120f, Vector3.up, Vector3.left, 40);\n```\n\n### `DrawWireRectTransform` ###\n\n```csharp\nUIGizmos.DrawWireRectTransform(RectTransform rectTransform, Camera camera=null, float distance=5f)\n```\n\nDraw a wireframe of a RectTransform in the scene view. This works even the `RectTransform` has rotation and scale.\n\nParameters:\n*   `RectTransform rectTransform` the RectTransform to draw\n*   `Camera camera` the camera of the canvas. `null` for `Overlay` type.\n*   `float distance` the distance from the camera to the wireframe. This only works if you pass the camera parameter which is the target camera of the canvas, and ensure your `rectTransform` is under this canvas too.\n\n```csharp\nUIGizmos.DrawWireRectTransform(GetComponent\u003cRectTransform\u003e());\n```\n\n![DrawWireRectTransform](https://github.com/TylerTemp/SaintsDraw/assets/6391063/bf4c2d67-0731-4cd2-aad3-1653bc9420ac)\n\n## Some Tools ##\n\n### Gizmos Color ###\n\n```csharp\nusing (new ColorScoop(Color.green))\n{\n    Arrow.Draw(Vector2.zero, Vector2.up);\n}\n```\n\n### Gizmos Matrix ###\n\nUseful if you want to draw gizmos in local space inheriting parent's scale and rotation\n\n```csharp\nusing (new MatrixScoop(transform.localToWorldMatrix))\n{\n    Arrow.Draw(Vector2.zero, Vector2.up);\n}\n```\n\n### Arc Tools ###\n\nthis will normalized your angle, which allow over 360 but will has no overlap\n\n```csharp\n(float normFromArc, float normToArc) = Arc.NormalAngleRange(_fromArc, _toArc);\n```\n\nthis will display an arrow from arc center to the angle you want to check, helpful when testing `upward` and `plate`\n\n```csharp\nVector3 startPos = Arc.GetDirection(_upward, _plate, angle).normalized * _arcRadis;\nArrow.Draw(Vector3.zero, startPos);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylertemp%2Fsaintsdraw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftylertemp%2Fsaintsdraw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftylertemp%2Fsaintsdraw/lists"}