public void Update() { if (AssetMode.Update()) { Reload(); } }
private void Update() { if (Time.realtimeSinceStartup - m_UpdateDelay > 0.1f) { m_UpdateDelay = Time.realtimeSinceStartup; if (AssetMode.Update()) { Repaint(); } } }
private static void DelAssset(string path) { var resInfoData = AssetMode.resInfo.resources.Find(a => a.path == path); if (resInfoData == null) { Debug.LogError("不能删除不存在的资源" + path); } else { var group = AssetMode.resInfo.groups.Find(a => a.keys.Contains(resInfoData.address)); group.keys.Remove(resInfoData.address); AssetMode.resInfo.resources.Remove(resInfoData); AssetMode.Update(); } }
private static void ChangeAssetInfo(string oldPath, string newPath) { var resInfo = AssetMode.resInfo.resources.Find(a => a.path == oldPath); resInfo.path = newPath; var rootPath = Path.GetDirectoryName(newPath); rootPath = rootPath.Replace("\\", "/"); var name1 = Path.GetFileName(newPath); string abName = string.Empty; string url = string.Empty; resInfo.isResourcesPath = newPath.Contains("/Resources/"); if (rootPath != null) { if (resInfo.isResourcesPath) { int index = rootPath.LastIndexOf("/Resources", StringComparison.Ordinal); if (rootPath.Length <= index + 11) { abName = string.Empty; url = "r://" + name1; } else { abName = rootPath.Substring(index + 11); url = "r://" + abName + "/" + name1; } } else { var path1 = rootPath.Replace(ResConfig.ExternalResDir + "/", ""); ; url = "e://" + path1 + "/" + name1; abName = path1.Replace("/", "_"); } } resInfo.path = newPath; resInfo.ABName = abName; resInfo.url = url; AssetMode.Update(); }