teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

headVertices、shaftVerticesの型を変更

2019/05/09 17:12

投稿

Bongo
Bongo

スコア10816

answer CHANGED
@@ -14,23 +14,23 @@
14
14
  public class DirectionArrow : Graphic
15
15
  {
16
16
  // 矢印の原型となる頂点の位置、およびそれらを繋ぐ順番
17
- private static readonly Vector3[] headVertices =
17
+ private static readonly Vector2[] headVertices =
18
18
  {
19
- Vector3.up + (Vector3.left * 0.5f),
19
+ Vector2.up + (Vector2.left * 0.5f),
20
- Vector3.right,
20
+ Vector2.right,
21
- Vector3.zero,
21
+ Vector2.zero,
22
- Vector3.down + (Vector3.left * 0.5f)
22
+ Vector2.down + (Vector2.left * 0.5f)
23
23
  };
24
24
  private static readonly int[][] headIndices =
25
25
  {
26
26
  new[] {0, 1, 2},
27
27
  new[] {3, 2, 1}
28
28
  };
29
- private static readonly Vector3[] shaftVertices =
29
+ private static readonly Vector2[] shaftVertices =
30
30
  {
31
- Vector3.zero,
31
+ Vector2.zero,
32
- Vector3.up + Vector3.right,
32
+ Vector2.up + Vector2.right,
33
- Vector3.down + Vector3.right
33
+ Vector2.down + Vector2.right
34
34
  };
35
35
  private static readonly int[][] shaftIndices =
36
36
  {