Advertisement
Guest User

LoadNewArea

a guest
Jun 28th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. using UnityEngine;
  2. using UnityEngine.SceneManagement;
  3. using System.Collections;
  4.  
  5. public class LoadNewArea : MonoBehaviour {
  6. public string LeveltoLoad;
  7. public string exitPoint;
  8. private PlayerController thePlayer;
  9. // Use this for initialization
  10. void Start () {
  11. thePlayer = FindObjectOfType<PlayerController>();
  12. }
  13.  
  14. // Update is called once per frame
  15. void Update () {
  16.  
  17. }
  18. void OnTriggerEnter2D(Collider2D other)
  19. {
  20. if(other.gameObject.name == "Ashie")
  21. {
  22. SceneManager.LoadScene(LeveltoLoad);
  23. thePlayer.StartPoint = exitPoint;
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement