Skip to content

Instantly share code, notes, and snippets.

@smkplus
Created April 5, 2020 18:38
Show Gist options
  • Select an option

  • Save smkplus/5d72699c6251e06d62d363208b83746a to your computer and use it in GitHub Desktop.

Select an option

Save smkplus/5d72699c6251e06d62d363208b83746a to your computer and use it in GitHub Desktop.
using UnityEngine;
public class Subject : MonoBehaviour
{
//delegate that stores the list of methods
public delegate void Observer();
public static Observer OnNotify;
private void Start()
{
//Invokes the notificaton method
OnNotify.Invoke();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment