public ABManager() { if (!isInit) { Debug.LogError("ab load: common"); AssetBundle commonAB = AB.Load("common"); commonAB.LoadAllAssets(); EventDispatcher.Instance.AddListener(EventID.OnABResLoaded, onABResLoaded); EventDispatcher.Instance.AddListener(EventID.OnRootObjDestroy, onRootObjDestroy); EventDispatcher.Instance.AddListener(EventID.OnChildObjDestroy, onChildObjDestroy); isInit = true; } }
/// <summary> /// name不带后缀,不带前缀 /// </summary> /// <param name="name"></param> /// <returns></returns> static AssetBundle LoadAB(string name) { string nameNew = ABTypeUtil.GetPreFix(ABType.Texture) + name; return(AB.Load(nameNew)); }
/// <summary> /// /// </summary> /// <param name="name">传全名(不带后缀)</param> /// <returns></returns> static AssetBundle LoadAB(string name) { return(AB.Load(name)); }