Exemplo n.º 1
0
        private void SetSelecetedObjectInfo(object sender, EventArgs e)
        {
            if ((sender as TextBox).Enabled == true)
            {
                string info = (sender as TextBox).AccessibleName;
                if (info == "pos")
                {
                    float x, y, z;
                    bool  boolX, boolY, boolZ;
                    boolX = float.TryParse(TextBox_Pos_X.Text, out x);
                    boolY = float.TryParse(TextBox_Pos_Y.Text, out y);
                    boolZ = float.TryParse(TextBox_Pos_Z.Text, out z);

                    if (boolX && boolY && boolZ)
                    {
                        m_GameEngine.SetSelectedObjectInfo(info, x, y, z);
                    }
                }

                if (info == "rot")
                {
                    float x, y, z;
                    bool  boolX, boolY, boolZ;
                    boolX = float.TryParse(TextBox_Rot_X.Text, out x);
                    boolY = float.TryParse(TextBox_Rot_Y.Text, out y);
                    boolZ = float.TryParse(TextBox_Rot_Z.Text, out z);

                    if (boolX && boolY && boolZ)
                    {
                        m_GameEngine.SetSelectedObjectInfo(info, x, y, z);
                    }
                }

                if (info == "scale")
                {
                    float x, y, z;
                    bool  boolX, boolY, boolZ;
                    boolX = float.TryParse(TextBox_Scale_X.Text, out x);
                    boolY = float.TryParse(TextBox_Scale_Y.Text, out y);
                    boolZ = float.TryParse(TextBox_Scale_Z.Text, out z);

                    if (boolX && boolY && boolZ)
                    {
                        m_GameEngine.SetSelectedObjectInfo(info, x, y, z);
                    }
                }
            }
        }