コード例 #1
0
    void Update()
    {
        if (currPack > numPacks && packStart)
        {
            Application.Quit();
        }
        else
        {
            if (packStart)
            {
                packStart = false;

                sw.Restart();
                sw.Start();
                if (runAblation)
                {
                    pack.EvolvePackAblation(fileName: fileName,
                                            shapeNet: shapeNet,
                                            savePackPerGeneration: 10,
                                            finalGeneration: 1000);
                }
                else
                {
                    pack.GeneratePack(fileName,
                                      shapeNet,
                                      useEmptySpace: useEmptySpace,
                                      initLargestShape: initLargestShape);
                }

                sw.Stop();

                Debug.Log("Generated packs: " + currPack);
                currPack++;
            }
            else
            {
                Debug.Log("Time taken: " + sw.ElapsedMilliseconds);
                packStart = true;
            }
        }
    }