using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
using SharpConnect;
public class LinkSyncSCR : MonoBehaviour {
public Connector test=new Connector();
void Start () {Debug.Log(test.fnConnectResult());}
void Update () {}
void OnApplicationQuit (){
test.fnDisconnect();
}
}
Dies on the OnApplicationQuit
test.fnDisconnect() need to be called when the application is shutting down, where should I place that code since OnApplicationQuit doensn’t know about test?
Edit:
The OnApplicationQuit thinks test is de-initialized.
Thats the problem
When I have a successful connection open, test is live and it appears to work correctly, but if my connection failed for any reason, test should not be de-initalized although the Disconnect should return from my other code a “Not Connected” message.
Anywho, thats the problem.
I still need somewhere else to place that code.