//Do the simulation in a coroutine so we can pause and see what's going on
    private IEnumerator SimulateCavePattern()
    {
        for (int i = 0; i < simulationSteps; i++)
        {
            yield return(new WaitForSeconds(pauseTime));

            //Calculate the new values
            Generator.SmoothMap();

            //Generate texture and display it on the plane
            GenerateAndDisplayTexture(Generator.GetMap());
        }
        Debug.Log("Simulation completed!");
    }
Example #2
0
        // check for 5 tiles
        static void Main(string[] args)
        {
            TilesGenerator Generator = new TilesGenerator(10, 5);

            TilesGenerator.RandomizeMap();
            for (int i = 0; i < 10; ++i)
            {
                print(Generator.GetMap());
                Console.ReadKey();
                Generator.SmoothMap();
            }

            Console.WriteLine("End Generator Test");
        }