Answers for "unity delegate"

2

delegate unity

//declare
public delegate void Function();
public Function OnEvent;
//use
void DoSomethingOnEvent()
{
	//do something
}
OnEvent += DoSomethingOnEvent;
Posted by: Guest on July-19-2021
1

unity delegate

Button.onClick.AddListener(delegate { Function(variable); });
Posted by: Guest on May-07-2021

Browse Popular Code Answers by Language