Created
April 5, 2020 18:38
-
-
Save smkplus/5d72699c6251e06d62d363208b83746a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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