Munchy2007

ScreenFader11

Jun 8th, 2016
5,312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 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(callback: () => {
  14.             SceneManager.LoadScene(scene.name);
  15.             ScreenFader.FadeIn(0.5f);
  16.         });
  17.     }
  18.  
  19.     #endregion
  20. }
Advertisement
Add Comment
Please, Sign In to add comment