// 加载图像 public void loadImage(LoadParam param) { if (!m_path2ResDic.ContainsKey(param.m_path)) { // 保存加载事件处理,因为这个时候资源还没有加载,这次调用仅仅是想加载 AtlasScriptRes ,不想直接回调事件处理函数 Action <IDispatchObject> tmpLoadEventHandle = param.m_loadEventHandle; param.m_loadEventHandle = null; AtlasScriptRes atlasRes = createResItem <AtlasScriptRes>(param); param.m_loadEventHandle = tmpLoadEventHandle; tmpLoadEventHandle = null; atlasRes.loadImage(param); tmpLoadEventHandle = param.m_loadEventHandle; param.m_loadEventHandle = null; param.m_loadInsRes = atlasRes; load <AtlasScriptRes>(param); } else { (m_path2ResDic[param.m_path] as AtlasScriptRes).loadImage(param); } }
public void failed(AtlasScriptRes atlasScriptRes) { m_refCountResLoadResultNotify.resLoadState.setFailed(); m_refCountResLoadResultNotify.loadResEventDispatch.dispatchEvent(this); }
public void init(AtlasScriptRes atlasScriptRes) { m_image = atlasScriptRes.getSprite(m_spriteName); m_refCountResLoadResultNotify.resLoadState.setSuccessLoaded(); m_refCountResLoadResultNotify.loadResEventDispatch.dispatchEvent(this); }