Exemplo n.º 1
0
        private void DeleteSelectedGO()
        {
            LevelGameObject selectedGO = objectList.SelectedItem as LevelGameObject;

            if (selectedGO == null)
            {
                MessageBox.Show(this, "Please select a game object from the list first.", "Delete game object");
                return;
            }
            if (selectedGO is Shadowcaster)
            {
                return;
            }

            var diagResult = MessageBox.Show(
                this,
                "Are you sure you wish to delete the selected " + selectedGO + "?",
                "Delete game object",
                MessageBoxButtons.OKCancel
                );

            if (diagResult == DialogResult.OK)
            {
                currentLevel.DeleteGameObject(selectedGO);
                currentLevel.ResetGameObjects();
                UpdateObjectList();
            }
        }