I get a NullRefernceException even though I subscribed to the event in an Start Methode.
Where I create my Event:
public EventHandler<CustomArgs> ClickEvent; private void OnMouseDown() { Debug.Log("Clicked"); CustomArgs args = new CustomArgs(); args.Name = gebäude.ToString(); args.Level = Level; args.MenuePosition = Menue; ClickEvent?.Invoke(this, args); } Where I subscribe to my Event:
private void Start() { miene.ClickEvent += ClickEvent; Debug.Log("Event Addedet"); } private void ClickEvent(object sender, CustomArgs e) { //some useless stuff }