Merge pull request #1202 from jareguo/v1.3

fix loadResAll
This commit is contained in:
Wang Nan
2016-10-17 15:06:28 +08:00
committed by GitHub
3 changed files with 19 additions and 5 deletions
+8 -4
View File
@@ -381,10 +381,14 @@ JS.mixin(CCLoader.prototype, {
}
this.load(res, function (errors, items) {
var results = [];
for (var key in items.map) {
var item = items.getContent(key);
self.setAutoReleaseRecursively(item, false);
results.push(item);
for (var i = 0; i < res.length; ++i) {
var uuid = res[i].uuid;
var item = items.getContent(uuid);
if (item) {
// should not release these assets, even if they are static referenced in the scene.
self.setAutoReleaseRecursively(uuid, false);
results.push(item);
}
}
if (completeCallback) {
completeCallback(errors, results);
+2
View File
@@ -26,6 +26,8 @@
module.exports = {
isDomNode: typeof window === 'object' && (typeof Node === 'function' ?
function (obj) {
// If "TypeError: Right-hand side of 'instanceof' is not callback" is thrown,
// it should because window.Node was overwritten.
return obj instanceof Node;
} :
function (obj) {
+9 -1
View File
@@ -58,7 +58,7 @@ else {
cc._initDebugSetting(1); // DEBUG_MODE_INFO
}
// LOAD EXTENDS FOR FIREBALL
// LOAD EXTENDS FOR CREATOR
require('./extends');
@@ -70,6 +70,14 @@ if (CC_EDITOR) {
* var isDomNode = cc._require('./cocos2d/core/platform/utils').isDomNode;
*/
cc._require = require;
/*
* Checks if the extension is loaded.
* This method is used to make editor code more elegant, so only available in editor.
* @param {string} moduleName - such as 'sp', 'dragonBones', 'TiledMap'... etc.
*/
cc.hasExtension = function (moduleName) {
return moduleName in global || moduleName in cc;
};
}
if (isMainProcess) {