示例#1
0
 private void onLayerGenerated()
 {
     if (LayerGenerated == null)
     {
         return;
     }
     LayerGenerated.Invoke(this, new StatusChangedArgument());
 }
    // Start is called before the first frame update

    public void FetchLayer(int nextLayerToFetch, LayerGenerated layerGenerated)
    {
        this.nextLayerToFetch = nextLayerToFetch;
        if (linesPerLayer.Keys.Count == 0)
        {
            // First layer is added
            linesPerLayer.Add(0, new List <GameObject>());
        }

        // Make sure we have reset the previous layer(s) because we need them for placing the new layer
        foreach (var layer in linesPerLayer.Select(x => x.Value))
        {
            foreach (var line in layer)
            {
                line.GetComponent <ProceduralMesh>().Reset();
            }
        }

        layerGeneratedCallback = layerGenerated;
        GenerateNextLayer(new List <GameObject>());
    }