/// <summary> /// 加载资源的异步委托 /// </summary> /// <param name="name">注意,这个name是FGUI内部组装的纹理全名,例如FUILogin_atlas0</param> /// <param name="extension"></param> /// <param name="type"></param> /// <param name="item"></param> private static async void LoadPackageInternalAsync(string name, string extension, System.Type type, PackageItem item) { Texture texture = await ResourcesComponent.Instance.LoadAssetAsync <Texture>(ABPathUtilities.GetFGUIResPath(name, extension)); item.owner.SetItemAsset(item, texture, DestroyMethod.Unload); }
public void RemovePackage(string type) { UIPackage package; if (packages.TryGetValue(type, out package)) { var p = UIPackage.GetByName(package.name); if (p != null) { UIPackage.RemovePackage(package.name); } packages.Remove(package.name); } if (!Define.ResModeIsEditor) { Game.Scene.GetComponent <ResourcesComponent>().UnLoadAsset(ABPathUtilities.GetFGUIDesPath($"{type}_fui")); Game.Scene.GetComponent <ResourcesComponent>().UnLoadAsset(ABPathUtilities.GetFGUIResPath($"{type}_atlas0")); } }