Exemple #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (LevelEditor game = new LevelEditor())
     {
         game.Run();
     }
 }
Exemple #2
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (LevelEditor game = new LevelEditor())
     {
         game.Run();
     }
 }
Exemple #3
0
 private static void Main()
 {
     using (var game = new LevelEditor())
     {
         game.Run();
     }
 }
        static void Initialize()
        {
            LevelEditor window = (LevelEditor)EditorWindow.GetWindow(typeof(LevelEditor));

            window.title   = LevelEditorConstants.LevelEditor;
            window.minSize = new Vector2(LevelEditorConstants.i600, LevelEditorConstants.i300);
            window.Show();
        }
Exemple #5
0
        // makes a blank level editor
        private void createMapButton_Click(object sender, EventArgs e)
        {
            bool   error    = false;
            string message1 = "";
            string message2 = "";
            int    width;
            int    height;

            // checks for errors
            if (int.TryParse(widthText.Text, out width))
            {
                if (width < 10)
                {
                    error    = true;
                    message1 = "\n - Width too small. Minimum is 10.";
                }
                else if (int.Parse(widthText.Text) > 30)
                {
                    error    = true;
                    message1 = "\n - Width too big. Maximum is 30.";
                }
            }
            else
            {
                message1 = "\n - Width not an interger."; error = true;
            }
            if (int.TryParse(heightText.Text, out height))
            {
                if (height < 10)
                {
                    error    = true;
                    message2 = "\n - Height too small. Minimum is 10.";
                }
                else if (height > 30)
                {
                    error    = true;
                    message2 = "\n - Height too big. Maximum is 30.";
                }
            }
            else
            {
                message2 = "\n - Height not an interger."; error = true;
            }
            if (error)
            {
                MessageBox.Show("Errors: " + message1 + message2);
            }

            else
            {
                LevelEditor editor = new LevelEditor(int.Parse(heightText.Text), int.Parse(widthText.Text));
                editor.Show();
            }
        }
Exemple #6
0
        // Loads a map from .level files
        private void loadButton_Click(object sender, EventArgs e)
        {
            OpenFileDialog open = new OpenFileDialog();

            open.Title  = "Open a level file";
            open.Filter = "Level Files (*.level)|*.level";
            if (open.ShowDialog() == DialogResult.OK)
            {
                LevelEditor editor = new LevelEditor(open.FileName);
                editor.Show();
            }
        }
Exemple #7
0
        private void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            else
            {
                Destroy(gameObject);
            }

            // Desactivating all Save related panels
            generateBoardPanel?.SetActive(false);
            saveBoardPanel?.SetActive(false);
            boardSavedPanel?.SetActive(false);
            overrideFilePanel?.SetActive(false);

            // Desactivating all Load related panels.
            loadBoardPanel?.SetActive(false);

            // Initializing Feedback Section
            currentlySelectedBuildingBlock.InitializeEmptyCell();
        }