void Share() { _sb.Length = 0; // Get all visible cell foreach (var monoInfo in _monoInfos) { _sb.AppendFormat("========= {0} ========\n", monoInfo.name); foreach (var componentInfo in monoInfo.componentInfos) { _sb.AppendFormat("\t\t--- {0}\n", componentInfo.name); foreach (var fieldInfo in componentInfo.fieldInfos) { _sb.AppendFormat("\t\t\t\t{0}({1}) - {2}\n", fieldInfo.name, fieldInfo.type, fieldInfo.value); } _sb.AppendLine(); // if not showing base class, break after the first iteration if (!_isShowBaseClass) { break; } } _sb.AppendLine(); _sb.AppendLine(); _sb.AppendLine(); } NativeShare.Share(_sb.ToString()); }
static void ShareAllLogs(string logs) { // Android intent limit size is 1MB (https://stackoverflow.com/questions/39098590) // Thus we save it as a file then share the file instead string fileName = string.Format("{0}_{1}({2})_{3}.log", Application.productName, Application.version, EventBridge.AppVersionCode, DateTime.Now.ToString("MMMM-dd_HH-mm-ss-ff")); string folderPath = Path.Combine(Application.persistentDataPath, "MCK_Logs"); string filePath = Path.Combine(folderPath, fileName); // Make sure the directory is created Directory.CreateDirectory(folderPath); File.WriteAllText(filePath, logs); #if UNITY_EDITOR || UNITY_STANDALONE if (LogConsoleSettings.Instance.useShareLogViaMail) { ShareLogToEmailClient(logs); } #elif UNITY_IOS || UNITY_ANDROID NativeShare.ShareMultiple("", new string[] { filePath }); #endif #if UNITY_EDITOR Debug.LogFormat("Logs are saved at: {0}\n You can quickly open the log folder by <b>Tools > Mobile Console > Open Log Folder </b>", filePath); #endif }
static void ShareFiles(string[] filePaths) { if (filePaths == null || filePaths.Length == 0) { return; } NativeShare.ShareMultiple("", filePaths); }
static void ShareLog(string log) { #if UNITY_EDITOR || UNITY_STANDALONE TextEditor textEditor = new TextEditor(); textEditor.text = log; textEditor.SelectAll(); textEditor.Copy(); Debug.Log("Log has been coppied to Clipboard"); #elif UNITY_IOS || UNITY_ANDROID NativeShare.Share(log); #endif }
void ShareAllFiles(GenericNodeView nodeView) { if (_filePaths == null) { _filePaths = Directory.GetFiles(Application.persistentDataPath, "*", SearchOption.AllDirectories); } if (_filePaths.Length > 0) { NativeShare.ShareMultiple("", _filePaths); } }
void Share() { StringBuilder sb = new StringBuilder(); sb.AppendLine(AppAndDeviceInfo.FullInfos()); sb.AppendLine("------------"); sb.AppendLine(); foreach (var kv in _keyValues) { sb.AppendFormat("{0}: {1}\n", kv.key, kv.value.ToString()); } NativeShare.Share(sb.ToString()); }
void ShareContent() { NativeShare.Share("", _fileInfo.FullName); }
public void Share() { NativeShare.Share(_infoNode.name); }