mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user