Example #1
0
        static void Main(string[] args)
        {
            int   seed      = System.Environment.TickCount;
            int   timeStart = System.Environment.TickCount;
            float ratio     = 0.3f;

            Console.Out.WriteLine("Seed: " + seed);
            Console.Out.WriteLine();

            Console.Out.WriteLine("Without Connecting Rooms");
            CaveGenerator caveFactory = new CaveGenerator(79, 50, seed, ratio);

            caveFactory.GenerateMap(false);
            PrintMap(caveFactory);

            Console.Out.WriteLine("With Connecting Rooms");
            caveFactory = new CaveGenerator(79, 50, seed, ratio);
            caveFactory.GenerateMap(true);
            PrintMap(caveFactory);

            Console.Out.WriteLine();
            Console.Out.WriteLine("Time To Generate: " + ((System.Environment.TickCount - timeStart) / 1000).ToString() + "s");

            Console.In.ReadLine();
        }
    public override void OnInspectorGUI()
    {
        CaveGenerator room = target as CaveGenerator;

        if (DrawDefaultInspector())
        {
            room.GenerateMap();
        }
    }
Example #3
0
 // Use this for initialization
 private void Start()
 {
     map = cavegen.GenerateMap();
 }