Created
August 20, 2018 06:03
-
-
Save smkplus/51f09bb2ca34c9871896dd20a54fc0a1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void OnDrawGizmos() { | |
Gizmos.color = Color.yellow; | |
float theta = 0; | |
float Radius = transform.localScale.magnitude; | |
float x = Radius*Mathf.Cos(theta); | |
float y = Radius*Mathf.Sin(theta); | |
Vector3 pos = transform.position+new Vector3(x,0,y); | |
Vector3 newPos = pos; | |
Vector3 lastPos = pos; | |
for(theta = 0.1f;theta<Mathf.PI*2;theta+=0.1f){ | |
x = Radius*Mathf.Cos(theta); | |
y = Radius*Mathf.Sin(theta); | |
newPos = transform.position+ new Vector3(x,0,y); | |
Gizmos.DrawLine(pos,newPos); | |
pos = newPos; | |
} | |
Gizmos.DrawLine(pos,lastPos); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment