public void Init() { if (File.Exists(Application.persistentDataPath + "/LivesLivesLog.txt")) { Application.logMessageReceived += LogCallback; using (StreamReader sr = new StreamReader(Application.persistentDataPath + "/LivesLivesLog.txt")) { string tmpIp = sr.ReadLine(); tmpIp = tmpIp.Trim(); NetWork.GetSingleton().Connect(tmpIp, 12312); } } else { Debug.LogError(Application.persistentDataPath + "/LivesLivesLog.txt Not Exist"); } }
void OnDestroy() { NetWork.GetSingleton().DisConnect(); }
private static void LogCallback(string condition, string stackTrace, LogType type) { NetWork.GetSingleton().Send(type + System.Environment.NewLine + condition + System.Environment.NewLine + stackTrace); }