質問編集履歴
2
移動用のソースも追加させていただきました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,7 +16,11 @@
|
|
16
16
|
|
17
17
|
```c#
|
18
18
|
|
19
|
+
public GameObject AttackBallPrefab;
|
20
|
+
|
21
|
+
|
22
|
+
|
19
|
-
public void OnTriggerEnter(Collider other)
|
23
|
+
public void OnTriggerEnter(Collider other)
|
20
24
|
|
21
25
|
{
|
22
26
|
|
@@ -46,6 +50,36 @@
|
|
46
50
|
|
47
51
|
}
|
48
52
|
|
53
|
+
|
54
|
+
|
55
|
+
void Update () {
|
56
|
+
|
57
|
+
if(Input.GetKeyDown(KeyCode.LeftArrow))
|
58
|
+
|
59
|
+
{
|
60
|
+
|
61
|
+
this.transform.position = new Vector3(-1.0f, 0.45f, -8.5f);
|
62
|
+
|
63
|
+
}
|
64
|
+
|
65
|
+
else if(Input.GetKeyDown(KeyCode.DownArrow))
|
66
|
+
|
67
|
+
{
|
68
|
+
|
69
|
+
this.transform.position = new Vector3(0.0f, 0.45f, -8.5f);
|
70
|
+
|
71
|
+
}
|
72
|
+
|
73
|
+
else if(Input.GetKeyDown(KeyCode.RightArrow))
|
74
|
+
|
75
|
+
{
|
76
|
+
|
77
|
+
this.transform.position = new Vector3(1.0f, 0.45f, -8.5f);
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
}
|
82
|
+
|
49
83
|
```
|
50
84
|
|
51
85
|
一応オブジェクトは生成されているみたいなのですが、オブジェクトを投げるタイミングが
|
1
移動用のソースも追加させていただきました。
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|