質問編集履歴

1

コード

2019/10/06 13:28

投稿

msaba
msaba

スコア14

test CHANGED
File without changes
test CHANGED
@@ -1,7 +1,51 @@
1
- Assets/Scenes/SavasController.cs(15,14): warning CS8321: The local function 'OnTriggerEnter2D' is declared but never used
1
+ ```Assets/Scenes/SavasController.cs(15,14): warning CS8321: The local function 'OnTriggerEnter2D' is declared but never used
2
2
 
3
3
 
4
4
 
5
5
  これは何をつたえたいのでしょうか
6
6
 
7
7
  写真も要望があればはります
8
+
9
+ ```C#
10
+
11
+ コードusing UnityEngine;
12
+
13
+ using System.Collections;
14
+
15
+
16
+
17
+ public class SavasController : MonoBehaviour
18
+
19
+ {
20
+
21
+ void Update()
22
+
23
+ {
24
+
25
+ transform.Translate(0, 0.2f, 0);
26
+
27
+
28
+
29
+ if (transform.position.y > 5)
30
+
31
+ {
32
+
33
+ Destroy(gameObject);
34
+
35
+ }
36
+
37
+
38
+
39
+ void OnTriggerEnter2D(Collider2D coll)
40
+
41
+ {
42
+
43
+ Destroy(coll.gameObject);
44
+
45
+ Destroy(gameObject);
46
+
47
+ }
48
+
49
+ }
50
+
51
+ }```