コード例 #1
0
ファイル: ObjectEditor.cs プロジェクト: echiappe/FlyVRenaTLC
 ///* When an Update is selected */
 private void UpdateTypes_SelectedIndexChanged(object sender, EventArgs e)
 {
     /* If the name and position of the World Object are not yet defined ask for them */
     if (!this.wObj.ContainService(typeof(PositionService)))
     {
         InsertPosition insertPosition = new InsertPosition();
         insertPosition.ShowDialog();
     }
     else if (!this.wObj.ContainService(typeof(NameService)))
     {
         InsertName insertName = new InsertName();
         insertName.ShowDialog();
     }
     /* If there is still no Collision Service add the chosen one */
     else if (!this.wObj.ContainService(typeof(UpdateService)))
     {
         if (SelectedUpdate())
         {
             this.UpdateTypes.Enabled = false;
         }
     }
 }
コード例 #2
0
ファイル: ObjectEditor.cs プロジェクト: echiappe/FlyVRenaTLC
        /* When the Add model button is pressed */
        private void AddModelButton_Click(object sender, EventArgs e)
        {
            /* If the name and possition of the object are not yet defined ask for them */
            if (!this.wObj.ContainService(typeof(PositionService)))
            {
                InsertPosition insertPosition = new InsertPosition();
                insertPosition.ShowDialog();
            }
            else if (!this.wObj.ContainService(typeof(NameService)))
            {
                InsertName insertName = new InsertName();
                insertName.ShowDialog();
            }
            else
            {
                /* Open a dialog to select the .FBX model */
                OpenFileDialog fileDialog       = new OpenFileDialog();
                string         assemblyLocation = Assembly.GetExecutingAssembly().Location;
                string         contentPath      = Path.GetFullPath(assemblyLocation);

                fileDialog.InitialDirectory = contentPath;

                fileDialog.Title = "Load Model";

                fileDialog.Filter = "Model Files (*.fbx;*.x)|*.fbx;*.x|" +
                                    "FBX Files (*.fbx)|*.fbx|" +
                                    "X Files (*.x)|*.x|" +
                                    "All Files (*.*)|*.*";

                if (fileDialog.ShowDialog() == DialogResult.OK)
                {
                    LoadModel(fileDialog.FileName);
                }
                this.StringModel.Text = fileDialog.FileName;
            }
        }