質問編集履歴
1
マークダウンを付けました。質問の仕方が悪くてすみませんでした。
test
CHANGED
File without changes
|
test
CHANGED
@@ -8,14 +8,16 @@
|
|
8
8
|
〇秒後に見えなくなったが、再度ボタンを押しても何も反応しない。
|
9
9
|
|
10
10
|
**■該当のソースコード**
|
11
|
+
```C#
|
11
|
-
using System.Collections;
|
12
|
+
using System.Collections;
|
12
|
-
using System.Collections.Generic;
|
13
|
+
using System.Collections.Generic;
|
13
|
-
using UnityEngine.UI;
|
14
|
+
using UnityEngine.UI;
|
14
|
-
using UnityEngine;
|
15
|
+
using UnityEngine;
|
16
|
+
|
15
17
|
|
16
18
|
public class ChangeImage : MonoBehaviour
|
17
|
-
{
|
19
|
+
{
|
18
|
-
|
20
|
+
public GameObject Buttongohan; // GameObject"Button(gohan)"を定義
|
19
21
|
public GameObject Buttonasobu; // GameObject"Button(asobu)"を定義
|
20
22
|
|
21
23
|
GameObject memoryGohan;
|
@@ -69,9 +71,11 @@
|
|
69
71
|
memoryGohan.SetActive(onOff);
|
70
72
|
}
|
71
73
|
}
|
74
|
+
```
|
72
75
|
|
73
76
|
**■自分で調べたことや試したこと**
|
74
77
|
はじめは秒数を数えるため「Time.deltaTime」を使いましたが、update内で完結する方法が分からず、上記にたどり着きました。
|
78
|
+
```C#
|
75
79
|
void Start()
|
76
80
|
{
|
77
81
|
time = 3;
|
@@ -88,6 +92,7 @@
|
|
88
92
|
{
|
89
93
|
uni_eat.SetActive(false);
|
90
94
|
}
|
95
|
+
```
|
91
96
|
|
92
97
|
**■使っているツールのバージョンなど補足情報**
|
93
98
|
Unityのバージョン:Unity 2021.3.2f1
|