質問編集履歴

1

コードの追加

2020/03/21 14:23

投稿

Shion0529
Shion0529

スコア21

test CHANGED
File without changes
test CHANGED
@@ -1,3 +1,89 @@
1
- わからないことというより。リクエストです。
1
+ ```C#
2
2
 
3
+ using System.Collections;
4
+
5
+ using System.Collections.Generic;
6
+
7
+ using UnityEngine.UI;
8
+
9
+ using UnityEngine;
10
+
11
+
12
+
13
+ public class Logo : MonoBehaviour
14
+
15
+ {
16
+
17
+ public Image QImage;
18
+
19
+
20
+
21
+ public Text QText;
22
+
23
+
24
+
25
+ bool a_flag;
26
+
27
+ float a_color;
28
+
29
+ public float timer = 2.4f;
30
+
31
+ // Start is called before the first frame update
32
+
33
+ void Start()
34
+
35
+ {
36
+
37
+ a_flag = false;
38
+
39
+
40
+
41
+ }
42
+
43
+
44
+
45
+ // Update is called once per frame
46
+
47
+ void Update()
48
+
49
+ {
50
+
51
+ timer -= Time.deltaTime;
52
+
53
+
54
+
55
+ if (!a_flag && timer < 0)//a_flagがfalseで時間経過後なら
56
+
57
+ {
58
+
59
+ //イメージの透明度を変更する
60
+
61
+ QImage.color += new Color(0, 0, 0, Time.deltaTime + 0.2f);
62
+
63
+ QText.color += new Color(0, 0, 0, Time.deltaTime + 0.2f);
64
+
65
+
66
+
67
+ if (QImage.color.a >= 0)
68
+
69
+ {
70
+
71
+ a_flag = true;
72
+
73
+ }
74
+
75
+
76
+
77
+
78
+
79
+ }
80
+
81
+
82
+
83
+ }
84
+
85
+ }
86
+
87
+ ```
88
+
3
- CreateEnptyで作成したまとめようのオブジェクトに、イメージなど選択するのに使う物が入っています。それを指定時間(publicの変数で変更可能)後に透明状態から徐々に出現するコードお願いできまどうも自分るとエラーばかりなっって
89
+ CreateEnptyで作成したまとめようのオブジェクトに、イメージなど選択するのに使う物が入っています。それを指定時間(publicの変数で変更可能)後に透明状態から徐々に出現するようにしたいです。なお、ゆっくりと出したいの、加算するところは0.2ずつ