static internal void ImportSelected() { string path = UnityEditorExtensions.ShowImportDialog("Import DataNode"); if (!string.IsNullOrEmpty(path)) { var node = DataNode.Read(path, true); if (node != null) { if (node.GetChild("Prefabs") != null) { ComponentSerialization.DeserializeBundle(node); } else { Selection.activeGameObject = node.Instantiate(); } } else { Debug.LogError("Failed to parse " + path + " as DataNode"); } } }
static internal void ConvertC() { string path = UnityEditorExtensions.ShowImportDialog("Convert DataNode"); if (!string.IsNullOrEmpty(path)) { DataNode node = DataNode.Read(path, true); if (node != null) { Save(node, path, DataNode.SaveType.Compressed); } else { Debug.LogError("Failed to parse " + path + " as DataNode"); } } }