예제 #1
0
    public void Start()
    {
        this.LineMaterial                  = new Material("Shader \"Lines/Colored Blended\" { SubShader { Pass { Blend SrcAlpha OneMinusSrcAlpha ZWrite Off Cull Front Fog { Mode Off } } } }");
        this.LineMaterial.hideFlags        = HideFlags.HideAndDontSave;
        this.LineMaterial.shader.hideFlags = HideFlags.HideAndDontSave;
        MeshFilter component  = base.GetComponent <MeshFilter>();
        Mesh       sharedMesh = component.sharedMesh;

        Vector3[] vertices  = sharedMesh.vertices;
        int[]     triangles = sharedMesh.triangles;
        for (int i = 0; i < triangles.Length / 3; i++)
        {
            int num = i * 3;
            WireFrameLineRenderer.Line l  = new WireFrameLineRenderer.Line(vertices[triangles[num]], vertices[triangles[num + 1]]);
            WireFrameLineRenderer.Line l2 = new WireFrameLineRenderer.Line(vertices[triangles[num + 1]], vertices[triangles[num + 2]]);
            WireFrameLineRenderer.Line l3 = new WireFrameLineRenderer.Line(vertices[triangles[num + 2]], vertices[triangles[num]]);
            if (this.Fidelity == 3)
            {
                this.AddLine(l);
                this.AddLine(l2);
                this.AddLine(l3);
            }
            else if (this.Fidelity == 2)
            {
                this.AddLine(l);
                this.AddLine(l2);
            }
            else if (this.Fidelity == 1)
            {
                this.AddLine(l);
            }
        }
    }
예제 #2
0
 public override bool Equals(object obj)
 {
     if (obj == null)
     {
         return(false);
     }
     WireFrameLineRenderer.Line line = obj as WireFrameLineRenderer.Line;
     return(line != null && ((this.PointA == line.PointA && this.PointB == line.PointB) || (this.PointA == line.PointB && this.PointB == line.PointA)));
 }
예제 #3
0
    public void AddLine(WireFrameLineRenderer.Line l)
    {
        bool flag = false;

        foreach (WireFrameLineRenderer.Line current in this.LinesArray)
        {
            if (l == current)
            {
                flag = true;
                break;
            }
        }
        if (!flag)
        {
            this.LinesArray.Add(l);
        }
    }
예제 #4
0
 public bool Equals(WireFrameLineRenderer.Line lB)
 {
     return((this.PointA == lB.PointA && this.PointB == lB.PointB) || (this.PointA == lB.PointB && this.PointB == lB.PointA));
 }