Skip to content

Instantly share code, notes, and snippets.

@kazumalab
Created September 27, 2016 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kazumalab/2e5be97c4c6b5b7ee942cd0a23438d0d to your computer and use it in GitHub Desktop.
Save kazumalab/2e5be97c4c6b5b7ee942cd0a23438d0d to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class ButtonManagement : MonoBehaviour {
public DelegateTest delegateTest;
public void ClickAttack () {
delegateTest.SetCallback (Attack);
}
public void ClickDefence () {
delegateTest.SetCallback (Defence);
}
public void ClickDamage () {
delegateTest.SetCallback (Damage);
}
private void Attack () {
print ("Attack");
}
private void Defence () {
print ("Defence");
}
private void Damage () {
print ("Damege");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment