UI①(ステージネームの表示)





ステージネームのフェードアウト
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// ★追加
using UnityEngine.UI;
public class StageName : MonoBehaviour
{
// ★追加
private Text stageNameText;
void Start()
{
// ★追加
// 「Text」コンポーネントにアクセスして取得する。
stageNameText = this.gameObject.GetComponent<Text>();
}
void Update()
{
// ★追加
stageNameText.color = Color.Lerp(stageNameText.color, new Color(1, 1, 1, 0), 0.5f * Time.deltaTime);
}
}


【2019版】Danmaku I(基礎1/全22回)
他のコースを見る




ステージネームのフェードアウト
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// ★追加
using UnityEngine.UI;
public class StageName : MonoBehaviour
{
// ★追加
private Text stageNameText;
void Start()
{
// ★追加
// 「Text」コンポーネントにアクセスして取得する。
stageNameText = this.gameObject.GetComponent<Text>();
}
void Update()
{
// ★追加
stageNameText.color = Color.Lerp(stageNameText.color, new Color(1, 1, 1, 0), 0.5f * Time.deltaTime);
}
}


UI①(ステージネームの表示)