Skip to content

Instantly share code, notes, and snippets.

@IshidaGames
Created November 30, 2019 09:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IshidaGames/42f246eace53132515f70a55b5dc6582 to your computer and use it in GitHub Desktop.
Save IshidaGames/42f246eace53132515f70a55b5dc6582 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//Scene遷移に必要
using UnityEngine.SceneManagement;
public class SceneMove : MonoBehaviour
{
//Inspector上で遷移先の名前を入れる
public string sceneName;
//Playerタグがついたオブジェクトに衝突するとSceneが遷移する
private void OnCollisionEnter(UnityEngine.Collision collision)
{
if (collision.gameObject.tag == "Player")
{
SceneManager.LoadScene(sceneName);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment