public void Load <T>(IXAssetManager manager, string name) where T : Object { m_AssetManger = manager; m_BundleName = manager.GetBundleNameByAssetName(name); m_AssetXName = name; var assetBundle = manager.LoadBundle(m_BundleName); var assetObject = assetBundle.LoadAsset <T>(m_AssetXName); SetValue(assetObject); }
//同步加载 public void Load(IXAssetManager manager, EnumFileLocation location, EnumBundleType bundleType, string name) { m_AssetManager = manager; m_BundleName = name; m_dependencies.Clear(); var dependencies = manager.GetDependencies(m_BundleName); if (dependencies != null) { m_dependencies.AddRange(dependencies); foreach (var dependency in dependencies) { manager.LoadBundle(dependency); } } var fullPath = XABUtilities.GetBundleFullPath(location, bundleType, name); XDebug.Log(XABConst.Tag, $"加载 {fullPath}"); SetValue(_LoadInternal(fullPath)); }
public AssetBundle LoadBundle(string bundleName) { XDebug.Log(XABConst.Tag, $"加载AssetBundle(同步) {bundleName}"); return(m_instance.LoadBundle(bundleName)); }