예제 #1
0
파일: Scene.cs 프로젝트: BaldMan82/iGL
        public void AddResource(Resource resource)
        {
            resource.Scene = this;

            if (Loaded) resource.Load();

            _resources.Add(resource);
        }
예제 #2
0
파일: Scene.cs 프로젝트: BaldMan82/iGL
 public void RemoveResource(Resource res)
 {
     _resources.Remove(res);
 }
예제 #3
0
        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();
        }