delegates in Unitycsharp

Code Example - delegates in Unitycsharp

                
                        public delegate void myDelegate();
public myDelegate Del;
 void start()
{
 Del = () => { Debug.log(" Hello there"): };
}
void Update()
{
 if(Input.getkeydown(keycode.space))
      Del();
}