/// <summary>
        /// How to display the window
        /// Needs to be static or else it will not show in the editor
        /// </summary>
        public static void ShowWindow()
        {
            // Create the editor window
            EditorWindow procGenWindow = EditorWindow.GetWindow(typeof(ProceduralGenerationEditorWindow));

            // The min size the window can be
            // This is so the window shows the header text when it is created
            procGenWindow.minSize = new Vector2(minWindowSize, minWindowSize);

            // Set the different types of levels based on the LevelTypes enum values
            int numOfLevelTypes = (int)LevelTypes.NUMOFLEVELTYPES;

            m_levelTypeOptions = new string[numOfLevelTypes];
            for (int i = 0; i < numOfLevelTypes; i++)
            {
                // Convert the int to the LevelType enum value then to string
                m_levelTypeOptions[i] = ((LevelTypes)i).ToString();
            }

            // Create the styles for the window
            CreateStyles();

            // Create the perlin noise and GUI for it
            m_perlinNoise    = new PerlinNoise();
            m_perlinNoiseGUI = new PerlinNoiseGUI(m_perlinNoise.SeedClass, m_perlinNoise,
                                                  m_header2Style, m_header3Style, m_header4Style);

            // Create the binary space partition and GUI for it
            m_binarySpacePartition    = new BinarySpacePartition();
            m_binarySpacePartitionGUI = new BinarySpacePartitionGUI(m_binarySpacePartition.SeedClass, m_binarySpacePartition,
                                                                    m_header2Style, m_header3Style, m_header4Style);
        }
        /// <summary>
        /// Constructor
        /// </summary>
        public BinarySpacePartitionGUI(GeneratorSeed seed, BinarySpacePartition bsp,
                                       GUIStyle header2, GUIStyle header3, GUIStyle header4) :
            base(seed, title, header2, header3, header4)
        {
            // Call the ProceduralGenerationAlgorithmGUI constructor

            m_binarySpacePartition = bsp;
        }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="centre">The centre of the cell</param>
 /// <param name="width">Width of the cell</param>
 /// <param name="height">Height of the cell</param>
 /// <param name="botLeftCorner">The bot left corner of the cell</param>
 /// <param name="grid">The spawn grid which is used to output the dungeon</param>
 /// <param name="BSP">The Binary Space Partition class being used</param>
 public BinarySpacePartitionTreeNode(Vector2 centre, int width, int height, Vector2 botLeftCorner, ref int[,] grid, BinarySpacePartition BSP)
 {
     m_children             = new List <BinarySpacePartitionTreeNode>();
     m_centre               = centre;
     m_width                = width;
     m_height               = height;
     m_botLeftCorner        = botLeftCorner;
     m_spawnGrid            = grid;
     m_binarySpacePartition = BSP;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="BSP">The BSP script being used</param>
 public BinarySpacePartitionSeed(BinarySpacePartition BSP)
 {
     // Total number of variables, used when creating the seed and setting the seed value to the variables
     m_numOfVariablesUserCanChange = numOfVariables;
     m_binarySpacePartition        = BSP;
 }