Pro_Unit

GameEventListeners

Dec 22nd, 2018
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | None | 0 0
  1. using System.Collections.Generic;
  2.  
  3. using UnityEngine;
  4. public class GameEventListeners : MonoBehaviour
  5. {
  6.     [SerializeField] List<EventListenerContainer> containers;
  7.     private void OnEnable ()
  8.     {
  9.         foreach (var container in containers)
  10.             container.Listener.OnEnable ();
  11.     }
  12.  
  13.     private void OnDisable ()
  14.     {
  15.         foreach (var container in containers)
  16.             container.Listener.OnDisable ();
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment