コード例 #1
0
 protected void recordStyle()
 {
     if (g)
     {
         style = g.getStyle().Clone();
     }
 }
コード例 #2
0
 public UShape(UGraphics g)
 {
     this.g      = g;
     style       = new UGraphics.UStyle(g);
     vertexType  = VertexType.NONE;
     shapeKind   = ShapeKind.NONE;
     isClockwise = !g.isP5;
 }
コード例 #3
0
        public void draw(Matrix4x4 matrix, Color col, Texture tex, int layer, Camera camera) // for Update
        {
            Material material = findMaterial();

            materialPB.Clear();
            materialPB.SetColor("_Color", col);
            if (isFillShape && tex != null)
            {
                materialPB.SetTexture("_MainTex", tex);
            }

            UGraphics.UStyle nstyle = nowStyle;
            for (int i = 0; i < mesh.subMeshCount; i++)
            {
                if (i == wireframeSubmeshIndex)
                {
                    if (!nstyle.isStroke)
                    {
                        continue;
                    }
                    material = UMaterials.getFillUnlitMaterial(nstyle.blendMode);
                    materialPB.Clear();
                    materialPB.SetColor("_Color", nstyle.strokeColor);
                }
                else if (isFillShape && !nstyle.isFill)
                {
                    continue;
                }
                Graphics.DrawMesh(mesh, matrix, material, layer, camera, i, materialPB);
            }

            foreach (UShape shape in children)
            {
                shape.draw(matrix, col, tex, layer, camera);
            }
        }
コード例 #4
0
 public void draw(Matrix4x4 matrix, Camera camera) // for Update
 {
     UGraphics.UStyle style = nowStyle;
     draw(matrix, nowColor, style.texture, style.layer, camera);
 }