回答編集履歴
1
コードから無駄な個所を削除
test
CHANGED
@@ -36,43 +36,9 @@
|
|
36
36
|
|
37
37
|
|
38
38
|
|
39
|
-
// Update is called once per frame
|
40
|
-
|
41
39
|
void Update()
|
42
40
|
|
43
41
|
{
|
44
|
-
|
45
|
-
if (Input.GetKey(KeyCode.W))
|
46
|
-
|
47
|
-
{
|
48
|
-
|
49
|
-
transform.GetComponent<Rigidbody>().AddForce(0, 0, 5);
|
50
|
-
|
51
|
-
}
|
52
|
-
|
53
|
-
if (Input.GetKey(KeyCode.S))
|
54
|
-
|
55
|
-
{
|
56
|
-
|
57
|
-
transform.GetComponent<Rigidbody>().AddForce(0, 0, -5);
|
58
|
-
|
59
|
-
}
|
60
|
-
|
61
|
-
if (Input.GetKey(KeyCode.D))
|
62
|
-
|
63
|
-
{
|
64
|
-
|
65
|
-
transform.GetComponent<Rigidbody>().AddForce(5, 0, 0);
|
66
|
-
|
67
|
-
}
|
68
|
-
|
69
|
-
if (Input.GetKey(KeyCode.A))
|
70
|
-
|
71
|
-
{
|
72
|
-
|
73
|
-
transform.GetComponent<Rigidbody>().AddForce(-5, 0, 0);
|
74
|
-
|
75
|
-
}
|
76
42
|
|
77
43
|
if (Input.GetKey(KeyCode.F))
|
78
44
|
|