Answers for "delegate unity"

C#
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
0

delegates in UnityC#

public delegate void myDelegate();
public myDelegate Del;
 void start()
{
 Del = () => { Debug.log(" Hello there"): };
}
void Update()
{
 if(Input.getkeydown(keycode.space))
      Del();
}
Posted by: Guest on August-28-2021

C# Answers by Framework

Browse Popular Code Answers by Language