Munchy2007

ScreenFader13

Jun 8th, 2016
5,294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEngine.SceneManagement;
  4. using UnityEngine.EventSystems;
  5.  
  6. public class SceneChangeButton : MonoBehaviour, IPointerClickHandler {
  7.     [SerializeField] Object scene;
  8.  
  9.     #region IPointerClickHandler implementation
  10.  
  11.     public void OnPointerClick (PointerEventData eventData)
  12.     {
  13.         ScreenFader.FadeOut(0, 0, LoadScene);
  14.     }
  15.  
  16.     #endregion
  17.  
  18.     void LoadScene()
  19.     {
  20.         SceneManager.LoadScene(scene.name);
  21.         ScreenFader.FadeIn();
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment