My dearest friends,
Please I am facing the System.NullReferenceException in Program.cs. It says that "EventManager.NoArgumentInvoker.get returned null" how should I suppose to do? Please, can someone can else fix my exception. Any help will be very very appreciated. Please fix my error.
This is the code of Program.cs:
This is the CountMessageEvent.cs
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using UnityEngine.Events;
- namespace ProgrammingAssignment3
- {
- public class CountMessageEvent : UnityEvent <int>
- {
- }
- }
This is the listener.cs
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
-
-
-
- public class Listener : MonoBehaviour
- {
-
-
-
- public void Start()
- {
-
- Invoker invoker = new Invoker();
- invoker.AddNoArgumentListener(HandleMessageEvent);
- invoker.AddOneArgumentListener(HandleCountMessageEvent);
- }
-
-
-
- void HandleMessageEvent()
- {
- print("MessageEvent");
- }
-
-
-
-
- void HandleCountMessageEvent(int number)
- {
- print("CountMessageEvent: " + number);
- }
- }
This is the Invoker.cs
This is the EventManager.cs
This is the code of MessageEvent.cs
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using UnityEngine.Events;
- namespace ProgrammingAssignment3
- {
- public class MessageEvent : UnityEvent
- {
- }
- }
After implementing that, I faced this exception...
Please fix my error hurry. My work will be dued in Aug 3. Please help and fix my error and I will appreciate for your fix...
I also uploaded the zip file to see my full code...