回答編集履歴

4

コード修正

2017/09/29 09:56

投稿

Hawn
Hawn

スコア1222

test CHANGED
@@ -104,8 +104,6 @@
104
104
 
105
105
  private float speeds = 0;
106
106
 
107
-
108
-
109
107
  private bool isBulletStart;
110
108
 
111
109
 
@@ -132,13 +130,13 @@
132
130
 
133
131
  mousePositionVec3.z = -Camera.main.transform.position.z;
134
132
 
135
-
133
+
136
134
 
137
135
  vec = Camera.main.ScreenToWorldPoint(mousePositionVec3);
138
136
 
137
+
139
138
 
140
-
141
- float zRotation = Mathf.Atan2(vec.y - transform.position.y, vec.x - transform.position.x) * Mathf.Rad2Deg - 90f;
139
+ float zRotation = Mathf.Atan2(vec.y - transform.position.y, vec.x - transform.position.x) * Mathf.Rad2Deg;
142
140
 
143
141
  transform.rotation = Quaternion.Euler(0f, 0f, zRotation);
144
142
 
@@ -148,9 +146,9 @@
148
146
 
149
147
  }
150
148
 
149
+
151
150
 
152
-
153
- transform.Translate(Vector2.up * speeds);
151
+ transform.Translate(Vector2.right * speeds);
154
152
 
155
153
 
156
154
 

3

コード修正

2017/09/29 09:56

投稿

Hawn
Hawn

スコア1222

test CHANGED
@@ -108,8 +108,6 @@
108
108
 
109
109
  private bool isBulletStart;
110
110
 
111
- private float zRotation;
112
-
113
111
 
114
112
 
115
113
  void Start()
@@ -140,7 +138,7 @@
140
138
 
141
139
 
142
140
 
143
- zRotation = Mathf.Atan2(vec.y - transform.position.y, vec.x - transform.position.x) * Mathf.Rad2Deg - 90f;
141
+ float zRotation = Mathf.Atan2(vec.y - transform.position.y, vec.x - transform.position.x) * Mathf.Rad2Deg - 90f;
144
142
 
145
143
  transform.rotation = Quaternion.Euler(0f, 0f, zRotation);
146
144
 

2

文章修正

2017/09/29 09:48

投稿

Hawn
Hawn

スコア1222

test CHANGED
@@ -84,7 +84,7 @@
84
84
 
85
85
 
86
86
 
87
- 次にクリック角度方向に真っすぐ進み、進行中は入力を受け付けないようにすると
87
+ 次にクリック角度方向に真っすぐ進み、進行中は入力を受け付けない作りにすると
88
88
 
89
89
  ```C#
90
90
 

1

文章修正

2017/09/29 09:46

投稿

Hawn
Hawn

スコア1222

test CHANGED
@@ -1,4 +1,4 @@
1
- 最初のコードを出来るだけ崩さず修正すると
1
+ 最初のコードを出来るだけ崩さず指定した方向に進むよう修正すると
2
2
 
3
3
 
4
4