Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class iventsistem : MonoBehaviour
- {
- public static iventsistem instance;
- public delegate void action();
- public event action time;
- public event action Win;
- public event action Lose;
- public event action Sound;
- // Start is called before the first frame update
- void Awake()
- {
- //// if event not empty
- if (instance == null)
- {
- instance = this;
- }
- }
- //event time
- public void Ontime()
- {
- // if event not empty
- if (time != null)
- {
- time();
- }
- }
- //event win
- public void OnWin()
- {
- // if event not empty
- if (Win != null)
- {
- Win();
- }
- }
- //event lose
- public void OnLose()
- {
- // if event not empty
- if (Lose != null)
- {
- Lose();
- }
- }
- //event sound
- public void OnSound()
- {
- // if event not empty
- if (Sound != null)
- {
- Sound();
- }
- }
- }
Add Comment
Please, Sign In to add comment