public override void OnInspectorGUI()
 {
     EditorGUILayout.Space();
     if (!string.IsNullOrEmpty(qubicleImport.ImportedFile) && serializedObject.targetObjects.Length < 2)
     {
         EditorGUILayout.Space();
         if (GUILayout.Button(new GUIContent("Re-import from Qubicle", "Re-import from original .QB file")))
         {
             if (UnityEditor.EditorUtility.DisplayDialog("Warning!",
                                                         "Re-importing will overwrite any changes made since original import. This cannot be undone!",
                                                         "OK", "Cancel"))
             {
                 QubicleImporter.QubicleImport(qubicleImport);
             }
         }
     }
 }
示例#2
0
        public void OnGUI()
        {
            EditorGUILayout.Space();
            objectName = EditorGUILayout.TextField("Volume name: ", objectName);
            EditorGUILayout.Space();
            voxelSize = EditorGUILayout.FloatField("Voxel size: ", voxelSize);

            EditorGUILayout.Space();
            EditorGUILayout.BeginHorizontal();
            if (GUILayout.Button("Select .qb/.qbt and Import"))
            {
                QubicleImporter.QubicleImport(UnityEditor.EditorUtility.OpenFilePanelWithFilters("Import QB/QBT", "", new [] { "Qubicle", "qb,qbt" }), objectName, voxelSize);

                Close();
            }
            if (GUILayout.Button("Cancel"))
            {
                Close();
            }
            EditorGUILayout.EndHorizontal();
        }