Hi folks,
I have a running .net program, that works on console. Now I want to port it over and I am kinda a newbie in Unity. NullReferenceException: Object reference not set to an instance of an object
Here is the code:
This script is the entry point and is attached to an empty GameObject in the editor:
using UnityEngine;
namespace QuickstartClient
{
public class Test : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
QuickStart.SubscribeQAUpdate();
}
// Update is called once per frame
void Update()
{
}
}
}
and it calls that function in the class QuickStart:
namespace QuickstartClient
{
private static LServer ls;
class QuickStart : MonoBehavior
{
public static void SubscribeQAUpdate()
{
Debug.Log("... Starting Subscription!");
Subscription qa_updates = new Subscription("MERGE");
qa_updates.Fields = new string[7] { "timestamp", "message", };
qa_updates.Items = new string[1] { "QA-Updater" };
qa_updates.addListener(new QA_Listener());
Debug.Log("... " + qa_updates.Fields[0]);
ls.subscribe(qa_updates); \\------>Error
Debug.Log("... Starting Subscription done!");
}
ls.subscribe is from a .dll and the fileds are not empty.
Please, what should I do?
Thanks,Slarti