|
|
@ -5,19 +5,19 @@ namespace CameraRoll.Client.Tool {
|
|
|
|
private const float AxisLength = 0.2f;
|
|
|
|
private const float AxisLength = 0.2f;
|
|
|
|
|
|
|
|
|
|
|
|
void Start() {
|
|
|
|
void Start() {
|
|
|
|
CreateAxis(Vector3.right, Color.red);
|
|
|
|
CreateAxis(Vector3.right, Color.red, false);
|
|
|
|
CreateAxis(Vector3.up, Color.green);
|
|
|
|
CreateAxis(Vector3.up, Color.green, false);
|
|
|
|
CreateAxis(Vector3.forward, Color.blue);
|
|
|
|
CreateAxis(Vector3.forward, Color.blue, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CreateAxis(Vector3 dir, Color color) {
|
|
|
|
void CreateAxis(Vector3 dir, Color color, bool longer) {
|
|
|
|
GameObject line = new GameObject("Axis");
|
|
|
|
GameObject line = new GameObject("Axis");
|
|
|
|
line.transform.SetParent(transform, false);
|
|
|
|
line.transform.SetParent(transform, false);
|
|
|
|
LineRenderer lr = line.AddComponent<LineRenderer>();
|
|
|
|
LineRenderer lr = line.AddComponent<LineRenderer>();
|
|
|
|
lr.useWorldSpace = false;
|
|
|
|
lr.useWorldSpace = false;
|
|
|
|
lr.positionCount = 2;
|
|
|
|
lr.positionCount = 2;
|
|
|
|
lr.SetPosition(0, dir.normalized * -AxisLength);
|
|
|
|
lr.SetPosition(0, dir.normalized * -AxisLength);
|
|
|
|
lr.SetPosition(1, dir.normalized * AxisLength);
|
|
|
|
lr.SetPosition(1, dir.normalized * (longer ? 3 * AxisLength : AxisLength));
|
|
|
|
lr.material = new Material(Shader.Find("Unlit/Color")) {
|
|
|
|
lr.material = new Material(Shader.Find("Unlit/Color")) {
|
|
|
|
color = color
|
|
|
|
color = color
|
|
|
|
};
|
|
|
|
};
|
|
|
|