質問編集履歴
1
色コード追記。
test
CHANGED
File without changes
|
test
CHANGED
@@ -115,3 +115,61 @@
|
|
115
115
|
```
|
116
116
|
|
117
117
|
ご教示お願い致します。
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
### 追記。
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
色がなぜか反映されませんでした。
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
```C#
|
130
|
+
|
131
|
+
void Start()
|
132
|
+
|
133
|
+
{
|
134
|
+
|
135
|
+
GameObject newLine = new GameObject ("Line");
|
136
|
+
|
137
|
+
LineRenderer line = newLine.AddComponent<LineRenderer> ();
|
138
|
+
|
139
|
+
line.positionCount = 3;
|
140
|
+
|
141
|
+
line.startWidth = 0.2f;
|
142
|
+
|
143
|
+
line.endWidth = 0.2f;
|
144
|
+
|
145
|
+
line.startColor = Color.red;
|
146
|
+
|
147
|
+
line.endColor = Color.blue;
|
148
|
+
|
149
|
+
Vector3 pos1 = new Vector3 (0.0f, 0.0f, 0.0f);
|
150
|
+
|
151
|
+
Vector3 pos2 = new Vector3 (5.0f, 5.0f, 0.0f);
|
152
|
+
|
153
|
+
Vector3 pos3 = new Vector3 (3.0f, 2.0f, 1.0f);
|
154
|
+
|
155
|
+
line.SetPositions(new Vector3[]{pos1, pos2, pos3});
|
156
|
+
|
157
|
+
/*
|
158
|
+
|
159
|
+
Vector3[] positions = new Vector3[line.positionCount];
|
160
|
+
|
161
|
+
line.GetPositions(positions);
|
162
|
+
|
163
|
+
foreach(Vector3 vertex in positions){
|
164
|
+
|
165
|
+
Debug.Log(vertex);
|
166
|
+
|
167
|
+
}
|
168
|
+
|
169
|
+
*/
|
170
|
+
|
171
|
+
}
|
172
|
+
|
173
|
+
```
|
174
|
+
|
175
|
+
![イメージ説明](fbdc16a7952f8a8c94eaffee01cb8ad9.png)
|