-
Notifications
You must be signed in to change notification settings - Fork 0
/
AxisJoint.cs
35 lines (31 loc) · 1.07 KB
/
AxisJoint.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AxisJoint : MonoBehaviour {
public Axis axis;
void OnDrawGizmos () {
Vector3 a = this.transform.position;
Vector3 size = Vector3.one * 0.05f;
if (this.axis == Axis.X) {
Gizmos.color = Color.red;
for (int i = 0; i < 10; i++) {
Vector3 b = this.transform.TransformPoint(Vector3.right*(i*0.05f));
Gizmos.DrawWireCube(b, size);
}
}
if (this.axis == Axis.Y) {
Gizmos.color = Color.green;
for (int i = 0; i < 10; i++) {
Vector3 b = this.transform.TransformPoint(Vector3.up*(i*0.05f));
Gizmos.DrawWireCube(b, size);
}
}
if (this.axis == Axis.Z) {
Gizmos.color = Color.blue;
for (int i = 0; i < 10; i++) {
Vector3 b = this.transform.TransformPoint(Vector3.forward*(i*0.05f));
Gizmos.DrawWireCube(b, size);
}
}
}
}