複数ステージ⑥(スコアデータのリセット)



スコアデータのリセット
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Restart : MonoBehaviour
{
public void OnRestartButtonClicked()
{
SceneManager.LoadScene("Stage1");
// ★追加
// スコアを0に戻す。
// 他スクリプトの中にある「静的変数」の操作方法(ポイント)
ScoreManager.score = 0;
}
}

【2019版】Danmaku Ⅱ(基礎2/全38回)
他のコースを見る


スコアデータのリセット
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Restart : MonoBehaviour
{
public void OnRestartButtonClicked()
{
SceneManager.LoadScene("Stage1");
// ★追加
// スコアを0に戻す。
// 他スクリプトの中にある「静的変数」の操作方法(ポイント)
ScoreManager.score = 0;
}
}

複数ステージ⑥(スコアデータのリセット)