質問編集履歴
9
a
title
CHANGED
File without changes
|
body
CHANGED
@@ -47,8 +47,13 @@
|
|
47
47
|
|
48
48
|
|
49
49
|
}
|
50
|
+
|
51
|
+
```
|
52
|
+
|
50
53
|
OniController
|
54
|
+
|
51
55
|
```C#
|
56
|
+
|
52
57
|
using System.Collections;
|
53
58
|
using System.Collections.Generic;
|
54
59
|
using UnityEngine;
|
@@ -131,4 +136,5 @@
|
|
131
136
|
}
|
132
137
|
|
133
138
|
|
139
|
+
|
134
140
|
```
|
8
miss
title
CHANGED
File without changes
|
body
CHANGED
@@ -130,4 +130,5 @@
|
|
130
130
|
|
131
131
|
}
|
132
132
|
|
133
|
+
|
133
134
|
```
|
7
スクリプトの追加
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
unity3D
|
1
|
+
unity3D スクリプトのboolが全ての複数オブジェクトに反映されてしまう。
|
body
CHANGED
@@ -1,256 +1,82 @@
|
|
1
|
-
|
1
|
+
unity3dでの鬼ごっこゲームを作成しております。
|
2
2
|
|
3
|
+
プレイヤーと鬼を2対ずつ用意をしているのですが、鬼が1対のプレイヤーを捕まえた際にプレイヤーが二体とも捕まってしまうようになってしまいます。
|
3
|
-
プレイヤーと
|
4
|
+
プレイヤーごとにboolの判定を分けたい場合どのようにすれば良いかアドバイスをいただけますと幸いです。
|
4
5
|
|
5
|
-
プレイヤーを操作する際、鬼に捕まった場合は指定した座標にtransform.positionで送るように設定をしており、その四方に空のオブジェクトを生成し、ボックスコライダーで壁を作ることで牢屋を生成し、プレイヤーの動きをその範囲内でしか行動できないようにしており、
|
6
|
-
他のプレイヤーが助けにきた際に施錠できるようにするために牢屋の外側の四方に空のオブジェクトを作成しているのですが、鬼を操作した際にその牢屋の四方の内部が移動できない状態になってしまいます。(円とライトで牢屋を作成しているのでその中も動けるようにしたいと考えております。)
|
7
6
|
|
7
|
+
下記にスクリプトを追加させていただきました。
|
8
|
-
|
8
|
+
PlayerController,OniControllerでの実装をしております。
|
9
|
-
|
9
|
+
鬼がプレイヤーに近付いたらそのプレイヤーが捕獲されるにしたいと考えております。(実際は他のプレイヤーも所定の場所に飛ばされてしまいます。)
|
10
10
|
|
11
|
-
プレイヤーにはPlayerタグ、鬼にはoniタグをつけて判定を行なっております。
|
12
11
|
|
13
|
-
|
12
|
+
PlayerScripts
|
14
|
-
|
15
13
|
```C#
|
16
14
|
using System.Collections;
|
17
15
|
using System.Collections.Generic;
|
18
16
|
using UnityEngine;
|
19
|
-
|
20
|
-
public class GameController : MonoBehaviour
|
21
|
-
{
|
22
|
-
public GameObject ButtonKaiho;
|
23
|
-
public GameObject Rouya;
|
24
|
-
//プレイヤーの取得
|
25
|
-
GameObject Player;
|
26
|
-
|
27
|
-
//スクリプトの取得
|
28
|
-
public PlayerController PlayerControllerScript;
|
29
|
-
public RouyaScript RouyaScript;
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
void Start()
|
34
|
-
{
|
35
|
-
//プレイヤーの取得
|
36
|
-
this.Player = GameObject.Find("Player");
|
37
|
-
}
|
38
|
-
|
39
|
-
void Update()
|
40
|
-
{
|
41
|
-
|
42
|
-
//他のプレイヤーのロック解放
|
43
|
-
if (Rouya.GetComponent<RouyaScript>().ishelp == true)
|
44
|
-
{
|
45
|
-
ButtonKaiho.SetActive(true);
|
46
|
-
|
47
|
-
}
|
48
|
-
else
|
49
|
-
{
|
50
|
-
ButtonKaiho.SetActive(false);
|
51
|
-
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
public void OnButtonKaiho()
|
56
|
-
{
|
57
|
-
Rouya.SetActive(false);
|
58
|
-
Debug.Log("牢屋消えた");
|
59
|
-
|
60
|
-
Player.GetComponent<OniController>().isCaptured = false;
|
61
|
-
Debug.Log("プレイヤー捕まってない状態");
|
62
|
-
Rouya.GetComponent<RouyaScript>().ishelp = false;
|
63
|
-
Debug.Log("助ける状態のリセット");
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
```
|
68
|
-
```C#
|
69
|
-
using System.Collections;
|
70
|
-
using System.Collections.Generic;
|
71
|
-
using UnityEngine;
|
72
|
-
|
73
|
-
public class RouyaScript : MonoBehaviour
|
74
|
-
{
|
75
|
-
//プレイヤーの取得
|
76
|
-
GameObject Player;
|
77
|
-
public bool ishelp;
|
78
|
-
|
79
|
-
|
80
|
-
// Start is called before the first frame update
|
81
|
-
void Start()
|
82
|
-
{
|
83
|
-
//プレイヤーの取得
|
84
|
-
this.Player = GameObject.Find("Player");
|
85
|
-
|
86
|
-
}
|
87
|
-
|
88
|
-
|
89
|
-
//牢屋にプレイヤーが触れた場合
|
90
|
-
public void OnCollisionEnter(Collision hit)
|
91
|
-
{
|
92
|
-
if (hit.gameObject.tag == "Player")
|
93
|
-
|
94
|
-
if (Player.GetComponent<PlayerController>().isCaptured == false)
|
95
|
-
{
|
96
|
-
|
97
|
-
|
98
|
-
Help();
|
99
|
-
|
100
|
-
}
|
101
|
-
}
|
102
|
-
|
103
|
-
void Help()
|
104
|
-
{
|
105
|
-
ishelp = true;
|
106
|
-
|
107
|
-
}
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
}
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
```
|
116
|
-
```C#
|
117
|
-
using System.Collections;
|
118
|
-
using System.Collections.Generic;
|
119
|
-
using UnityEngine;
|
120
17
|
using UnityEngine.UI;
|
121
18
|
|
122
19
|
public class PlayerController : MonoBehaviour
|
123
20
|
{
|
124
|
-
//プレイヤーにアタッチされている足の速さを決めるスクリプト
|
125
|
-
|
21
|
+
[SerializeField] public OniController anotherScript1;
|
126
22
|
|
127
|
-
|
23
|
+
void Start()
|
128
24
|
{
|
129
25
|
|
130
26
|
|
131
27
|
anotherScript = GetComponent<UnityStandardAssets.Characters.ThirdPerson.ThirdPersonCharacter>();
|
132
28
|
|
29
|
+
GameObject anotherObject = GameObject.FindWithTag("Oni");
|
30
|
+
anotherScript1 = anotherObject.GetComponent<OniController>();
|
133
31
|
|
134
32
|
|
135
33
|
}
|
136
34
|
|
137
35
|
void Update()
|
138
36
|
{
|
139
|
-
if (
|
37
|
+
if (anotherScript1.isRouya == true)
|
140
38
|
{
|
141
|
-
|
39
|
+
float rouya_y = 1.5f;
|
142
|
-
SetValue(0);
|
143
|
-
}
|
144
40
|
|
145
|
-
|
41
|
+
transform.position = new Vector3(65, rouya_y, 65);
|
146
|
-
{
|
147
|
-
SetValue(2);
|
148
|
-
}
|
149
42
|
|
150
|
-
}
|
151
|
-
|
152
|
-
|
153
|
-
public void OnTriggerStay(Collider hit)
|
154
|
-
{
|
155
|
-
// 牢屋に触れた場合
|
156
|
-
|
157
|
-
if (hit.gameObject.tag == "Rouya")
|
158
|
-
{
|
159
|
-
|
160
|
-
Captured();
|
161
|
-
|
162
43
|
}
|
163
|
-
|
164
|
-
|
165
44
|
}
|
166
45
|
|
167
46
|
|
168
|
-
|
47
|
+
|
169
|
-
{
|
170
|
-
anotherScript.M_MoveSpeedMultiplier = value;
|
171
48
|
|
172
|
-
//Debug.Log("M_MoveSpeedMultiplie = " + anotherScript.M_MoveSpeedMultiplier);
|
173
|
-
}
|
174
|
-
|
175
|
-
public void Captured()
|
176
|
-
{
|
177
|
-
isCaptured = true;
|
178
|
-
}
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
49
|
}
|
185
|
-
|
186
|
-
|
187
|
-
```
|
188
|
-
|
50
|
+
OniController
|
189
51
|
```C#
|
190
52
|
using System.Collections;
|
191
53
|
using System.Collections.Generic;
|
192
54
|
using UnityEngine;
|
193
55
|
using UnityEngine.UI;
|
194
56
|
|
195
|
-
public class
|
57
|
+
public class OniController : MonoBehaviour
|
196
58
|
{
|
59
|
+
//プレイヤーの取得
|
197
|
-
List<GameObject>
|
60
|
+
List<GameObject> Players = new List<GameObject>();
|
198
61
|
|
62
|
+
public bool isRouya;
|
199
63
|
|
200
|
-
|
64
|
+
|
201
|
-
{
|
202
|
-
|
203
|
-
|
204
|
-
Onis.AddRange(GameObject.FindGameObjectsWithTag("Oni"));
|
205
65
|
|
66
|
+
[SerializeField] private Oni.UnityStandardAssets.Characters.ThirdPerson.Oni_ThirdPersonCharacter anotherScript;
|
206
67
|
|
207
|
-
}
|
208
68
|
|
209
69
|
|
210
|
-
void
|
70
|
+
void Start()
|
211
71
|
{
|
212
|
-
|
72
|
+
//プレイヤーの取得
|
213
|
-
{
|
214
|
-
//子要素の一つでもbool型のisHokakuがtureならば牢屋を出してあげたいのですがisHokakuの部分にエラーが出て不可能でした。
|
215
|
-
|
73
|
+
Players.AddRange(GameObject.FindGameObjectsWithTag("Player"));
|
216
|
-
{
|
217
|
-
Rouya.SetActive(true);
|
218
74
|
|
219
|
-
}
|
220
|
-
else
|
221
|
-
{
|
222
|
-
|
75
|
+
anotherScript = GetComponent<Oni.UnityStandardAssets.Characters.ThirdPerson.Oni_ThirdPersonCharacter>();
|
223
76
|
|
224
|
-
}
|
225
77
|
|
226
|
-
}
|
227
|
-
}
|
228
78
|
|
229
79
|
|
230
|
-
```
|
231
|
-
|
232
|
-
```C#
|
233
|
-
using System.Collections;
|
234
|
-
using System.Collections.Generic;
|
235
|
-
using UnityEngine;
|
236
|
-
using UnityEngine.UI;
|
237
|
-
|
238
|
-
public class OniController : MonoBehaviour
|
239
|
-
{
|
240
|
-
GameObject Player;
|
241
|
-
public bool isHokaku;
|
242
|
-
|
243
|
-
[SerializeField] private Police.UnityStandardAssets.Characters.ThirdPerson.Oni_ThirdPersonCharacter anotherScript;
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
void Start()
|
249
|
-
{
|
250
|
-
this.Player = GameObject.Find("Player");
|
251
|
-
anotherScript = GetComponent<Police.UnityStandardAssets.Characters.ThirdPerson.Police_ThirdPersonCharacter>();
|
252
|
-
|
253
|
-
|
254
80
|
}
|
255
81
|
|
256
82
|
|
@@ -260,38 +86,48 @@
|
|
260
86
|
if (hit.gameObject.tag == "Player")
|
261
87
|
{
|
262
88
|
//Debug.Log("プレイヤーと接触している");
|
89
|
+
|
263
|
-
|
90
|
+
OnButtonHokaku();
|
264
|
-
|
91
|
+
|
265
92
|
}
|
266
|
-
|
93
|
+
|
267
94
|
}
|
268
95
|
|
269
96
|
public void OnButtonHokaku()
|
270
97
|
{
|
271
98
|
|
272
|
-
|
99
|
+
|
100
|
+
|
101
|
+
|
273
|
-
Invoke("
|
102
|
+
Invoke("Rouya", 0.7f);
|
274
103
|
anotherScript.TouchStart();
|
275
104
|
Invoke("OnTouchEnd", 0.5f);
|
276
105
|
|
106
|
+
|
277
107
|
|
278
108
|
|
279
109
|
|
110
|
+
|
111
|
+
|
280
112
|
}
|
281
|
-
public void
|
113
|
+
public void Rouya()
|
282
114
|
{
|
115
|
+
|
116
|
+
|
283
|
-
|
117
|
+
isRouya = true;
|
284
|
-
float rouya_y = 1.5f;
|
285
|
-
this.Player.transform.position = new Vector3(65, rouya_y, 65);
|
286
118
|
|
119
|
+
|
120
|
+
|
287
121
|
}
|
288
|
-
|
122
|
+
//アニメーションです。
|
289
123
|
public void OnTouchEnd()
|
290
124
|
{
|
291
125
|
anotherScript.TouchEnd();
|
292
126
|
}
|
293
127
|
|
128
|
+
|
294
129
|
|
295
130
|
|
296
131
|
}
|
132
|
+
|
297
133
|
```
|
6
a
title
CHANGED
File without changes
|
body
CHANGED
@@ -57,7 +57,7 @@
|
|
57
57
|
Rouya.SetActive(false);
|
58
58
|
Debug.Log("牢屋消えた");
|
59
59
|
|
60
|
-
Player.GetComponent<
|
60
|
+
Player.GetComponent<OniController>().isCaptured = false;
|
61
61
|
Debug.Log("プレイヤー捕まってない状態");
|
62
62
|
Rouya.GetComponent<RouyaScript>().ishelp = false;
|
63
63
|
Debug.Log("助ける状態のリセット");
|
5
a
title
CHANGED
File without changes
|
body
CHANGED
@@ -227,4 +227,71 @@
|
|
227
227
|
}
|
228
228
|
|
229
229
|
|
230
|
+
```
|
231
|
+
|
232
|
+
```C#
|
233
|
+
using System.Collections;
|
234
|
+
using System.Collections.Generic;
|
235
|
+
using UnityEngine;
|
236
|
+
using UnityEngine.UI;
|
237
|
+
|
238
|
+
public class OniController : MonoBehaviour
|
239
|
+
{
|
240
|
+
GameObject Player;
|
241
|
+
public bool isHokaku;
|
242
|
+
|
243
|
+
[SerializeField] private Police.UnityStandardAssets.Characters.ThirdPerson.Oni_ThirdPersonCharacter anotherScript;
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
void Start()
|
249
|
+
{
|
250
|
+
this.Player = GameObject.Find("Player");
|
251
|
+
anotherScript = GetComponent<Police.UnityStandardAssets.Characters.ThirdPerson.Police_ThirdPersonCharacter>();
|
252
|
+
|
253
|
+
|
254
|
+
}
|
255
|
+
|
256
|
+
|
257
|
+
public void OnCollisionStay(Collision hit)
|
258
|
+
{
|
259
|
+
// 接触対象はPlayerタグですか?
|
260
|
+
if (hit.gameObject.tag == "Player")
|
261
|
+
{
|
262
|
+
//Debug.Log("プレイヤーと接触している");
|
263
|
+
OnButtonHokaku();
|
264
|
+
|
265
|
+
}
|
266
|
+
|
267
|
+
}
|
268
|
+
|
269
|
+
public void OnButtonHokaku()
|
270
|
+
{
|
271
|
+
|
272
|
+
|
273
|
+
Invoke("Hokaku", 0.7f);
|
274
|
+
anotherScript.TouchStart();
|
275
|
+
Invoke("OnTouchEnd", 0.5f);
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
}
|
281
|
+
public void Hokaku()
|
282
|
+
{
|
283
|
+
isHokaku = true;
|
284
|
+
float rouya_y = 1.5f;
|
285
|
+
this.Player.transform.position = new Vector3(65, rouya_y, 65);
|
286
|
+
|
287
|
+
}
|
288
|
+
|
289
|
+
public void OnTouchEnd()
|
290
|
+
{
|
291
|
+
anotherScript.TouchEnd();
|
292
|
+
}
|
293
|
+
|
294
|
+
|
295
|
+
|
296
|
+
}
|
230
297
|
```
|
4
a
title
CHANGED
File without changes
|
body
CHANGED
@@ -211,7 +211,7 @@
|
|
211
211
|
{
|
212
212
|
foreach (GameObject oni in Onis)
|
213
213
|
{
|
214
|
-
//子要素の一つでもbool型のisHokakuがtureならば牢屋を出してあげたいのですが
|
214
|
+
//子要素の一つでもbool型のisHokakuがtureならば牢屋を出してあげたいのですがisHokakuの部分にエラーが出て不可能でした。
|
215
215
|
if (oni.GetComponents<PoliceController>().isHokaku == true)
|
216
216
|
{
|
217
217
|
Rouya.SetActive(true);
|
3
add
title
CHANGED
File without changes
|
body
CHANGED
@@ -184,4 +184,47 @@
|
|
184
184
|
}
|
185
185
|
|
186
186
|
|
187
|
+
```
|
188
|
+
鬼のスクリプトのみ抜粋いたしました。
|
189
|
+
```C#
|
190
|
+
using System.Collections;
|
191
|
+
using System.Collections.Generic;
|
192
|
+
using UnityEngine;
|
193
|
+
using UnityEngine.UI;
|
194
|
+
|
195
|
+
public class GameController : MonoBehaviour
|
196
|
+
{
|
197
|
+
List<GameObject> Oni = new List<GameObject>();
|
198
|
+
|
199
|
+
|
200
|
+
void Start()
|
201
|
+
{
|
202
|
+
|
203
|
+
|
204
|
+
Onis.AddRange(GameObject.FindGameObjectsWithTag("Oni"));
|
205
|
+
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
|
210
|
+
void Update()
|
211
|
+
{
|
212
|
+
foreach (GameObject oni in Onis)
|
213
|
+
{
|
214
|
+
//子要素の一つでもbool型のisHokakuがtureならば牢屋を出してあげたいのですがisTaihoの部分にエラーが出て不可能でした。
|
215
|
+
if (oni.GetComponents<PoliceController>().isHokaku == true)
|
216
|
+
{
|
217
|
+
Rouya.SetActive(true);
|
218
|
+
|
219
|
+
}
|
220
|
+
else
|
221
|
+
{
|
222
|
+
Rouya.SetActive(false);
|
223
|
+
|
224
|
+
}
|
225
|
+
|
226
|
+
}
|
227
|
+
}
|
228
|
+
|
229
|
+
|
187
230
|
```
|
2
add
title
CHANGED
File without changes
|
body
CHANGED
@@ -10,4 +10,178 @@
|
|
10
10
|
|
11
11
|
プレイヤーにはPlayerタグ、鬼にはoniタグをつけて判定を行なっております。
|
12
12
|
|
13
|
-
どなたかアドバイスをいただけますと幸いです。
|
13
|
+
どなたかアドバイスをいただけますと幸いです。
|
14
|
+
|
15
|
+
```C#
|
16
|
+
using System.Collections;
|
17
|
+
using System.Collections.Generic;
|
18
|
+
using UnityEngine;
|
19
|
+
|
20
|
+
public class GameController : MonoBehaviour
|
21
|
+
{
|
22
|
+
public GameObject ButtonKaiho;
|
23
|
+
public GameObject Rouya;
|
24
|
+
//プレイヤーの取得
|
25
|
+
GameObject Player;
|
26
|
+
|
27
|
+
//スクリプトの取得
|
28
|
+
public PlayerController PlayerControllerScript;
|
29
|
+
public RouyaScript RouyaScript;
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
void Start()
|
34
|
+
{
|
35
|
+
//プレイヤーの取得
|
36
|
+
this.Player = GameObject.Find("Player");
|
37
|
+
}
|
38
|
+
|
39
|
+
void Update()
|
40
|
+
{
|
41
|
+
|
42
|
+
//他のプレイヤーのロック解放
|
43
|
+
if (Rouya.GetComponent<RouyaScript>().ishelp == true)
|
44
|
+
{
|
45
|
+
ButtonKaiho.SetActive(true);
|
46
|
+
|
47
|
+
}
|
48
|
+
else
|
49
|
+
{
|
50
|
+
ButtonKaiho.SetActive(false);
|
51
|
+
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
public void OnButtonKaiho()
|
56
|
+
{
|
57
|
+
Rouya.SetActive(false);
|
58
|
+
Debug.Log("牢屋消えた");
|
59
|
+
|
60
|
+
Player.GetComponent<PlayerController>().isCaptured = false;
|
61
|
+
Debug.Log("プレイヤー捕まってない状態");
|
62
|
+
Rouya.GetComponent<RouyaScript>().ishelp = false;
|
63
|
+
Debug.Log("助ける状態のリセット");
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
```
|
68
|
+
```C#
|
69
|
+
using System.Collections;
|
70
|
+
using System.Collections.Generic;
|
71
|
+
using UnityEngine;
|
72
|
+
|
73
|
+
public class RouyaScript : MonoBehaviour
|
74
|
+
{
|
75
|
+
//プレイヤーの取得
|
76
|
+
GameObject Player;
|
77
|
+
public bool ishelp;
|
78
|
+
|
79
|
+
|
80
|
+
// Start is called before the first frame update
|
81
|
+
void Start()
|
82
|
+
{
|
83
|
+
//プレイヤーの取得
|
84
|
+
this.Player = GameObject.Find("Player");
|
85
|
+
|
86
|
+
}
|
87
|
+
|
88
|
+
|
89
|
+
//牢屋にプレイヤーが触れた場合
|
90
|
+
public void OnCollisionEnter(Collision hit)
|
91
|
+
{
|
92
|
+
if (hit.gameObject.tag == "Player")
|
93
|
+
|
94
|
+
if (Player.GetComponent<PlayerController>().isCaptured == false)
|
95
|
+
{
|
96
|
+
|
97
|
+
|
98
|
+
Help();
|
99
|
+
|
100
|
+
}
|
101
|
+
}
|
102
|
+
|
103
|
+
void Help()
|
104
|
+
{
|
105
|
+
ishelp = true;
|
106
|
+
|
107
|
+
}
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
}
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
```
|
116
|
+
```C#
|
117
|
+
using System.Collections;
|
118
|
+
using System.Collections.Generic;
|
119
|
+
using UnityEngine;
|
120
|
+
using UnityEngine.UI;
|
121
|
+
|
122
|
+
public class PlayerController : MonoBehaviour
|
123
|
+
{
|
124
|
+
//プレイヤーにアタッチされている足の速さを決めるスクリプト
|
125
|
+
[SerializeField] private UnityStandardAssets.Characters.ThirdPerson.ThirdPersonCharacter anotherScript;
|
126
|
+
|
127
|
+
void Start()
|
128
|
+
{
|
129
|
+
|
130
|
+
|
131
|
+
anotherScript = GetComponent<UnityStandardAssets.Characters.ThirdPerson.ThirdPersonCharacter>();
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
}
|
136
|
+
|
137
|
+
void Update()
|
138
|
+
{
|
139
|
+
if (isCaptured == true)
|
140
|
+
{
|
141
|
+
//捕まっている場合は0
|
142
|
+
SetValue(0);
|
143
|
+
}
|
144
|
+
|
145
|
+
if (isCaptured == false)
|
146
|
+
{
|
147
|
+
SetValue(2);
|
148
|
+
}
|
149
|
+
|
150
|
+
}
|
151
|
+
|
152
|
+
|
153
|
+
public void OnTriggerStay(Collider hit)
|
154
|
+
{
|
155
|
+
// 牢屋に触れた場合
|
156
|
+
|
157
|
+
if (hit.gameObject.tag == "Rouya")
|
158
|
+
{
|
159
|
+
|
160
|
+
Captured();
|
161
|
+
|
162
|
+
}
|
163
|
+
|
164
|
+
|
165
|
+
}
|
166
|
+
|
167
|
+
|
168
|
+
void SetValue(int value)
|
169
|
+
{
|
170
|
+
anotherScript.M_MoveSpeedMultiplier = value;
|
171
|
+
|
172
|
+
//Debug.Log("M_MoveSpeedMultiplie = " + anotherScript.M_MoveSpeedMultiplier);
|
173
|
+
}
|
174
|
+
|
175
|
+
public void Captured()
|
176
|
+
{
|
177
|
+
isCaptured = true;
|
178
|
+
}
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
}
|
185
|
+
|
186
|
+
|
187
|
+
```
|
1
miss
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
unity3D 捕まった
|
1
|
+
unity3D 捕まったプレイヤーの待機場所の実装
|
body
CHANGED
File without changes
|