public GameObject LoadOtherPrefab(string name) { GameObject op = null; var cache = getCachedAbRes(ABType.OtherPrefab, name); if (cache == null || cache.resObj == null) { op = ABPrefab.Load(name, ABType.OtherPrefab); } else { op = cache.GetRes <GameObject>(name); } return(op); }
public GameObject LoadWindow(string name) { GameObject window = null; var cache = getCachedAbRes(ABType.Window, name); if (cache == null || cache.resObj == null)//resObj为null说明真正的资源被destroy了。需要重新加载 { window = ABPrefab.Load(name, ABType.Window); } else { Debug.Log("!!!!!!!从AB缓存获得window:" + name); window = cache.GetRes <GameObject>(name); } return(window); }
/// <summary> /// /// </summary> /// <param name="name"></param> /// <param name="reUse">对于同一时间只会存在一个的特效,reUse值为true</param> /// <returns></returns> public GameObject LoadEffect(string name, bool reUse = true) { GameObject effect = null; var cache = getCachedAbRes(ABType.Effect, name); if (cache == null || cache.resObj == null) { effect = ABPrefab.Load(name, ABType.Effect); } else { if (reUse) { effect = cache.GetRes <GameObject>(name); } else { effect = ABPrefab.Load(name, ABType.Effect); } } return(effect); }