質問編集履歴
1
現在アタッチしているスクリプトを記述
test
CHANGED
File without changes
|
test
CHANGED
@@ -18,6 +18,184 @@
|
|
18
18
|
|
19
19
|
|
20
20
|
|
21
|
+
### 追記
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
現在イベントを発生させるため空オブジェクトにアタッチしているスクリプトになります。
|
26
|
+
|
27
|
+
```C#
|
28
|
+
|
29
|
+
using System.Collections;
|
30
|
+
|
31
|
+
using System.Collections.Generic;
|
32
|
+
|
33
|
+
using UnityEngine;
|
34
|
+
|
35
|
+
using UnityEngine.UI;
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
public class Turorial : MonoBehaviour
|
40
|
+
|
41
|
+
{
|
42
|
+
|
43
|
+
List<string> Texts = new List<string>
|
44
|
+
|
45
|
+
{ "セリフ1", "セリフ2", "セリフ3",
|
46
|
+
|
47
|
+
"セリフ4","セリフ5" };
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
[SerializeField] private Text test;
|
52
|
+
|
53
|
+
[SerializeField] private Pausable pausable;
|
54
|
+
|
55
|
+
[SerializeField] private GameObject Serif_Player;
|
56
|
+
|
57
|
+
[SerializeField] private GameObject Serif_Sistem;
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
[SerializeField] private Player player;
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
void Start()
|
66
|
+
|
67
|
+
{
|
68
|
+
|
69
|
+
StartCoroutine(Walk());
|
70
|
+
|
71
|
+
}
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
void Update()
|
76
|
+
|
77
|
+
{
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
private IEnumerator Walk()
|
86
|
+
|
87
|
+
{
|
88
|
+
|
89
|
+
yield return new WaitForSeconds(2f);
|
90
|
+
|
91
|
+
//プレイヤーの動きなどを止める
|
92
|
+
|
93
|
+
pausable.pausing = true;
|
94
|
+
|
95
|
+
//メッセージウィンドウを表示
|
96
|
+
|
97
|
+
Serif_Player.SetActive(true);
|
98
|
+
|
99
|
+
Serif_Sistem.SetActive(false);
|
100
|
+
|
101
|
+
for (int i = 0; i <= 2; i++)
|
102
|
+
|
103
|
+
{
|
104
|
+
|
105
|
+
if(i == 2)
|
106
|
+
|
107
|
+
{
|
108
|
+
|
109
|
+
Serif_Player.SetActive(false);
|
110
|
+
|
111
|
+
Serif_Sistem.SetActive(true);
|
112
|
+
|
113
|
+
pausable.pausing = false;
|
114
|
+
|
115
|
+
}
|
116
|
+
|
117
|
+
test.text = Texts[i];
|
118
|
+
|
119
|
+
//タッチでメッセージを送る
|
120
|
+
|
121
|
+
yield return new WaitUntil(Touch);
|
122
|
+
|
123
|
+
yield return new WaitWhile(Touch);
|
124
|
+
|
125
|
+
}
|
126
|
+
|
127
|
+
yield return new WaitForSeconds(1f);
|
128
|
+
|
129
|
+
Serif_Sistem.SetActive(false);
|
130
|
+
|
131
|
+
test.text = "";
|
132
|
+
|
133
|
+
yield break;
|
134
|
+
|
135
|
+
}
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
private IEnumerator Key()
|
140
|
+
|
141
|
+
{
|
142
|
+
|
143
|
+
player.DashAnim_Stop();
|
144
|
+
|
145
|
+
pausable.pausing = true;
|
146
|
+
|
147
|
+
Serif_Player.SetActive(true);
|
148
|
+
|
149
|
+
for (int i = 3; i <= 4; i++)
|
150
|
+
|
151
|
+
{
|
152
|
+
|
153
|
+
test.text = Texts[i];
|
154
|
+
|
155
|
+
yield return new WaitUntil(Touch);
|
156
|
+
|
157
|
+
yield return new WaitWhile(Touch);
|
158
|
+
|
159
|
+
}
|
160
|
+
|
161
|
+
Serif_Player.SetActive(false);
|
162
|
+
|
163
|
+
test.text = "";
|
164
|
+
|
165
|
+
pausable.pausing = false;
|
166
|
+
|
167
|
+
yield break;
|
168
|
+
|
169
|
+
}
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
void OnTriggerEnter2D(Collider2D col)
|
174
|
+
|
175
|
+
{
|
176
|
+
|
177
|
+
StartCoroutine(Key());
|
178
|
+
|
179
|
+
}
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
bool Touch()
|
184
|
+
|
185
|
+
{
|
186
|
+
|
187
|
+
return Input.anyKeyDown;
|
188
|
+
|
189
|
+
}
|
190
|
+
|
191
|
+
}
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
```
|
196
|
+
|
197
|
+
|
198
|
+
|
21
199
|
### 補足情報(FW/ツールのバージョンなど)
|
22
200
|
|
23
201
|
|