示例#1
0
    public void BuildPopulation()
    {
        creatureReferences = new GameObject[populationSize];
        for (int i = 0; i < populationSize; i++)
        {
            creatureReferences[i] = Instantiate(creatureTemplate);
        }
        lineRenderers = new GameObject[populationSize * NumberOfProbes];
        for (int i = 0; i < populationSize * NumberOfProbes; i++)
        {
            lineRenderers[i] = Instantiate(lineRendererReference);
        }

        SetRenderLayerOrderToBLUR();

        pop = new PopulationController(populationSize, creatureReferences, lifeSpan, brain, speed, angle, rayLength, inititalX, initialY, NumberOfProbes, walls, food);
        pop.SetCreatureSortingLayer("ThingsOnTopOfBackground");
    }