質問編集履歴
1
提示画像を追加とコードを追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,8 +6,88 @@
|
|
6
6
|
|
7
7
|
|
8
8
|
|
9
|
+
```ここに言語を入力
|
9
10
|
|
11
|
+
using System.Collections;
|
12
|
+
|
13
|
+
using System.Collections.Generic;
|
14
|
+
|
15
|
+
using UnityEngine;
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
public class Weapon : MonoBehaviour
|
20
|
+
|
21
|
+
{
|
22
|
+
|
23
|
+
private bool isEnemy;
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
public bool EnemyCol
|
28
|
+
|
29
|
+
{
|
30
|
+
|
31
|
+
get{return isEnemy;}
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
// Start is called before the first frame update
|
40
|
+
|
41
|
+
void Start()
|
42
|
+
|
43
|
+
{
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
}
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
// Update is called once per frame
|
52
|
+
|
53
|
+
void Update()
|
54
|
+
|
55
|
+
{
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
private void OnTriggerEnter(Collider other)
|
64
|
+
|
65
|
+
{
|
66
|
+
|
67
|
+
if(other.gameObject.tag == "Enemy")
|
68
|
+
|
69
|
+
{
|
70
|
+
|
71
|
+
isEnemy = true;
|
72
|
+
|
73
|
+
}else{
|
74
|
+
|
75
|
+
isEnemy = false;
|
76
|
+
|
77
|
+
}
|
78
|
+
|
79
|
+
}
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
}
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
```
|
10
88
|
|
11
89
|
|
12
90
|
|
13
91
|
![イメージ説明](3245905831149f99b428507f35952bf6.png)
|
92
|
+
|
93
|
+
![イメージ説明](e9b48c132c990e6357287b8d119f381e.png)
|