private void Write (String data, Net.IRequestListener requestListener) { try { File.AppendAllText (tracesFile, data); requestListener.Result (""); } catch (Exception e) { requestListener.Error (e.Message); } }
private void Write (String data, Net.IRequestListener requestListener) { #if UNITY_WEBGL requestListener.Error ("Impossible to use LocalStorage in WebGL version"); #elif UNITY_ANDROID || UNITY_IPHONE || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX try { File.AppendAllText (tracesFile, data); requestListener.Result (""); } catch (Exception e) { requestListener.Error (e.Message); } #endif }
private void Write(String data, Net.IRequestListener requestListener) { #if UNITY_WEBGL requestListener.Error ("Impossible to use LocalStorage in WebGL version"); #elif UNITY_ANDROID || UNITY_IPHONE || UNITY_STANDALONE_OSX || UNITY_STANDALONE_WIN || UNITY_STANDALONE_LINUX try { string tmpData = data.Replace("{\"actor", "${\"actor").Replace("[", "").Replace("]", ""); string[] tmpArray = tmpData.Split('$'); foreach (string action in tmpArray) { if (action != "") { Log.L().AddLogLine("local: " + action); } } File.AppendAllText (tracesFile, data); requestListener.Result (""); } catch (Exception e) { requestListener.Error (e.Message); } #endif }