예제 #1
0
        public override CfgEncoder Encode()
        {
            var cody = new CfgEncoder()
                       .Add_String("n", meshName)
                       .Add_IfNotEmpty("vrt", meshPoints)
                       .Add_IfNotEmpty("tri", triangles)
                       .Add("sub", subMeshCount)
                       .Add_IfTrue("wei", gotBoneWeights)
                       .Add("bv", baseVertex)
                       .Add("biP", bindPoses);

            if (uv2DistributeRow > 0)
            {
                cody.Add("UV2dR", uv2DistributeRow);
                cody.Add("UV2cur", uv2DistributeCurrent);
            }
            if (selectedUv != null)
            {
                cody.Add("sctdUV", meshPoints.IndexOf(selectedUv.meshPoint));
            }
            if (selectedTriangle != null)
            {
                cody.Add("sctdTris", triangles.IndexOf(selectedTriangle));
            }

            if (!MeshToolBase.AllTools.IsNullOrEmpty())
            {
                foreach (var t in MeshToolBase.allToolsWithPerMeshData)
                {
                    cody.Add((t as MeshToolBase).StdTag, t.EncodePerMeshData());
                }
            }


            return(cody);
        }
        public CfgEncoder Encode()
        {
            targetSize.z = Mathf.Max(targetSize.z, 1);

            var cody = new CfgEncoder()//this.EncodeUnrecognized()
                       .Add("sc", targetSize)
                       .Add("pos", targetLocalPosition)
                       .Add("tCol", targetTextColor);

            if (targetColor != Color.grey)
            {
                cody.Add("col", targetColor);
            }

            return(cody);
        }
예제 #3
0
        public void ManagedOnDisable()
        {
            var cody = new CfgEncoder();

            var at = MeshToolBase.AllTools;

            if (!at.IsNullOrEmpty())
            {
                foreach (var t in at)
                {
                    cody.Add(t.StdTag, t.Encode());
                }

                meshToolsStd = cody.ToString();
            }

            stdData = Encode().ToString();

            systemLanguage = LazyLocalization._systemLanguage;
        }
예제 #4
0
        // Encode and Decode class lets you store configuration of this class in a string

        public CfgEncoder Encode()
        {
            var cody = new CfgEncoder()
                       .Add_Bool("s", stopTime)
                       .Add("thl", _thickness)
                       .Add("spd", _simulationSpeed)
                       .Add("ns", _noise.targetValue)
                       .Add("sh", shadowStrength.targetValue)
                       .Add("scol", shadowColor.targetValue)
                       .Add("sdst", shadowDistance)
                       .Add("us", upscale)
                       .Add("sc", skyColor.targetValue)
                       .Add_Bool("fg", RenderSettings.fog);

            if (RenderSettings.fog)
            {
                cody.Add("fogCol", fogColor.targetValue)
                .Add("fogD", fogDistance)
                .Add("fogDen", fogDensity);
            }

            return(cody);
        }
예제 #5
0
        public override CfgEncoder Encode()
        {
            var cody = new CfgEncoder()

                       .Add_IfTrue("f0", dominantCorner[0])
                       .Add_IfTrue("f1", dominantCorner[1])
                       .Add_IfTrue("f2", dominantCorner[2])

                       .Add_IfNotEpsilon("ew0", edgeWeight[0])
                       .Add_IfNotEpsilon("ew1", edgeWeight[1])
                       .Add_IfNotEpsilon("ew2", edgeWeight[2]);

            for (var i = 0; i < 3; i++)
            {
                cody.Add(i.ToString(), vertexes[i].finalIndex);
            }

            cody.Add_IfNotZero("tex", textureNo)

            .Add_IfNotZero("sub", subMeshIndex);


            return(cody);
        }
예제 #6
0
        public CfgEncoder EncodeStrokeFor(PlaytimePainter painter)
        {
            var id = painter.TexMeta;

            var rt = id.TargetIsRenderTexture();

            var mode = GetBlitMode(!rt);
            var type = GetBrushType(!rt);

            var worldSpace = rt && painter.Is3DBrush();

            var cody = new CfgEncoder()

                       .Add(rt ? "typeGPU" : "typeCPU", _brushType(!rt));

            if (worldSpace)
            {
                cody.Add("size3D", brush3DRadius);
            }
            else
            {
                cody.Add("size2D", brush2DRadius / id.width);
            }


            cody.Add_Bool("useMask", useMask)
            .Add("modeCPU", _inCpuBlitMode)
            .Add("modeGPU", _inGpuBlitMode);



            if (useMask)
            {
                cody.Add("mask", (int)mask);
            }

            cody.Add("bc", Color);

            if (mode.UsingSourceTexture)
            {
                cody.Add_IfNotZero("source", selectedSourceTexture);
            }

            if (rt)
            {
                if ((mode.GetType() == typeof(BlitModes.Blur)))
                {
                    cody.Add("blur", blurAmount);
                }

                if (type.IsUsingDecals)
                {
                    cody.Add("decA", decalAngle)
                    .Add("decNo", selectedDecal);
                }

                if (useMask)
                {
                    cody.Add("Smask", selectedSourceMask)
                    .Add("maskTil", maskTiling)
                    .Add_Bool("maskFlip", flipMaskAlpha)
                    .Add("maskOff", maskOffset);
                }
            }

            cody.Add("hard", hardness)
            .Add("dSpeed", _dFlow);
            //.Add("Speed", speed);

            return(cody);
        }