csharp initialize event

Code Example - csharp initialize event

                
                        //I absolutely don't remember where i found this, but it works just fine
public event System.Action myEvent = delegate {};
//It seems that an event mainly just takes on the type of a delegate array
void Example()
{
	//Because lack of proof, it's safer to use the method below
	myEvent?.Invoke();
  	//^^Use the null-conditional operator '?' to safely call/invoke the event even if it is null due to having zero subscribers
}