Last active
September 27, 2016 07:55
-
-
Save kazumalab/06b054f0d02c051920f02448f2f82dce to your computer and use it in GitHub Desktop.
This file contains 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
public class DelegateTest : MonoBehaviour { | |
public delegate void Callback (); | |
private Callback callback; | |
public void SetCallback (Callback _callback) { | |
this.callback = _callback; | |
} | |
public void AddCallback (Callback _callback) { | |
this.callback += _callback; | |
} | |
public void ClickButton () { | |
this.callback (); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment