質問編集履歴
3
書式の変更
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,6 +10,8 @@
|
|
10
10
|
|
11
11
|
{
|
12
12
|
|
13
|
+
|
14
|
+
|
13
15
|
'[SerializeField] GameObject CountObj;'
|
14
16
|
|
15
17
|
'public Text Text;'
|
@@ -40,21 +42,177 @@
|
|
40
42
|
|
41
43
|
|
42
44
|
|
45
|
+
|
46
|
+
|
47
|
+
void Start()
|
48
|
+
|
49
|
+
{
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
'enter = false;'
|
54
|
+
|
55
|
+
'Player = GameObject.Find("Player");'
|
56
|
+
|
57
|
+
'py = Player.GetComponent<PlayerMoob>();'
|
58
|
+
|
59
|
+
'count = 1;'
|
60
|
+
|
61
|
+
'CountObj = GameObject.Find("CountObj");'
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
// Update is called once per frame
|
70
|
+
|
71
|
+
void Update()
|
72
|
+
|
73
|
+
{
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
'START();'
|
78
|
+
|
79
|
+
'if (enter == true)'
|
80
|
+
|
81
|
+
'{
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
'totalTime -= Time.deltaTime;'
|
86
|
+
|
87
|
+
'seconds = (int)totalTime;'
|
88
|
+
|
89
|
+
'Text.text = seconds.ToString();'
|
90
|
+
|
91
|
+
'CountObj.SetActive(true);'
|
92
|
+
|
93
|
+
'//マイナス値にならないように'
|
94
|
+
|
95
|
+
'totalTime = Mathf.Max(totalTime, 1);'
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
'if (totalTime == 1)'
|
100
|
+
|
101
|
+
'{
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
'Text.text = "GO!!";'
|
106
|
+
|
107
|
+
'py.setMoob(1);'
|
108
|
+
|
109
|
+
'Invoke("FALSE",0.7f);'
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
}'
|
114
|
+
|
115
|
+
}'
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
'enter = false;'
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
}
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
void START()
|
128
|
+
|
129
|
+
{
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
' if (count == 0)
|
134
|
+
|
135
|
+
'{
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
'enter = true;'
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
}'
|
144
|
+
|
145
|
+
}'
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
void FALSE()
|
150
|
+
|
151
|
+
'{
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
'CountObj.SetActive(false);'
|
156
|
+
|
157
|
+
'totalTime = 4;'
|
158
|
+
|
159
|
+
'START();'
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
}'
|
164
|
+
|
165
|
+
}'
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
上記はカウントダウンに用いるスクリプトです。
|
170
|
+
|
171
|
+
CountObjには適用しています。
|
172
|
+
|
173
|
+
上記の変数の値は0でカウントダウンが始まり、1でカウントダウンの表示をoffにしています。
|
174
|
+
|
175
|
+
1から0に変更などはできています。
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
public class FlipScript : MonoBehaviour
|
180
|
+
|
181
|
+
{
|
182
|
+
|
183
|
+
'[SerializeField] GameObject Scoreboard;'
|
184
|
+
|
185
|
+
'ScoreManager smr;'
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
'[SerializeField] GameObject CountObj;'
|
190
|
+
|
191
|
+
'CountDownScript cds;'
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
'[SerializeField] GameObject Flip;'
|
196
|
+
|
197
|
+
'[SerializeField] GameObject FenderGulub;'
|
198
|
+
|
199
|
+
'[SerializeField] GameObject KyanKyan;'
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
'[SerializeField] GameObject NomalStopLine;'
|
204
|
+
|
205
|
+
'FrontStopLineScript fsls;'
|
206
|
+
|
207
|
+
|
208
|
+
|
43
209
|
// Start is called before the first frame update
|
44
210
|
|
45
211
|
void Start()
|
46
212
|
|
47
213
|
{
|
48
214
|
|
49
|
-
|
215
|
+
|
50
|
-
|
51
|
-
'Player = GameObject.Find("Player");'
|
52
|
-
|
53
|
-
'py = Player.GetComponent<PlayerMoob>();'
|
54
|
-
|
55
|
-
'count = 1;'
|
56
|
-
|
57
|
-
'CountObj = GameObject.Find("CountObj");'
|
58
216
|
|
59
217
|
}
|
60
218
|
|
@@ -66,144 +224,6 @@
|
|
66
224
|
|
67
225
|
{
|
68
226
|
|
69
|
-
'START();'
|
70
|
-
|
71
|
-
'if (enter == true)'
|
72
|
-
|
73
|
-
'{
|
74
|
-
|
75
|
-
'totalTime -= Time.deltaTime;'
|
76
|
-
|
77
|
-
'seconds = (int)totalTime;'
|
78
|
-
|
79
|
-
'Text.text = seconds.ToString();'
|
80
|
-
|
81
|
-
'CountObj.SetActive(true);'
|
82
|
-
|
83
|
-
'//マイナス値にならないように'
|
84
|
-
|
85
|
-
'totalTime = Mathf.Max(totalTime, 1);'
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
'if (totalTime == 1)'
|
90
|
-
|
91
|
-
'{
|
92
|
-
|
93
|
-
'Text.text = "GO!!";'
|
94
|
-
|
95
|
-
'py.setMoob(1);'
|
96
|
-
|
97
|
-
'Invoke("FALSE",0.7f);'
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
}'
|
102
|
-
|
103
|
-
}'
|
104
|
-
|
105
|
-
'enter = false;'
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
}
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
void START()
|
114
|
-
|
115
|
-
{
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
' if (count == 0)
|
120
|
-
|
121
|
-
'{
|
122
|
-
|
123
|
-
'enter = true;'
|
124
|
-
|
125
|
-
}'
|
126
|
-
|
127
|
-
}'
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
void FALSE()
|
132
|
-
|
133
|
-
'{
|
134
|
-
|
135
|
-
'CountObj.SetActive(false);'
|
136
|
-
|
137
|
-
'totalTime = 4;'
|
138
|
-
|
139
|
-
'START();'
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
}'
|
144
|
-
|
145
|
-
}'
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
上記はカウントダウンに用いるスクリプトです。
|
150
|
-
|
151
|
-
CountObjには適用しています。
|
152
|
-
|
153
|
-
上記の変数の値は0でカウントダウンが始まり、1でカウントダウンの表示をoffにしています。
|
154
|
-
|
155
|
-
1から0に変更などはできています。
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
public class FlipScript : MonoBehaviour
|
160
|
-
|
161
|
-
{
|
162
|
-
|
163
|
-
'[SerializeField] GameObject Scoreboard;'
|
164
|
-
|
165
|
-
'ScoreManager smr;'
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
'[SerializeField] GameObject CountObj;'
|
170
|
-
|
171
|
-
'CountDownScript cds;'
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
'[SerializeField] GameObject Flip;'
|
176
|
-
|
177
|
-
'[SerializeField] GameObject FenderGulub;'
|
178
|
-
|
179
|
-
'[SerializeField] GameObject KyanKyan;'
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
'[SerializeField] GameObject NomalStopLine;'
|
184
|
-
|
185
|
-
'FrontStopLineScript fsls;'
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
// Start is called before the first frame update
|
190
|
-
|
191
|
-
void Start()
|
192
|
-
|
193
|
-
{
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
}
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
// Update is called once per frame
|
202
|
-
|
203
|
-
void Update()
|
204
|
-
|
205
|
-
{
|
206
|
-
|
207
227
|
|
208
228
|
|
209
229
|
}
|
@@ -214,6 +234,8 @@
|
|
214
234
|
|
215
235
|
{
|
216
236
|
|
237
|
+
|
238
|
+
|
217
239
|
'smr = Scoreboard.GetComponent<ScoreManager>();'
|
218
240
|
|
219
241
|
'smr.setWaza(2);'
|
@@ -240,10 +262,14 @@
|
|
240
262
|
|
241
263
|
{
|
242
264
|
|
265
|
+
|
266
|
+
|
243
267
|
'fsls = NomalStopLine.GetComponent<FrontStopLineScript>();'
|
244
268
|
|
245
269
|
'fsls.setCom(2);'
|
246
270
|
|
271
|
+
|
272
|
+
|
247
273
|
}
|
248
274
|
|
249
275
|
|
2
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -10,33 +10,179 @@
|
|
10
10
|
|
11
11
|
{
|
12
12
|
|
13
|
+
'[SerializeField] GameObject CountObj;'
|
14
|
+
|
15
|
+
'public Text Text;'
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
'public float totalTime;'
|
20
|
+
|
21
|
+
'int seconds;'
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
'public float timer = 5.0f;'
|
26
|
+
|
27
|
+
'bool enter = false;//Enterキーが押されたときのフラグ'
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
'[SerializeField] GameObject Player;'
|
32
|
+
|
33
|
+
'PlayerMoob py;'
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
'int count;'
|
38
|
+
|
39
|
+
'public void setCount(int a) { count = a; }'
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
// Start is called before the first frame update
|
44
|
+
|
45
|
+
void Start()
|
46
|
+
|
47
|
+
{
|
48
|
+
|
49
|
+
'enter = false;'
|
50
|
+
|
51
|
+
'Player = GameObject.Find("Player");'
|
52
|
+
|
53
|
+
'py = Player.GetComponent<PlayerMoob>();'
|
54
|
+
|
55
|
+
'count = 1;'
|
56
|
+
|
57
|
+
'CountObj = GameObject.Find("CountObj");'
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
// Update is called once per frame
|
64
|
+
|
65
|
+
void Update()
|
66
|
+
|
67
|
+
{
|
68
|
+
|
69
|
+
'START();'
|
70
|
+
|
71
|
+
'if (enter == true)'
|
72
|
+
|
73
|
+
'{
|
74
|
+
|
75
|
+
'totalTime -= Time.deltaTime;'
|
76
|
+
|
77
|
+
'seconds = (int)totalTime;'
|
78
|
+
|
79
|
+
'Text.text = seconds.ToString();'
|
80
|
+
|
81
|
+
'CountObj.SetActive(true);'
|
82
|
+
|
83
|
+
'//マイナス値にならないように'
|
84
|
+
|
85
|
+
'totalTime = Mathf.Max(totalTime, 1);'
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
'if (totalTime == 1)'
|
90
|
+
|
91
|
+
'{
|
92
|
+
|
93
|
+
'Text.text = "GO!!";'
|
94
|
+
|
95
|
+
'py.setMoob(1);'
|
96
|
+
|
97
|
+
'Invoke("FALSE",0.7f);'
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
}'
|
102
|
+
|
103
|
+
}'
|
104
|
+
|
105
|
+
'enter = false;'
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
void START()
|
114
|
+
|
115
|
+
{
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
' if (count == 0)
|
120
|
+
|
121
|
+
'{
|
122
|
+
|
123
|
+
'enter = true;'
|
124
|
+
|
125
|
+
}'
|
126
|
+
|
127
|
+
}'
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
void FALSE()
|
132
|
+
|
133
|
+
'{
|
134
|
+
|
135
|
+
'CountObj.SetActive(false);'
|
136
|
+
|
137
|
+
'totalTime = 4;'
|
138
|
+
|
139
|
+
'START();'
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
}'
|
144
|
+
|
145
|
+
}'
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
上記はカウントダウンに用いるスクリプトです。
|
150
|
+
|
151
|
+
CountObjには適用しています。
|
152
|
+
|
153
|
+
上記の変数の値は0でカウントダウンが始まり、1でカウントダウンの表示をoffにしています。
|
154
|
+
|
155
|
+
1から0に変更などはできています。
|
156
|
+
|
157
|
+
|
158
|
+
|
159
|
+
public class FlipScript : MonoBehaviour
|
160
|
+
|
161
|
+
{
|
162
|
+
|
163
|
+
'[SerializeField] GameObject Scoreboard;'
|
164
|
+
|
165
|
+
'ScoreManager smr;'
|
166
|
+
|
167
|
+
|
168
|
+
|
13
169
|
'[SerializeField] GameObject CountObj;'
|
14
170
|
|
15
|
-
'public Text Text;'
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
'public float totalTime;'
|
20
|
-
|
21
|
-
'
|
171
|
+
'CountDownScript cds;'
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
172
|
+
|
26
|
-
|
27
|
-
|
173
|
+
|
28
|
-
|
29
|
-
|
30
|
-
|
174
|
+
|
31
|
-
'[SerializeField] GameObject
|
175
|
+
'[SerializeField] GameObject Flip;'
|
176
|
+
|
32
|
-
|
177
|
+
'[SerializeField] GameObject FenderGulub;'
|
178
|
+
|
33
|
-
'
|
179
|
+
'[SerializeField] GameObject KyanKyan;'
|
180
|
+
|
181
|
+
|
182
|
+
|
34
|
-
|
183
|
+
'[SerializeField] GameObject NomalStopLine;'
|
35
|
-
|
36
|
-
|
184
|
+
|
37
|
-
'
|
185
|
+
'FrontStopLineScript fsls;'
|
38
|
-
|
39
|
-
'public void setCount(int a) { count = a; }'
|
40
186
|
|
41
187
|
|
42
188
|
|
@@ -46,15 +192,7 @@
|
|
46
192
|
|
47
193
|
{
|
48
194
|
|
49
|
-
|
195
|
+
|
50
|
-
|
51
|
-
'Player = GameObject.Find("Player");'
|
52
|
-
|
53
|
-
'py = Player.GetComponent<PlayerMoob>();'
|
54
|
-
|
55
|
-
'count = 1;'
|
56
|
-
|
57
|
-
'CountObj = GameObject.Find("CountObj");'
|
58
196
|
|
59
197
|
}
|
60
198
|
|
@@ -66,142 +204,6 @@
|
|
66
204
|
|
67
205
|
{
|
68
206
|
|
69
|
-
'START();'
|
70
|
-
|
71
|
-
'if (enter == true)'
|
72
|
-
|
73
|
-
'{
|
74
|
-
|
75
|
-
'totalTime -= Time.deltaTime;'
|
76
|
-
|
77
|
-
'seconds = (int)totalTime;'
|
78
|
-
|
79
|
-
'Text.text = seconds.ToString();'
|
80
|
-
|
81
|
-
'CountObj.SetActive(true);'
|
82
|
-
|
83
|
-
'//マイナス値にならないように'
|
84
|
-
|
85
|
-
'totalTime = Mathf.Max(totalTime, 1);'
|
86
|
-
|
87
|
-
'if (totalTime == 1)'
|
88
|
-
|
89
|
-
'{
|
90
|
-
|
91
|
-
'Text.text = "GO!!";'
|
92
|
-
|
93
|
-
'py.setMoob(1);'
|
94
|
-
|
95
|
-
'Invoke("FALSE",0.7f);'
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
}'
|
100
|
-
|
101
|
-
}'
|
102
|
-
|
103
|
-
'enter = false;'
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
}
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
void START()
|
112
|
-
|
113
|
-
{
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
' if (count == 0)
|
118
|
-
|
119
|
-
'{
|
120
|
-
|
121
|
-
'enter = true;'
|
122
|
-
|
123
|
-
}'
|
124
|
-
|
125
|
-
}'
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
void FALSE()
|
130
|
-
|
131
|
-
'{
|
132
|
-
|
133
|
-
'CountObj.SetActive(false);'
|
134
|
-
|
135
|
-
'totalTime = 4;'
|
136
|
-
|
137
|
-
'START();'
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
}'
|
142
|
-
|
143
|
-
}'
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
上記はカウントダウンに用いるスクリプトです。
|
148
|
-
|
149
|
-
CountObjには適用しています。
|
150
|
-
|
151
|
-
上記の変数の値は0でカウントダウンが始まり、1でカウントダウンの表示をoffにしています。
|
152
|
-
|
153
|
-
1から0に変更などはできています。
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
public class FlipScript : MonoBehaviour
|
158
|
-
|
159
|
-
{
|
160
|
-
|
161
|
-
'[SerializeField] GameObject Scoreboard;'
|
162
|
-
|
163
|
-
'ScoreManager smr;'
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
'[SerializeField] GameObject CountObj;'
|
168
|
-
|
169
|
-
'CountDownScript cds;'
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
'[SerializeField] GameObject Flip;'
|
174
|
-
|
175
|
-
'[SerializeField] GameObject FenderGulub;'
|
176
|
-
|
177
|
-
'[SerializeField] GameObject KyanKyan;'
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
'[SerializeField] GameObject NomalStopLine;'
|
182
|
-
|
183
|
-
'FrontStopLineScript fsls;'
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
// Start is called before the first frame update
|
188
|
-
|
189
|
-
void Start()
|
190
|
-
|
191
|
-
{
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
}
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
// Update is called once per frame
|
200
|
-
|
201
|
-
void Update()
|
202
|
-
|
203
|
-
{
|
204
|
-
|
205
207
|
|
206
208
|
|
207
209
|
}
|
@@ -212,21 +214,21 @@
|
|
212
214
|
|
213
215
|
{
|
214
216
|
|
215
|
-
'smr = Scoreboard.GetComponent<ScoreManager>();'
|
217
|
+
'smr = Scoreboard.GetComponent<ScoreManager>();'
|
216
|
-
|
218
|
+
|
217
|
-
'smr.setWaza(2);'
|
219
|
+
'smr.setWaza(2);'
|
218
|
-
|
220
|
+
|
219
|
-
'cds = CountObj.GetComponent<CountDownScript>();'
|
221
|
+
'cds = CountObj.GetComponent<CountDownScript>();'
|
220
|
-
|
222
|
+
|
221
|
-
'cds.setCount(0);'
|
223
|
+
'cds.setCount(0);'
|
222
|
-
|
224
|
+
|
223
|
-
'flip();'
|
225
|
+
'flip();'
|
224
|
-
|
226
|
+
|
225
|
-
'Flip.SetActive(false);'
|
227
|
+
'Flip.SetActive(false);'
|
226
|
-
|
228
|
+
|
227
|
-
'FenderGulub.SetActive(false);'
|
229
|
+
'FenderGulub.SetActive(false);'
|
228
|
-
|
230
|
+
|
229
|
-
'KyanKyan.SetActive(false);'
|
231
|
+
'KyanKyan.SetActive(false);'
|
230
232
|
|
231
233
|
|
232
234
|
|
@@ -238,9 +240,9 @@
|
|
238
240
|
|
239
241
|
{
|
240
242
|
|
241
|
-
'fsls = NomalStopLine.GetComponent<FrontStopLineScript>();'
|
243
|
+
'fsls = NomalStopLine.GetComponent<FrontStopLineScript>();'
|
242
|
-
|
244
|
+
|
243
|
-
'fsls.setCom(2);'
|
245
|
+
'fsls.setCom(2);'
|
244
246
|
|
245
247
|
}
|
246
248
|
|
1
書式の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,34 +1,42 @@
|
|
1
|
+
現在制作しているゲームでカウントダウンを使用しているのですが、技を選択した後にカウントダウンが始まる様にしていて
|
2
|
+
|
3
|
+
合計四回技を選択する場面があります。
|
4
|
+
|
5
|
+
一回目は普通にカウントダウンが始まるのですが、二回目以降がカウントダウンが始まらないので複数回カウントダウンを
|
6
|
+
|
7
|
+
使えるようにしたいです。
|
8
|
+
|
1
9
|
public class CountDownScript : MonoBehaviour
|
2
10
|
|
3
11
|
{
|
4
12
|
|
5
|
-
[SerializeField] GameObject CountObj;
|
13
|
+
'[SerializeField] GameObject CountObj;'
|
6
|
-
|
14
|
+
|
7
|
-
public Text Text;
|
15
|
+
'public Text Text;'
|
8
|
-
|
9
|
-
|
10
|
-
|
16
|
+
|
17
|
+
|
18
|
+
|
11
|
-
public float totalTime;
|
19
|
+
'public float totalTime;'
|
12
|
-
|
20
|
+
|
13
|
-
int seconds;
|
21
|
+
'int seconds;'
|
14
|
-
|
15
|
-
|
16
|
-
|
22
|
+
|
23
|
+
|
24
|
+
|
17
|
-
public float timer = 5.0f;
|
25
|
+
'public float timer = 5.0f;'
|
18
|
-
|
26
|
+
|
19
|
-
bool enter = false;//Enterキーが押されたときのフラグ
|
27
|
+
'bool enter = false;//Enterキーが押されたときのフラグ'
|
20
|
-
|
21
|
-
|
22
|
-
|
28
|
+
|
29
|
+
|
30
|
+
|
23
|
-
[SerializeField] GameObject Player;
|
31
|
+
'[SerializeField] GameObject Player;'
|
24
|
-
|
32
|
+
|
25
|
-
PlayerMoob py;
|
33
|
+
'PlayerMoob py;'
|
26
|
-
|
27
|
-
|
28
|
-
|
34
|
+
|
35
|
+
|
36
|
+
|
29
|
-
int count;
|
37
|
+
'int count;'
|
30
|
-
|
38
|
+
|
31
|
-
public void setCount(int a) { count = a; }
|
39
|
+
'public void setCount(int a) { count = a; }'
|
32
40
|
|
33
41
|
|
34
42
|
|
@@ -38,15 +46,15 @@
|
|
38
46
|
|
39
47
|
{
|
40
48
|
|
41
|
-
enter = false;
|
49
|
+
'enter = false;'
|
42
|
-
|
50
|
+
|
43
|
-
Player = GameObject.Find("Player");
|
51
|
+
'Player = GameObject.Find("Player");'
|
44
|
-
|
52
|
+
|
45
|
-
py = Player.GetComponent<PlayerMoob>();
|
53
|
+
'py = Player.GetComponent<PlayerMoob>();'
|
46
|
-
|
54
|
+
|
47
|
-
count = 1;
|
55
|
+
'count = 1;'
|
48
|
-
|
56
|
+
|
49
|
-
CountObj = GameObject.Find("CountObj");
|
57
|
+
'CountObj = GameObject.Find("CountObj");'
|
50
58
|
|
51
59
|
}
|
52
60
|
|
@@ -58,41 +66,41 @@
|
|
58
66
|
|
59
67
|
{
|
60
68
|
|
61
|
-
START();
|
69
|
+
'START();'
|
62
|
-
|
70
|
+
|
63
|
-
if (enter == true)
|
71
|
+
'if (enter == true)'
|
64
|
-
|
72
|
+
|
65
|
-
{
|
73
|
+
'{
|
66
|
-
|
74
|
+
|
67
|
-
totalTime -= Time.deltaTime;
|
75
|
+
'totalTime -= Time.deltaTime;'
|
68
|
-
|
76
|
+
|
69
|
-
seconds = (int)totalTime;
|
77
|
+
'seconds = (int)totalTime;'
|
70
|
-
|
78
|
+
|
71
|
-
Text.text = seconds.ToString();
|
79
|
+
'Text.text = seconds.ToString();'
|
72
|
-
|
80
|
+
|
73
|
-
CountObj.SetActive(true);
|
81
|
+
'CountObj.SetActive(true);'
|
74
|
-
|
82
|
+
|
75
|
-
//マイナス値にならないように
|
83
|
+
'//マイナス値にならないように'
|
76
|
-
|
84
|
+
|
77
|
-
totalTime = Mathf.Max(totalTime, 1);
|
85
|
+
'totalTime = Mathf.Max(totalTime, 1);'
|
78
|
-
|
86
|
+
|
79
|
-
if (totalTime == 1)
|
87
|
+
'if (totalTime == 1)'
|
80
|
-
|
88
|
+
|
81
|
-
{
|
89
|
+
'{
|
82
|
-
|
90
|
+
|
83
|
-
Text.text = "GO!!";
|
91
|
+
'Text.text = "GO!!";'
|
84
|
-
|
92
|
+
|
85
|
-
py.setMoob(1);
|
93
|
+
'py.setMoob(1);'
|
86
|
-
|
94
|
+
|
87
|
-
Invoke("FALSE",0.7f);
|
95
|
+
'Invoke("FALSE",0.7f);'
|
88
96
|
|
89
97
|
|
90
98
|
|
91
|
-
}
|
99
|
+
}'
|
92
|
-
|
100
|
+
|
93
|
-
}
|
101
|
+
}'
|
94
|
-
|
102
|
+
|
95
|
-
enter = false;
|
103
|
+
'enter = false;'
|
96
104
|
|
97
105
|
|
98
106
|
|
@@ -106,134 +114,142 @@
|
|
106
114
|
|
107
115
|
|
108
116
|
|
109
|
-
if (count == 0)
|
117
|
+
' if (count == 0)
|
110
|
-
|
118
|
+
|
111
|
-
{
|
119
|
+
'{
|
112
|
-
|
120
|
+
|
113
|
-
enter = true;
|
121
|
+
'enter = true;'
|
114
|
-
|
122
|
+
|
115
|
-
}
|
123
|
+
}'
|
116
|
-
|
124
|
+
|
117
|
-
}
|
125
|
+
}'
|
118
126
|
|
119
127
|
|
120
128
|
|
121
129
|
void FALSE()
|
122
130
|
|
131
|
+
'{
|
132
|
+
|
133
|
+
'CountObj.SetActive(false);'
|
134
|
+
|
135
|
+
'totalTime = 4;'
|
136
|
+
|
137
|
+
'START();'
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
}'
|
142
|
+
|
143
|
+
}'
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
上記はカウントダウンに用いるスクリプトです。
|
148
|
+
|
149
|
+
CountObjには適用しています。
|
150
|
+
|
151
|
+
上記の変数の値は0でカウントダウンが始まり、1でカウントダウンの表示をoffにしています。
|
152
|
+
|
153
|
+
1から0に変更などはできています。
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
public class FlipScript : MonoBehaviour
|
158
|
+
|
123
|
-
|
159
|
+
{
|
160
|
+
|
124
|
-
|
161
|
+
'[SerializeField] GameObject Scoreboard;'
|
162
|
+
|
163
|
+
'ScoreManager smr;'
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
'[SerializeField] GameObject CountObj;'
|
168
|
+
|
125
|
-
|
169
|
+
'CountDownScript cds;'
|
170
|
+
|
171
|
+
|
172
|
+
|
126
|
-
|
173
|
+
'[SerializeField] GameObject Flip;'
|
174
|
+
|
175
|
+
'[SerializeField] GameObject FenderGulub;'
|
176
|
+
|
177
|
+
'[SerializeField] GameObject KyanKyan;'
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
'[SerializeField] GameObject NomalStopLine;'
|
182
|
+
|
183
|
+
'FrontStopLineScript fsls;'
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
// Start is called before the first frame update
|
188
|
+
|
127
|
-
|
189
|
+
void Start()
|
128
|
-
|
190
|
+
|
129
|
-
|
191
|
+
{
|
130
|
-
|
131
|
-
|
132
|
-
|
192
|
+
|
193
|
+
|
194
|
+
|
133
|
-
}
|
195
|
+
}
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
// Update is called once per frame
|
200
|
+
|
201
|
+
void Update()
|
202
|
+
|
203
|
+
{
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
}
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
void FlipButton()
|
212
|
+
|
213
|
+
{
|
214
|
+
|
215
|
+
'smr = Scoreboard.GetComponent<ScoreManager>();'
|
216
|
+
|
217
|
+
'smr.setWaza(2);'
|
218
|
+
|
219
|
+
'cds = CountObj.GetComponent<CountDownScript>();'
|
220
|
+
|
221
|
+
'cds.setCount(0);'
|
222
|
+
|
223
|
+
'flip();'
|
224
|
+
|
225
|
+
'Flip.SetActive(false);'
|
226
|
+
|
227
|
+
'FenderGulub.SetActive(false);'
|
228
|
+
|
229
|
+
'KyanKyan.SetActive(false);'
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
}
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
void flip()
|
238
|
+
|
239
|
+
{
|
240
|
+
|
241
|
+
'fsls = NomalStopLine.GetComponent<FrontStopLineScript>();'
|
242
|
+
|
243
|
+
'fsls.setCom(2);'
|
244
|
+
|
245
|
+
}
|
246
|
+
|
247
|
+
|
134
248
|
|
135
249
|
}
|
136
250
|
|
137
251
|
|
138
252
|
|
139
|
-
現在作成中のゲームで技を四回披露しようと思っているんですけど、一回目は普通にカウントダウンが進むんですが
|
140
|
-
|
141
|
-
二回目以降がうまいこと進まないのでご教授をお願いします。
|
142
|
-
|
143
|
-
public class FlipScript : MonoBehaviour
|
144
|
-
|
145
|
-
{
|
146
|
-
|
147
|
-
[SerializeField] GameObject Scoreboard;
|
148
|
-
|
149
|
-
ScoreManager smr;
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
[SerializeField] GameObject CountObj;
|
154
|
-
|
155
|
-
CountDownScript cds;
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
[SerializeField] GameObject Flip;
|
160
|
-
|
161
|
-
[SerializeField] GameObject FenderGulub;
|
162
|
-
|
163
|
-
[SerializeField] GameObject KyanKyan;
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
[SerializeField] GameObject NomalStopLine;
|
168
|
-
|
169
|
-
FrontStopLineScript fsls;
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
// Start is called before the first frame update
|
174
|
-
|
175
|
-
void Start()
|
176
|
-
|
177
|
-
{
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
}
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
// Update is called once per frame
|
186
|
-
|
187
|
-
void Update()
|
188
|
-
|
189
|
-
{
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
}
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
void FlipButton()
|
198
|
-
|
199
|
-
{
|
200
|
-
|
201
|
-
smr = Scoreboard.GetComponent<ScoreManager>();
|
202
|
-
|
203
|
-
smr.setWaza(2);
|
204
|
-
|
205
|
-
cds = CountObj.GetComponent<CountDownScript>();
|
206
|
-
|
207
|
-
cds.setCount(0);
|
208
|
-
|
209
|
-
flip();
|
210
|
-
|
211
|
-
Flip.SetActive(false);
|
212
|
-
|
213
|
-
FenderGulub.SetActive(false);
|
214
|
-
|
215
|
-
KyanKyan.SetActive(false);
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
}
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
void flip()
|
224
|
-
|
225
|
-
{
|
226
|
-
|
227
|
-
fsls = NomalStopLine.GetComponent<FrontStopLineScript>();
|
228
|
-
|
229
|
-
fsls.setCom(2);
|
230
|
-
|
231
|
-
}
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
}
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
253
|
+
上記のスクリプトはボタンをEnterキーを押して選択する技のスクリプトです。
|
254
|
+
|
255
|
+
setCount(0)がカウントダウンに使う変数の値です。
|