static void OpenBZW() { string path = EditorUtility.OpenFilePanelWithFilters("Select BZW file", string.Empty, GetBZWFilter()); if (path == string.Empty) { return; } if (EditorUtility.DisplayDialog("Clear Scene Objects?", "Opening a BZW file will clear any existing scene objects, are you sure you wish to continue?", "Yes", "No, import instead")) { // flush out any old objects foreach (var obj in GameObject.FindObjectsOfType(typeof(GameObject))) { GameObject mb = obj as GameObject; if (mb.GetComponent <Camera>() != null || mb.GetComponent <Light>() != null) { continue; } UnityEngine.Object.DestroyImmediate(obj); } } FromBZW.ReadUserBZW(path); }
static void ImportBZW() { string path = EditorUtility.OpenFilePanelWithFilters("Select BZW file", string.Empty, GetBZWFilter()); if (path != string.Empty) { FromBZW.ReadUserBZW(path); } }