public static string GetLayoutFullPath(string prefab) { string fullpath = prefab.ToLower(); if (!fullpath.StartsWith(ConfigTool.Instance.prefab_prefix.ToLower())) { Debug.LogError("Prefab·��\"" + prefab + "\"���淶"); return(""); } fullpath = fullpath.Substring(ConfigTool.Instance.prefab_prefix.Length); fullpath = ConfigTool.Instance.layout_prefix + fullpath; fullpath = EditorTool.GetProjectFullpath() + fullpath; fullpath = EditorTool.MakesureFolderExit(fullpath) + EditorTool.GetFileName(prefab, false) + s_layout_postfix; return(fullpath); }
public static string GetPrefabPath(string layout_fullpath) { string layout_fullpath_prefix = EditorTool.GetSystemFullpath(ConfigTool.Instance.prefab_prefix).ToLower(); if (!layout_fullpath_prefix.EndsWith(ConfigTool.Instance.prefab_prefix.ToLower())) { Debug.LogError("Prefab·��ǰ\"" + layout_fullpath_prefix + "\"����"); return(""); } layout_fullpath_prefix = layout_fullpath_prefix.Substring(0, layout_fullpath_prefix.Length - ConfigTool.Instance.prefab_prefix.Length); layout_fullpath_prefix = EditorTool.MakesureFolderExit(layout_fullpath_prefix + ConfigTool.Instance.layout_prefix).ToLower(); layout_fullpath = layout_fullpath.ToLower(); if (!layout_fullpath.StartsWith(layout_fullpath_prefix)) { Debug.LogError("Layout·��\"" + layout_fullpath + "\"����"); return(""); } return(ConfigTool.Instance.prefab_prefix + layout_fullpath.Substring(layout_fullpath_prefix.Length).Replace(s_layout_postfix, s_prefab_postfix)); }