質問するログイン新規登録

質問編集履歴

1

コードの追加

2020/03/21 14:23

投稿

Shion0529
Shion0529

スコア21

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