https://github.com/miguel12345/UnityShapes
  
  
    Draw shapes (circle,line,arrow) with one line of code in Unity 
    https://github.com/miguel12345/UnityShapes
  
        Last synced: 6 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 (over 7 years ago)
 - Default Branch: master
 - Last Pushed: 2020-09-15T01:47:10.000Z (about 5 years ago)
 - Last Synced: 2024-08-03T19:09:50.285Z (over 1 year 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 - commit/miguel12345/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

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.