private static void AddOnesOfFolder(DirectoryInfo dirInfo, string suffix, bool key_no_suffix = false, bool folder_name_tolower = false) { FileInfo[] files = dirInfo.GetFiles("*" + suffix, 1); for (int i = 0; i < files.Length; i++) { FileInfo fileInfo = files[i]; if (!fileInfo.get_Name().EndsWith("meta")) { string text = fileInfo.get_Name(); if (key_no_suffix) { text = text.Remove(text.get_Length() - suffix.get_Length()); } if (!ResBase.Names.Contains(text)) { if (folder_name_tolower) { ResBase.AddNameOfFolder(text, fileInfo.get_Directory().get_Name().ToLower()); } else { ResBase.AddNameOfFolder(text, fileInfo.get_Directory().get_Name()); } } } } }
private static void ResourcesOffxs() { ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(".prefab"); ResBase.RootPath = PathSystem.GetGameEffectPrefabRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty)); }
private static void AddOnesOfPath(DirectoryInfo dirInfo, string suffix, bool key_no_suffix, string searchPattern = "*", bool key_tolower = false, string custom_suffix = "") { if (dirInfo == null) { return; } FileInfo[] files = dirInfo.GetFiles(searchPattern + suffix, 1); for (int i = 0; i < files.Length; i++) { FileInfo fileInfo = files[i]; if (!fileInfo.get_Name().EndsWith("meta")) { string text = fileInfo.get_Name(); if (key_no_suffix) { text = text.Remove(text.get_Length() - suffix.get_Length()); } if (!ResBase.Names.Contains(text)) { if (key_tolower) { text = text.ToLower(); } text += custom_suffix; ResBase.AddNameOfPath(text, fileInfo.get_FullName().Remove(fileInfo.get_FullName().get_Length() - suffix.get_Length()).Replace("\\", "/")); } } } }
private static void ResourcesOfUI() { ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(FileSystem.key_suffix_prefab); ResBase.RootPath = PathSystem.GetReservedPrefabRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty)); ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(FileSystem.key_suffix_prefab); ResBase.RootPath = PathSystem.GetUIPrefabRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty)); ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(FileSystem.key_suffix_prefab); ResBase.RootPath = PathSystem.GetUI3DPrefabRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty)); ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(FileSystem.key_suffix_prefab); ResBase.RootPath = PathSystem.GetReservedPrefabRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty)); ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(FileSystem.key_suffix_material); ResBase.RootPath = PathSystem.GetUI3DPrefabRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, string.Empty)); ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(FileSystem.key_suffix_controller); ResBase.RootPath = PathSystem.GetUIAnimRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty)); ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(FileSystem.key_suffix_prefab); ResBase.RootPath = PathSystem.GetSpineRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, FileSystem.key_suffix_spine)); }
private static void ResourcesOfAnimatorController() { ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(".controller"); ResBase.RootPath = PathSystem.GetActorAnimationRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty)); }
private static void ResourcesOfSceneLightmaps() { ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(".prefab"); ResBase.RootPath = PathSystem.GetSceneRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "s*", false, string.Empty)); }
private static void ResourcesOfShaders() { ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(".prefab"); ResBase.RootPath = PathSystem.GetShaderPrefabRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, ".shader")); }
private static void ResourcesOfAudios() { ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(".wav"); ResBase.Suffixs.Add(".mp3"); ResBase.RootPath = PathSystem.GetAudioRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(false, "*", false, string.Empty)); }
public static Hashtable GetNamesOfFolder(bool key_no_suffix = false, bool folder_name_tolower = false) { ResBase.Names.Clear(); DirectoryInfo dirInfo = new DirectoryInfo(ResBase.RootPath); for (int i = 0; i < ResBase.Suffixs.get_Count(); i++) { ResBase.AddOnesOfFolder(dirInfo, ResBase.Suffixs.get_Item(i), key_no_suffix, folder_name_tolower); } return(ResBase.Names); }
public static Hashtable GetNamesOfPath(bool no_suffix_key, string searchPattern = "*", bool key_tolower = false, string custom_suffix = "") { ResBase.Names.Clear(); DirectoryInfo dirInfo = new DirectoryInfo(ResBase.RootPath); for (int i = 0; i < ResBase.Suffixs.get_Count(); i++) { ResBase.AddOnesOfPath(dirInfo, ResBase.Suffixs.get_Item(i), no_suffix_key, searchPattern, key_tolower, custom_suffix); } return(ResBase.Names); }
public UntransactedPostCommand(Guid id, string name, Guid?aff1, Guid?aff2, string nodeName) { _id = id; _name = name; var res = CreateResource(name); res.Payload = Guid.NewGuid(); res.ResourceAffinity1 = aff1; res.ResourceAffinity2 = aff2; res.NodeAffinity = nodeName; Res = res; }
private static void ResourcesOfTPAtlas() { ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(".png"); ResBase.Suffixs.Add(".jpg"); ResBase.Suffixs.Add(".PNG"); ResBase.Suffixs.Add(".JPG"); ResBase.RootPath = PathSystem.GetSrcSpriteRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfFolder(true, true)); ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(".png"); ResBase.Suffixs.Add(".jpg"); ResBase.Suffixs.Add(".PNG"); ResBase.Suffixs.Add(".JPG"); ResBase.RootPath = PathSystem.GetSrcSpriteRGBRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfFolder(true, true)); ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(".prefab"); ResBase.RootPath = PathSystem.GetTPAtlasRoot(PathType.absPath); Hashtable namesOfPath = ResBase.GetNamesOfPath(true, "*", true, string.Empty); ResourceMap2File.Add2AllResources(namesOfPath); string text = string.Empty; IEnumerator enumerator = namesOfPath.get_Keys().GetEnumerator(); try { while (enumerator.MoveNext()) { object current = enumerator.get_Current(); string text2 = current.ToString(); text2 = text2.Substring(0, text2.get_Length() - "_pb".get_Length()); text = text + text2 + ';'; } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } ResourceMap2File.AllResources.set_Item("UiAtlas_KEY", text); ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(".prefab"); ResBase.RootPath = PathSystem.GetReservedPrefabRoot(PathType.absPath); namesOfPath = ResBase.GetNamesOfPath(true, "*", true, string.Empty); ResourceMap2File.Add2AllResources(namesOfPath); }
private static void ResourcesOfTexture() { ResBase.Suffixs.Clear(); ResBase.Suffixs.Add(".png"); ResBase.Suffixs.Add(".jpg"); ResBase.Suffixs.Add(".tga"); ResBase.Suffixs.Add(".psd"); ResBase.RootPath = PathSystem.GetTextureRGBARoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, string.Empty)); ResBase.RootPath = PathSystem.GetTextureRGBRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, string.Empty)); ResBase.RootPath = PathSystem.GetTextureShaderRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, string.Empty)); ResBase.RootPath = PathSystem.GetReservedPrefabRoot(PathType.absPath); ResourceMap2File.Add2AllResources(ResBase.GetNamesOfPath(true, "*", false, string.Empty)); }