using UnityEngine;
using System.Collections;
public class Test : MonoBehaviour
{
public delegate void A();
public delegate void B(int i);
public delegate void C(int i, float f);
void Start ()
{
A a = AA;
a();
B b = BB;
b(2);
C c = CC;
c(2, 2.0f);
A a1 = delegate()
{
Debug.Log("a1");
};
a1();
B b1 = delegate(int i)
{
Debug.Log("b1 = " + i);
};
b1(2);
C c1 = delegate(int i, float f)
{
Debug.Log("c1 = " + i + ", " + f);
};
c1(2, 2.0f);
A a2 = () =>
{
Debug.Log("a2");
};
a2();
B b2 = (int i) =>
{
Debug.Log("b2 = " + i);
};
b2(2);
C c2 = (int i, float f) =>
{
Debug.Log("c2 = " + i + ", " + f);
};
c2(2, 2.0f);
}
private void AA()
{
Debug.Log("AA");
}
private void BB(int i)
{
Debug.Log("BB = " + i);
}
private void CC(int i, float f)
{
Debug.Log("CC = " + i + ", " + f);
}
}