static void LoadTranformTree() { var selected = Selection.activeObject; if (selected is GameObject) { string o_path = EditorUtility.OpenFilePanel("Assets", Application.dataPath, "bin"); if (o_path == null | o_path == "") { return; } if (File.Exists(o_path)) { TransformTree.Load((selected as GameObject).transform, File.ReadAllBytes(o_path)); } } }
static void SaveTranformTree() { var selected = Selection.activeObject; if (selected is GameObject) { string o_path = EditorUtility.SaveFilePanel("Save Resource", "Assets", selected.name, "bin"); if (o_path == null | o_path == "") { return; } var mesh = TransformTree.Save((selected as GameObject).transform); if (File.Exists(o_path)) { File.Delete(o_path); } File.WriteAllBytes(o_path, mesh); } }