質問編集履歴
3
文法の改善
test
CHANGED
File without changes
|
test
CHANGED
@@ -24,13 +24,13 @@
|
|
24
24
|
|
25
25
|
GetComponent<Renderer>().material.color -= new Color(0,0,0,0.01f);
|
26
26
|
|
27
|
-
|
27
|
+
|
28
28
|
|
29
29
|
|
30
30
|
|
31
31
|
}
|
32
32
|
|
33
|
-
|
33
|
+
yield return new WaitForSeconds(0.05f);
|
34
34
|
|
35
35
|
}
|
36
36
|
|
2
情報の付け足し
test
CHANGED
File without changes
|
test
CHANGED
@@ -2,29 +2,41 @@
|
|
2
2
|
|
3
3
|
```C#
|
4
4
|
|
5
|
-
i
|
5
|
+
private IEnumerator teki_fadeout()
|
6
6
|
|
7
7
|
{
|
8
8
|
|
9
|
-
|
9
|
+
for (float a = 1; a == 0; a-=0.01f)
|
10
10
|
|
11
|
-
|
11
|
+
{
|
12
12
|
|
13
|
-
el
|
13
|
+
if( gameObject.GetComponent<Renderer>().material.color == null)
|
14
14
|
|
15
|
-
{
|
15
|
+
{
|
16
16
|
|
17
|
-
|
17
|
+
//colorがなかった場合の処理
|
18
18
|
|
19
|
-
|
19
|
+
}
|
20
20
|
|
21
|
-
|
21
|
+
else
|
22
22
|
|
23
|
-
|
23
|
+
{
|
24
24
|
|
25
|
-
|
25
|
+
GetComponent<Renderer>().material.color -= new Color(0,0,0,0.01f);
|
26
26
|
|
27
|
+
yield return new WaitForSeconds(0.05f);
|
28
|
+
|
29
|
+
|
30
|
+
|
27
|
-
}
|
31
|
+
}
|
32
|
+
|
33
|
+
|
34
|
+
|
35
|
+
}
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
Destroy(gameObject);
|
28
40
|
|
29
41
|
}
|
30
42
|
|
1
fadeoutする部分追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,7 +14,17 @@
|
|
14
14
|
|
15
15
|
{
|
16
16
|
|
17
|
-
|
17
|
+
for (float a = 1; a == 0; a-=0.01f)
|
18
|
+
|
19
|
+
{
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
GetComponent<Renderer>().material.color -= new Color(0,0,0,0.01f);
|
24
|
+
|
25
|
+
yield return new WaitForSeconds(0.05f);
|
26
|
+
|
27
|
+
}
|
18
28
|
|
19
29
|
}
|
20
30
|
|