複数ステージ①(新シーン作成)













ステージ名の変更
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
// ★追加
using UnityEngine.SceneManagement;
public class StageNumber : MonoBehaviour
{
private Text stageNumberText;
void Start()
{
stageNumberText = this.gameObject.GetComponent<Text>();
// ★追加
// 現在のシーンの名前を取得してtextプロパティにセットする(ポイント)
stageNumberText.text = SceneManager.GetActiveScene().name;
}
void Update()
{
stageNumberText.color = Color.Lerp(stageNumberText.color, new Color(1, 1, 1, 0), 0.5f * Time.deltaTime);
}
}

Danmaku Ⅱ(基礎2/全24回)
他のコースを見る












ステージ名の変更
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
// ★追加
using UnityEngine.SceneManagement;
public class StageNumber : MonoBehaviour
{
private Text stageNumberText;
void Start()
{
stageNumberText = this.gameObject.GetComponent<Text>();
// ★追加
// 現在のシーンの名前を取得してtextプロパティにセットする(ポイント)
stageNumberText.text = SceneManager.GetActiveScene().name;
}
void Update()
{
stageNumberText.color = Color.Lerp(stageNumberText.color, new Color(1, 1, 1, 0), 0.5f * Time.deltaTime);
}
}

複数ステージ①(新シーン作成)