Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miguel12345/UnityShapes
Draw shapes (circle,line,arrow) with one line of code in Unity
https://github.com/miguel12345/UnityShapes
Last synced: 2 months ago
JSON representation
Draw shapes (circle,line,arrow) with one line of code in Unity
- Host: GitHub
- URL: https://github.com/miguel12345/UnityShapes
- Owner: miguel12345
- License: mit
- Created: 2018-03-02T17:53:06.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-09-15T01:47:10.000Z (over 4 years ago)
- Last Synced: 2024-08-03T19:09:50.285Z (6 months ago)
- Language: C#
- Size: 646 KB
- Stars: 117
- Watchers: 8
- Forks: 26
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-unity-open-source-on-github - UnityShapes - Draw shapes (circle,line,arrow) with one line of code (Mesh)
README
# UnityShapes
Draw anti-aliased, GPU-instance-supported, 0 allocation shapes (circle,line,arrow) with one line of code in Unity![](screenshot.png)
Couldn't´t be simpler:
```c#
Circle.Draw(new CircleInfo{
center = transform.position,
forward = transform.forward,
radius = 1f,
fillColor = Color.Red
});
```Lots of customization options
```c#
public struct CircleInfo
{
public float radius;
public Vector3 center;
public Vector3 forward;public Color fillColor;
public bool bordered;
public Color borderColor;
public float borderWidth;public bool isSector;
public float sectorInitialAngleInDegrees;
public float sectorArcLengthInDegrees;
}
``````c#
public struct LineInfo
{
public Vector3 startPos;
public Vector3 endPos;
public Color fillColor;
public Vector3 forward;
public float width;public bool bordered;
public Color borderColor;
public float borderWidth;public bool dashed;
public float distanceBetweenDashes;
public float dashLength;public bool startArrow;
public bool endArrow;public float arrowWidth;
public float arrowLength;
}
``````c#
public struct PolygonInfo
{
public int sides;
public Vector3 center;
public float size;public Color color;
public bool bordered;
public float borderWidth;
public Color borderColor;public Quaternion rotation;
}
```Tested on standalone and WebGL, but should work on mobile as well.