ゲームオーバーシーンの作成








ゲームオーバーフロア
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// ★追加
using UnityEngine.SceneManagement;
public class GameOverFloor : MonoBehaviour
{
// ★追加
private void OnCollisionEnter(Collision other)
{
if (other.gameObject.CompareTag("Player"))
{
SceneManager.LoadScene("GameOver");
}
}
}


【2018版】BallGame(全25回)
他のコースを見る







ゲームオーバーフロア
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
// ★追加
using UnityEngine.SceneManagement;
public class GameOverFloor : MonoBehaviour
{
// ★追加
private void OnCollisionEnter(Collision other)
{
if (other.gameObject.CompareTag("Player"))
{
SceneManager.LoadScene("GameOver");
}
}
}


ゲームオーバーシーンの作成