예제 #1
0
 public static void DecodeFrame(this IAnimated_STD_PEGI obj, string data)
 {
     if (obj != null)
     {
         var cody = new StdDecoder(data);
         foreach (var tag in cody)
         {
             obj.DecodeFrame(tag, cody.GetData());
         }
     }
 }
예제 #2
0
        public List <string> StrokeRecordingsFromFile(string filename)
        {
            string data;

            if (!recordings.TryGetValue(filename, out data))
            {
                data = StuffLoader.LoadFromPersistantPath(vectorsFolderName, filename);
                recordings.Add(filename, data);
            }

            var           cody    = new StdDecoder(data);
            List <string> strokes = new List <string>();

            foreach (var tag in cody)
            {
                var d = cody.GetData();
                switch (tag)
                {
                case "strokes": d.DecodeInto(out strokes); break;
                }
            }

            return(strokes);
        }
예제 #3
0
        public void Init()
        {
            if (brushConfig == null)
            {
                brushConfig = new BrushConfig();
            }

            if ((meshPackagingSolutions == null) || (meshPackagingSolutions.Count == 0))
            {
                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);
            }

            if (atlasFolderName == null || atlasFolderName.Length == 0)
            {
                materialsFolderName = "Materials";
                texturesFolderName  = "Textures";
                vectorsFolderName   = "Vectors";
                meshesFolderName    = "Models";
                atlasFolderName     = "ATLASES";
                recordingNames      = new List <string>();
            }

#if BUILD_WITH_PAINTER || UNITY_EDITOR
            if (pixPerfectCopy == null)
            {
                pixPerfectCopy = Shader.Find("Editor/PixPerfectCopy");
            }

            if (Blit_Smoothed == null)
            {
                Blit_Smoothed = Shader.Find("Editor/BufferBlit_Smooth");
            }

            if (brushRendy_bufferCopy == null)
            {
                brushRendy_bufferCopy = Shader.Find("Editor/BufferCopier");
            }

            if (br_Blit == null)
            {
                br_Blit = Shader.Find("Editor/br_Blit");
            }

            if (br_Add == null)
            {
                br_Add = Shader.Find("Editor/br_Add");
            }

            if (br_Copy == null)
            {
                br_Copy = Shader.Find("Editor/br_Copy");
            }

            if (br_Multishade == null)
            {
                br_Multishade = Shader.Find("Editor/br_Multishade");
            }

            if (br_BlurN_SmudgeBrush == null)
            {
                br_BlurN_SmudgeBrush = Shader.Find("Editor/BlurN_SmudgeBrush");
            }

            if (br_ColorFill == null)
            {
                br_ColorFill = Shader.Find("Editor/br_ColorFill");
            }

            if (br_Preview == null)
            {
                br_Preview = Shader.Find("Editor/br_Preview");
            }

            if (mesh_Preview == null)
            {
                mesh_Preview = Shader.Find("Editor/MeshEditorAssist");
            }

            TerrainPreview = Shader.Find("Editor/TerrainPreview");
#endif

            var encody = new StdDecoder(meshToolsSTD);
            foreach (var tag in encody)
            {
                var d = encody.GetData();
                foreach (var m in MeshToolBase.AllTools)
                {
                    if (m.ToString().SameAs(tag))
                    {
                        m.Decode(d);
                        break;
                    }
                }
            }
        }