private void Init() { if (brushConfig == null) { brushConfig = new BrushConfig(); } if (meshPackagingSolutions.IsNullOrEmpty()) { Debug.Log("Recreating mash packaging solutions"); meshPackagingSolutions = new List <MeshPackagingProfile> { (new MeshPackagingProfile()).LoadFromResources(MeshPackagingProfile.FolderName, "Simple"), (new MeshPackagingProfile()).LoadFromResources(MeshPackagingProfile.FolderName, "Bevel"), (new MeshPackagingProfile()).LoadFromResources(MeshPackagingProfile.FolderName, "AtlasedProjected"), (new MeshPackagingProfile()).LoadFromResources(MeshPackagingProfile.FolderName, "Standard_Atlased") }; } if (samplingMaskSize.x == 0) { samplingMaskSize = new MyIntVec2(4); } CheckShaders(); var decoder = new CfgDecoder(meshToolsStd); foreach (var tag in decoder) { var d = decoder.GetData(); foreach (var m in MeshToolBase.AllTools) { if (m.StdTag.SameAs(tag)) { m.Decode(d); break; } } } if (systemLanguage != -1) { LazyTranslations._systemLanguage = systemLanguage; } }
public void ManagedOnEnable() { Decode(stdData); //this.LoadCfgData(); //Decode(stdData); if (Brush == null) { Brush = new Brush(); } if (meshPackagingSolutions.IsNullOrEmpty()) { ResetMeshPackagingProfiles(); } if (samplingMaskSize.x == 0) { samplingMaskSize = new MyIntVec2(4); } CheckShaders(); var decoder = new CfgDecoder(meshToolsStd); foreach (var tag in decoder) { var d = decoder.GetData(); for (int i = 0; i < MeshToolBase.AllTools.Count; i++) { var m = MeshToolBase.AllTools[i]; if (m.StdTag.SameAs(tag)) { d.DecodeFull(ref m); break; } } } if (systemLanguage != -1) { LazyLocalization._systemLanguage = systemLanguage; } }
public void ManagedOnEnable() { Decode(stdData); if (brushConfig == null) { brushConfig = new BrushConfig(); } if (meshPackagingSolutions.IsNullOrEmpty()) { ResetMeshPackagingProfiles(); } if (samplingMaskSize.x == 0) { samplingMaskSize = new MyIntVec2(4); } CheckShaders(); var decoder = new CfgDecoder(meshToolsStd); foreach (var tag in decoder) { var d = decoder.GetData(); foreach (var m in MeshToolBase.AllTools) { if (m.StdTag.SameAs(tag)) { m.Decode(d); break; } } } if (systemLanguage != -1) { LazyTranslations._systemLanguage = systemLanguage; } }
public IEnumerable <string> StrokeRecordingsFromFile(string filename) { string data; if (!Recordings.TryGetValue(filename, out data)) { data = QcFile.Load.FromPersistentPath(vectorsFolderName, filename); Recordings.Add(filename, data); } var cody = new CfgDecoder(data); var strokes = new List <string>(); foreach (var t in cody) { var d = cody.GetData(); switch (t) { case "strokes": d.ToList(out strokes); break; } } return(strokes); }
public override void ManagedUpdate() { var l = playbackMetas; if (playbackMetas.Count > 0 && !Stroke.pausePlayback) { if (playbackMetas.TryGetLast() == null) { playbackMetas.RemoveLast(1); } else { var last = playbackMetas.TryGetLast().GetModule <ImageMetaPaintingRecording>(); if (last != null) { if (cody.GotData) { DecodeStroke(cody.GetNextTag(), cody.GetData()); } else { if (playbackVectors.Count > 0) { cody = new CfgDecoder(playbackVectors[0]); playbackVectors.RemoveAt(0); } else { playbackMetas.Remove(parentMeta); } } } } } }