Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using UnityEngine.SceneManagement;
- using System.Collections;
- public class LoadNewArea : MonoBehaviour {
- public string LeveltoLoad;
- public string exitPoint;
- private PlayerController thePlayer;
- // Use this for initialization
- void Start () {
- thePlayer = FindObjectOfType<PlayerController>();
- }
- // Update is called once per frame
- void Update () {
- }
- void OnTriggerEnter2D(Collider2D other)
- {
- if(other.gameObject.name == "Ashie")
- {
- SceneManager.LoadScene(LeveltoLoad);
- thePlayer.StartPoint = exitPoint;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement