質問編集履歴
1
コードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -19,3 +19,91 @@
|
|
19
19
|
|
20
20
|
|
21
21
|
解説お願いします。
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
ーー追記ーー
|
26
|
+
|
27
|
+
現在のコードです。
|
28
|
+
|
29
|
+
```c#
|
30
|
+
|
31
|
+
using System.Collections;
|
32
|
+
|
33
|
+
using System.Collections.Generic;
|
34
|
+
|
35
|
+
using UnityEngine;
|
36
|
+
|
37
|
+
using UnityEngine.UI;
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
public class GameControlScript : MonoBehaviour
|
42
|
+
|
43
|
+
{
|
44
|
+
|
45
|
+
// UI Text指定用
|
46
|
+
|
47
|
+
public Text TextFrame;
|
48
|
+
|
49
|
+
// 表示する変数
|
50
|
+
|
51
|
+
private int frame;
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
// Start is called before the first frame update
|
58
|
+
|
59
|
+
void Start()
|
60
|
+
|
61
|
+
{
|
62
|
+
|
63
|
+
frame = 0;
|
64
|
+
|
65
|
+
StartCoroutine("sleep");
|
66
|
+
|
67
|
+
}
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
//「コルーチン」で呼び出すメソッド
|
72
|
+
|
73
|
+
IEnumerator sleep()
|
74
|
+
|
75
|
+
{
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
Debug.Log("開始");
|
80
|
+
|
81
|
+
yield return new WaitForSeconds(14.9f); //14.9秒待つ
|
82
|
+
|
83
|
+
Debug.Log("14.9秒経ちました");
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
}
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
// Update is called once per frame
|
92
|
+
|
93
|
+
void Update()
|
94
|
+
|
95
|
+
{
|
96
|
+
|
97
|
+
//timeElapsed += timeElapsed.deltaTime;
|
98
|
+
|
99
|
+
TextFrame.text = string.Format("{0:00000} frame", frame);
|
100
|
+
|
101
|
+
frame++;
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
```
|