Пример #1
0
    void CreateLine(Vector2[] points)
    {
        var _object      = new GameObject("PolygonLine");
        var meshFilter   = _object.AddComponent <MeshFilter>();
        var meshRenderer = _object.AddComponent <MeshRenderer>();

        meshFilter.sharedMesh = LinePolygon.CreateMesh(points, 1f);
        meshRenderer.material = this.Mateiral;
    }
        void CreateLine(Vector2[] points)
        {
            var _object      = new GameObject("PolygonLine");
            var meshFilter   = _object.AddComponent <MeshFilter>();
            var meshRenderer = _object.AddComponent <MeshRenderer>();

            meshFilter.sharedMesh = LinePolygon.CreateMesh(points, 0.01f);
            meshRenderer.material = this.Material;
            _object.transform.SetParent(this.transform);
        }