Esempio n. 1
0
        public override bool PEGI()
        {
            bool changed = false;

            changed |= "Edge Strength: ".edit(ref edgeValue).nl();
            changed |= "Also do color".toggle(ref AlsoDoColor).nl();

            if (AlsoDoColor)
            {
                changed |= GlobalBrush.ColorSliders_PEGI().nl();
            }

            if (EditedMesh.submeshCount > 1 && "Apply To Lines between submeshes".Click().nl())
            {
                LinesBetweenSubmeshes();
            }

            if (PEGIdelegates != null)
            {
                foreach (pegi.CallDelegate d in PEGIdelegates.GetInvocationList())
                {
                    changed |= d();
                }
            }

            //if (meshMGMT.target != null && meshMGMT.target.isAtlased())

            "Flexible Edge".toggle("Edge type can be seen in Packaging profile (if any). Only Bevel shader doesn't have a Flexible edge.", 90, ref editingFlexibleEdge);

            return(changed);
        }
Esempio n. 2
0
        public override bool PEGI()
        {
            var col = GlobalBrush.colorLinear.ToGamma();
            var msk = GlobalBrush.mask;

            if ("Paint All".Click().nl())
            {
                foreach (var v in EditedMesh.meshPoints)
                {
                    msk.Transfer(ref v.shadowBake, col);
                }
                EditedMesh.Dirty = true;
            }
            GlobalBrush.ColorSliders_PEGI().nl();

            var mat = InspectedPainter.Material;

            if (mat != null)
            {
                ShadowVolumeTexture shadVT = null;

                foreach (var vt in VolumeTexture.all)
                {
                    if (vt.GetType() == typeof(ShadowVolumeTexture) && vt.materials.Contains(mat))
                    {
                        shadVT = (ShadowVolumeTexture)vt;
                    }
                }

                if (shadVT != null && "Auto Raycast Shadows".Click().nl())
                {
                    foreach (var v in EditedMesh.meshPoints)
                    {
                        var vpos = v.WorldPos + v.GetWorldNormal() * 0.001f;

                        for (int i = 0; i < 3; i++)
                        {
                            var pnt = shadVT.lights.GetLight(i);
                            if (pnt != null)
                            {
                                //Vector3 ray = pnt.transform.position - vpos;
                                v.shadowBake[i] = pnt.transform.position.RaycastGotHit(vpos) ? 0.6f : 0;

                                //Physics.Raycast(new Ray(vpos, ray), ray.magnitude) ? 1 : 0;
                            }
                        }
                    }

                    EditedMesh.Dirty = true;

                    "Raycast Complete".showNotification();
                }
            }
            return(false);
        }