delegate void Work();
와 같이 매개변수와 리턴 값이 없는 델리게이트는 많이 쓰임.using System
)delegate void Work();
-> Action work;
변수 => 실행문(변수);
void Start()
{
onSend += SendMail;
onSend += SendMoney;
onSend += man => Debug.Log("lambda" + man); //short ver
onSend += (string man) => { Debug.Log("lambda" + man); Debug.Log(" "); }; //long ver
}
public int Health {
get { return health; }
set { health = value; }
}
public bool IsDead {
get { return (health <= 0); }
}
private int health = 0;
public int Health {
get => health;
set => health = value;
}
public bool IsDead => (health <= 0);