mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 16:52:43 +08:00
update pr
This commit is contained in:
@@ -341,6 +341,16 @@ JS.mixin(cc.loader, {
|
||||
* var texture = assets[0];
|
||||
* var spriteFrame = assets[1];
|
||||
* });
|
||||
*
|
||||
* // load all textures in "resources/imgs/"
|
||||
* cc.loader.loadResAll('imgs', cc.Texture2D, function (err, textures) {
|
||||
* if (err) {
|
||||
* cc.error(err);
|
||||
* return;
|
||||
* }
|
||||
* var texture1 = textures[0];
|
||||
* var texture2 = textures[1];
|
||||
* });
|
||||
*/
|
||||
loadResAll: function (url, type, completeCallback) {
|
||||
if (!completeCallback && type && !cc.isChildClassOf(type, cc.RawAsset)) {
|
||||
|
||||
@@ -46,19 +46,6 @@ function isMatchByWord (path, test) {
|
||||
}
|
||||
|
||||
cc.js.mixin(AssetTable.prototype, {
|
||||
|
||||
///**
|
||||
// * Check if the table contains a specific object. <br/>
|
||||
// * <br/>
|
||||
// * Note: All asset paths in Creator use forward slashes, paths using backslashes will not work.
|
||||
// *
|
||||
// * @method contains
|
||||
// * @param {string} path - (not support wildcard)
|
||||
// * @return {boolean}
|
||||
// */
|
||||
//contains: function (path) {
|
||||
// return (path in this._pathToUuid);
|
||||
//},
|
||||
|
||||
getUuid: function (path, type) {
|
||||
path = cc.url.normalize(path);
|
||||
@@ -127,15 +114,6 @@ cc.js.mixin(AssetTable.prototype, {
|
||||
}
|
||||
return uuids;
|
||||
},
|
||||
|
||||
///**
|
||||
// * Returns all asset paths in the table.
|
||||
// * @method getAllPaths
|
||||
// * @return {string[]}
|
||||
// */
|
||||
//getAllPaths: function () {
|
||||
// return Object.keys(this._pathToUuid);
|
||||
//},
|
||||
|
||||
/**
|
||||
* @method add
|
||||
@@ -175,17 +153,7 @@ cc.js.mixin(AssetTable.prototype, {
|
||||
pathToUuid[path] = newEntry;
|
||||
}
|
||||
},
|
||||
//_removeByPath: function (path) {
|
||||
// delete this._pathToUuid[path];
|
||||
//}
|
||||
//_removeByUuid: function (uuid) {
|
||||
// for (var path in this._pathToUuid) {
|
||||
// if (this._pathToUuid[path] === uuid) {
|
||||
// delete this._pathToUuid[path];
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
reset: function () {
|
||||
this._pathToUuid = {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user