tobl3

gameevents

Jul 6th, 2025
21
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.52 KB | Gaming | 0 0
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5.  
  6. public class GameEvents : MonoBehaviour
  7. {
  8.     public static GameEvents instance;
  9.     private void Awake()
  10.     {
  11.         instance = this;
  12.     }
  13.  
  14.     public event Action<int> OnButtonPressed;
  15.     public void ButtonPressed(int id)
  16.     {
  17.         OnButtonPressed?.Invoke(id);
  18.     }
  19.  
  20.     public event Action<int> OnPlateTrigger;
  21.     public void PlateTrigger(int id)
  22.     {
  23.         OnPlateTrigger?.Invoke(id);
  24.     }
  25. }
  26.  
Advertisement
Add Comment
Please, Sign In to add comment