Example #1
0
 void OnFocus()
 {
     if (EditorPrefs.HasKey(DataPathKey))
     {
         dataPath = EditorPrefs.GetString(DataPathKey);
     }
     ROSEImport.MaybeUpdate();
 }
Example #2
0
    void OnGUI()
    {
        GUILayout.Label("Settings", EditorStyles.boldLabel);
        dataPath = EditorGUILayout.TextField("3DData Path", dataPath);

        GUILayout.Label("Importing", EditorStyles.boldLabel);
        GUILayout.Label("Current Path: " + ROSEImport.GetCurrentPath());
        if (GUILayout.Button("Clear Unity 3Ddata"))
        {
            ROSEImport.ClearUData();
        }
        if (GUILayout.Button("Clear All 3Ddata"))
        {
            ROSEImport.ClearData();
        }

        GUILayout.Label("Maps", EditorStyles.boldLabel);

        mapListShowUnnamed = GUILayout.Toggle(mapListShowUnnamed, "Show Unnamed Maps");

        var mapData = ROSEImport.GetMapListData();

        if (mapData != null)
        {
            mapListScrollPosition = GUILayout.BeginScrollView(mapListScrollPosition, GUILayout.Height(400));
            for (var i = 0; i < mapData.stb.Cells.Count; ++i)
            {
                string mapName = mapData.stl.GetString(mapData.stb.Cells[i][27], STL.Language.English);
                if (mapName != null || mapListShowUnnamed)
                {
                    GUILayout.BeginHorizontal();
                    GUILayout.Label("[" + i.ToString() + "] " + mapName);
                    if (GUILayout.Button("Import", GUILayout.Width(100)))
                    {
                        ROSEImport.ImportMap(i);
                    }
                    GUILayout.EndHorizontal();
                }
            }
            GUILayout.EndScrollView();
        }


        if (EditorGUIUtility.editingTextField)
        {
            wasEditing = true;
        }
        else
        {
            if (wasEditing)
            {
                wasEditing = false;
                EditorPrefs.SetString(DataPathKey, dataPath);
                ROSEImport.MaybeUpdate();
            }
        }
    }
Example #3
0
 public Mesh ImportMesh(int meshIdx)
 {
     return(ROSEImport.ImportMesh(zsc.Models[meshIdx]));
 }
Example #4
0
 void OnDestroy()
 {
     EditorPrefs.SetString(DataPathKey, dataPath);
     ROSEImport.MaybeUpdate();
 }
Example #5
0
 void OnLostFocus()
 {
     EditorPrefs.SetString(DataPathKey, dataPath);
     ROSEImport.MaybeUpdate();
 }