Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class FadeObjectNotActive : MonoBehaviour {
- private void OnEnable()
- {
- NRSRManager.ObjectFocused += FadeObject;
- NRSRManager.ObjectUnFocused += UnfadeObject;
- }
- private void OnDisable()
- {
- NRSRManager.ObjectFocused -= FadeObject;
- NRSRManager.ObjectUnFocused -= UnfadeObject;
- }
- void FadeObject()
- {
- if (gameObject.tag == "NRSRTools") { return; }
- //fade logic here
- Debug.Log(gameObject.name+ " should fade");
- }
- void UnfadeObject()
- {
- if (gameObject.tag == "NRSRTools") { return; }
- //unfade logic here
- Debug.Log(gameObject.name + "should unfade");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement