internal static SkeletonData ReadSkeletonData(string text, AttachmentLoader attachmentLoader, float scale) { StringReader reader = new StringReader(text); SkeletonJson skeletonJson = new SkeletonJson(attachmentLoader); skeletonJson.Scale = scale; SkeletonJson skeletonJson2 = skeletonJson; return(skeletonJson2.ReadSkeletonData(reader)); }
internal static SkeletonData ReadSkeletonData(string text, AttachmentLoader attachmentLoader, float scale) { var input = new StringReader(text); var json = new SkeletonJson(attachmentLoader) { Scale = scale }; return(json.ReadSkeletonData(input)); }
internal static SkeletonData ReadSkeletonData(byte[] bytes, AttachmentLoader attachmentLoader, float scale) { MemoryStream input = new MemoryStream(bytes); SkeletonBinary skeletonBinary = new SkeletonBinary(attachmentLoader); skeletonBinary.Scale = scale; SkeletonBinary skeletonBinary2 = skeletonBinary; return(skeletonBinary2.ReadSkeletonData(input)); }
internal static SkeletonData ReadSkeletonData(byte[] bytes, AttachmentLoader attachmentLoader, float scale) { var input = new MemoryStream(bytes); var binary = new SkeletonBinary(attachmentLoader) { Scale = scale }; return(binary.ReadSkeletonData(input)); }
internal static SkeletonData ReadSkeletonData(byte[] bytes, AttachmentLoader attachmentLoader, float scale) { var input = new MemoryStream(bytes); var binary = new SkeletonBinary(attachmentLoader) { Scale = scale }; //var stopwatch = new System.Diagnostics.Stopwatch(); //stopwatch.Start(); var skeletonData = binary.ReadSkeletonData(input); //stopwatch.Stop(); //System.Console.WriteLine(stopwatch.Elapsed); return(skeletonData); }
internal static SkeletonData ReadSkeletonData(string text, AttachmentLoader attachmentLoader, float scale) { var input = new StringReader(text); var json = new SkeletonJson(attachmentLoader) { Scale = scale }; //var stopwatch = new System.Diagnostics.Stopwatch(); //stopwatch.Start(); var skeletonData = json.ReadSkeletonData(input); //stopwatch.Stop(); //System.Console.WriteLine(stopwatch.Elapsed); return(skeletonData); }
public SkeletonData GetSkeletonData(bool quiet) { if (this.skeletonJSON == null) { if (!quiet) { Debug.LogError("Skeleton JSON file not set for SkeletonData asset: " + base.name, this); } this.Clear(); return(null); } if (this.skeletonData == null) { SkeletonData data; Atlas[] atlasArray = this.GetAtlasArray(); AttachmentLoader attachmentLoader = (atlasArray.Length != 0) ? ((AttachmentLoader) new AtlasAttachmentLoader(atlasArray)) : ((AttachmentLoader) new RegionlessAttachmentLoader()); float scale = this.scale; bool flag = this.skeletonJSON.name.ToLower().Contains(".skel"); try { if (flag) { data = ReadSkeletonData(this.skeletonJSON.bytes, attachmentLoader, scale); } else { data = ReadSkeletonData(this.skeletonJSON.text, attachmentLoader, scale); } } catch (Exception exception) { if (!quiet) { Debug.LogError("Error reading skeleton JSON file for SkeletonData asset: " + base.name + "\n" + exception.Message + "\n" + exception.StackTrace, this); } return(null); } this.InitializeWithData(data); } return(this.skeletonData); }
public SkeletonJson(AttachmentLoader attachmentLoader) { this.attachmentLoader = attachmentLoader; Scale = 1; }
public SkeletonJson(Atlas atlas) { this.attachmentLoader = new AtlasAttachmentLoader(atlas); Scale = 1; }
public SkeletonBin(Atlas atlas) { m_attachmentLoader = new AtlasAttachmentLoader(atlas); }
internal static SkeletonData ReadSkeletonData (string text, AttachmentLoader attachmentLoader, float scale) { var input = new StringReader(text); var json = new SkeletonJson(attachmentLoader) { Scale = scale }; return json.ReadSkeletonData(input); }
internal static SkeletonData ReadSkeletonData (byte[] bytes, AttachmentLoader attachmentLoader, float scale) { var input = new MemoryStream(bytes); var binary = new SkeletonBinary(attachmentLoader) { Scale = scale }; return binary.ReadSkeletonData(input); }
public SkeletonBinary (AttachmentLoader attachmentLoader) { if (attachmentLoader == null) throw new ArgumentNullException("attachmentLoader"); this.attachmentLoader = attachmentLoader; Scale = 1; }
private void btnImport_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtDocumentDirectory.Text)) { return; } if (string.IsNullOrEmpty(txtExcelFileName.Text)) { return; } //branch here for logic on window task type? string dirPath = txtDocumentDirectory.Text; mParentType = (ParentTypeEnum) Enum.Parse(typeof (ParentTypeEnum), comboBoxParentType.Text, true); mStopwatch.Start(); AddMessageToGrid("Import started...", Common.ImporterMessageType.Info, true); AttachmentLoader loader = new AttachmentLoader(dirPath, mExcelFileInfo, mParentType); loader.AddMessage += (message, type, force) => { AddMessageToGrid(message, type, force); }; loader.ProgressChanged += (count) => { lblCount.Text = count; }; loader.ProgressComplete += (message) => { string settingValue = CommonUtils.GetAppSettingValue(CommonUtils.AppSettingKey.UploadedDocumentsPathRoot); string path = Path.Combine(settingValue, "import_ui_messages.csv"); for (int i = 0; i < 10; i++) { if (File.Exists(path)) { path = Path.Combine(settingValue, string.Format("import_ui_messages{0}.csv", i)); } else { break; } } using (StreamWriter sw = new StreamWriter(path)) { WriteToCSV(txtComment.Text, listView, sw); AddMessageToGrid("Finished: ", Common.ImporterMessageType.Info, true); } AddMessageToGrid(message, Common.ImporterMessageType.Info, false); }; loader.Run(); }
public SkeletonJson (AttachmentLoader attachmentLoader) { if (attachmentLoader == null) throw new ArgumentNullException("attachmentLoader cannot be null."); this.attachmentLoader = attachmentLoader; Scale = 1; }
/// <summary>Creates a skeleton loader that loads attachments using an <see cref="AtlasAttachmentLoader"/> with the specified atlas. /// </summary> public SkeletonLoader(params Atlas[] atlasArray) { attachmentLoader = new AtlasAttachmentLoader(atlasArray); }