Advertisement
Pro_Unit

GameEventListenerGameObject

Nov 16th, 2020
1,011
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using UnityEngine;
  2.  
  3. namespace GameCore
  4. {
  5.     using Extentions;
  6.     public class GameEventListenerGameObject : MonoBehaviour
  7.     {
  8.         [SerializeField] GameEventGameObject Event;
  9.  
  10.         [SerializeField] UnityEventGameObject Responce;
  11.  
  12.         public void OnEventRaised(GameObject arg)
  13.         {
  14.             Responce.Invoke(arg);
  15.         }
  16.         public void OnEnable()
  17.         {
  18.             Event.RegisterListener(this);
  19.         }
  20.  
  21.         public void OnDisable()
  22.         {
  23.             Event.UnRegisterListener(this);
  24.         }
  25.     }
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement