From 42ce9b2af04ef6c22d858ecd501adbc9149a3cd1 Mon Sep 17 00:00:00 2001 From: knoxHuang <821686174@qq.com> Date: Wed, 27 Apr 2016 11:51:34 +0800 Subject: [PATCH] fix CCLoader getRes bug --- cocos2d/core/load-pipeline/CCLoader.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cocos2d/core/load-pipeline/CCLoader.js b/cocos2d/core/load-pipeline/CCLoader.js index c1a538702a..50c373877b 100644 --- a/cocos2d/core/load-pipeline/CCLoader.js +++ b/cocos2d/core/load-pipeline/CCLoader.js @@ -369,7 +369,12 @@ JS.mixin(cc.loader, { * @returns {*} */ getRes: function (url) { - return this._items.getContent(url); + var item = this._items.getContent(url); + if (!item) { + var uuid = this._getResUuid(url); + item = this._items.getContent(uuid); + } + return item; }, /**