public void AddResource(Resource resource) { resource.Scene = this; if (Loaded) resource.Load(); _resources.Add(resource); }
public void RemoveResource(Resource res) { _resources.Remove(res); }
private void Ok_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtName.Text) || string.IsNullOrEmpty((string)comboResource.SelectedItem)) { MessageBox.Show("Invalid resource"); return; } if ((string)comboType.SelectedItem == "Texture") { Resource = new Texture() { ResourceName = (string)comboResource.SelectedItem, Name = txtName.Text }; } else if ((string)comboType.SelectedItem == "Font") { Resource = new iGL.Engine.Resources.Font() { ResourceName = (string)comboResource.SelectedItem, Name = txtName.Text }; } else if ((string)comboType.SelectedItem == "ColladaMesh") { Resource = new ColladaMesh() { ResourceName = (string)comboResource.SelectedItem, Name = txtName.Text }; } else { throw new NotSupportedException(comboType.SelectedValue.ToString()); } DialogResult = System.Windows.Forms.DialogResult.OK; Close(); }