Advertisement
Pro_Unit

GameEventListener

Dec 22nd, 2018
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using UnityEngine;
  2. public class GameEventListener : MonoBehaviour
  3. {
  4.     [SerializeField] EventListener listener;
  5.  
  6.     private void OnEnable ()
  7.     {
  8.         if (!listener.OnEnable ())
  9.         {
  10.             Debug.LogError ("Event not set On listener", this);
  11.         }
  12.     }
  13.  
  14.     private void OnDisable ()
  15.     {
  16.         if (!listener.OnDisable ())
  17.         {
  18.             Debug.LogError ("Event not set On listener", this);
  19.         }
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement