Advertisement
subere23

FadeObjectNotActive

Sep 16th, 2017
819
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class FadeObjectNotActive : MonoBehaviour {
  6.  
  7. private void OnEnable()
  8. {
  9. NRSRManager.ObjectFocused += FadeObject;
  10. NRSRManager.ObjectUnFocused += UnfadeObject;
  11. }
  12.  
  13. private void OnDisable()
  14. {
  15.  
  16. NRSRManager.ObjectFocused -= FadeObject;
  17. NRSRManager.ObjectUnFocused -= UnfadeObject;
  18. }
  19.  
  20. void FadeObject()
  21. {
  22. if (gameObject.tag == "NRSRTools") { return; }
  23.  
  24. //fade logic here
  25. Debug.Log(gameObject.name+ " should fade");
  26.  
  27. }
  28. void UnfadeObject()
  29. {
  30. if (gameObject.tag == "NRSRTools") { return; }
  31. //unfade logic here
  32. Debug.Log(gameObject.name + "should unfade");
  33.  
  34.  
  35. }
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement