public CopyLayerInstance(MeshVert _parent, MeshFace _element, int copyLayerId = -1)
 {
     parent         = _parent;
     element        = _element;
     offsetPosition = Vector3.zero;
     copyLayer      = CopyLayerManager.GetLayer(copyLayerId);
     copyLayer.Add(this);
 }
 public void RemoveInstance(CopyLayerInstance instance)
 {
     Instances.Remove(instance);
     if (Instances.Count == 0)
     {
         CopyLayerManager.RemoveLayer(this);
     }
 }
    public void CreateIteration(MeshFace startingFace)
    {
        Iterations.Clear();
        CopyLayerManager.GotoNextLayer();
        var iterator = new MeshIteration();

        iterator.Create(startingFace);
        Iterations.Add(iterator);
        AddIteration(iterator);
    }
    void AddIteration(MeshIteration previous)
    {
        CopyLayerManager.GotoNextLayer();
        var iterator = new MeshIteration();

        if (iterator.CreateFromIteration(previous))
        {
            Iterations.Add(iterator);
            AddIteration(iterator);
        }
    }
Example #5
0
    public void Init(int meshIndex)
    {
        // Stop Previous Animation
        StopAllCoroutines();

        // Clear Data
        meshFilter.mesh.Clear();
        //initialTriIndex = -1;
        MeshVerts.Clear();
        MeshFaces.Clear();
        Vertices.Clear();
        Triangles.Clear();

        CopyLayerManager.ResetLayers();

        ConvertMesh(meshes[meshIndex]);

        //if (clearOnStart)
        //meshFilter.mesh.Clear();
    }
 public void ChangeCopyLayer(int copyLayerId = -1)
 {
     copyLayer.RemoveInstance(this);
     copyLayer = CopyLayerManager.GetLayer(copyLayerId);
     copyLayer.Add(this);
 }