今まで背景と出しているロゴが一緒だったので、同時(一つのイメージです)に透明にしていましたが。今回、黒いイメージの背景とロゴのイメージ別々にして、黒の背景が先に透明になり、その後数秒後にロゴも透明にする。ということにしたいです。 (それぞれ、透明にした後にDestoryしています。)リスト
C#
1コード 2 3 4using UnityEngine; 5using System.Collections; 6using UnityEngine.UI; 7 8public class DeleteScript : MonoBehaviour 9{ 10 11public Image Fimage;//FirstImage,SecondImage 12public Image Simage;//FImageが消えた1~2秒後に後に消す 13 14public GameObject ATOKARADASU; 15public GameObject KESUF; 16public GameObject KESUS; 17bool a_flag; 18float a_color; 19public float timer = 1.2f; 20// Use this for initialization 21void Start() 22{ 23a_flag = false; 24 25ATOKARADASU.SetActive(false); 26 27} 28 29// Update is called once per frame 30void Update() 31{ 32timer -= Time.deltaTime; 33if (!a_flag && timer < 0)//a_flagがfalseで時間経過後なら 34{ 35//イメージの透明度を変更する 36Fimage.color -= new Color(0, 0, 0, Time.deltaTime); 37 38ATOKARADASU.SetActive(true); 39 40//透明度が0になったらa_flagをtrueにする。 41if (Fimage.color.a <= 0) 42{ 43a_flag = true; 44Destroy(KESUF); 45 46//Fが消えたら、Sも透明にしていく 47Simage.color -= new Color(0, 0, 0, Time.deltaTime); 48} 49 50if (Simage.color.a <= 0) 51{ 52//透明になったら消す 53Destroy(KESUS); 54} 55} 56} 57} 58```### ヘディングのテキスト
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/03/21 11:02