public static List <string> GetFilesPath(string rootPath, bool deep, string suffix = "*.*") { List <string> ret = new List <string>(); ScanDirectoryFile(rootPath, deep, ret, suffix); NoEndsWithFilter filter = new NoEndsWithFilter(".meta"); SuffixHelper.Filter(ret, filter); return(ret); }
private void UpdateBuyText() { (ulong cost, int amount) = data.GetActualBulkPrice(producer.NumberOwned); buyTextNumber.text = $"{amount}"; buyText.text = $"\n {SuffixHelper.GetString(cost, false)} Tokens "; if (buyButtonAnim != null) { UpdateBuyAnim(cost); } }
/// <summary> /// 得到所有的Sprite图集的地址 /// </summary> public static List <string> GetAllSpritePath() { string[] files = Directory.GetFiles(ESpriteConst.ui_sprite_root_dir, "*.*", SearchOption.AllDirectories); EndsWithFilter suffix = new EndsWithFilter(); suffix.AddSuffix(ESpriteConst.sprite_suffix); List <string> infos = SuffixHelper.Filter(files, suffix); return(infos); }
private void UpdateText() { if (Data.ProducedAmount == 0) { Destroy(this.gameObject); return; } textUI.text = $"Tokens produced while gone: \n"; textUI.text += SuffixHelper.GetString(Data.ProducedAmount, false); textUI.enabled = true; Destroy(this.gameObject, destroyTime); }
private void Update() { var tokenString = SuffixHelper.GetString(resource.CurrentAmount, true); string[] words = tokenString.Split(new string[] { "\n" }, StringSplitOptions.None); resourceText.text = words[0]; if (words.Length < 2) { resourceSuffixText.text = ""; return; } resourceSuffixText.text = words[1]; }
public static void CreateResFile(string[] assetBundles) { // 2.通过过滤器剔除掉不是主目录的AssetBundle List <string> filterFiles = SuffixHelper.Filter(assetBundles, new StartsWithFilter(EAssetBundleConst.MAIN_RES_DRIECTORY)); // 3.添加UIRes List <string> altasFiles = SuffixHelper.Filter(assetBundles, new StartsWithFilter(EAssetBundleConst.UI_MAIN_DIRECTORY)); filterFiles.AddRange(altasFiles); filterFiles.Clear(); filterFiles.AddRange(assetBundles); List <List <string> > resultMap = new List <List <string> >(); int length = filterFiles.Count; for (int abIndex = 0; abIndex < length; abIndex++) { // 这个资源的AssetBundle名字 string abName = filterFiles[abIndex]; string[] assetBundleNames = AssetDatabase.GetAssetPathsFromAssetBundle(abName); for (int mainIndex = 0; mainIndex < assetBundleNames.Length; mainIndex++) { // 主目录下的资源路径 string mainAbPath = assetBundleNames[mainIndex]; if (mainAbPath.StartsWith(EAssetBundleConst.MAIN_RES_DRIECTORY) || mainAbPath.StartsWith(EAssetBundleConst.UI_MAIN_DIRECTORY)) { List <string> result = new List <string>(); //mainAbPath = EPathHelper.RemoveSuffix(mainAbPath); result.Add(mainAbPath.Replace("Assets/", string.Empty)); result.Add(abName); resultMap.Add(result); } } } CreateConfig(resultMap, AssetBundleConst.ResConfigName); }
private void UpdateBuyText() { buyText.text = $"{SuffixHelper.GetString(data.GetActualPrice(Castle.NumberOwned), false)}"; }