mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #622 from natural-law/tiledmap
Solve the error that can't get the content of depended RawAsset by url.
This commit is contained in:
@@ -263,6 +263,15 @@ function downloadUuid (item, callback) {
|
||||
item.url = url;
|
||||
item.isRawAsset = isRawAsset;
|
||||
if (isRawAsset) {
|
||||
self.pipeline._items.map[url] = {
|
||||
id: url,
|
||||
url: url,
|
||||
type: Path.extname(url).toLowerCase().substr(1),
|
||||
error: null,
|
||||
alias: item.id,
|
||||
complete: true
|
||||
};
|
||||
|
||||
var ext = Path.extname(url).toLowerCase();
|
||||
if (!ext) {
|
||||
callback(new Error('Download Uuid: can not find type of raw asset[' + uuid + ']: ' + url));
|
||||
|
||||
@@ -124,7 +124,17 @@ JS.mixin(LoadingItems.prototype, CallbacksInvoker.prototype, {
|
||||
*/
|
||||
getContent: function (id) {
|
||||
var item = this.map[id];
|
||||
return item ? item.content : null;
|
||||
var ret = null;
|
||||
if (item) {
|
||||
if (item.content) {
|
||||
ret = item.content;
|
||||
}
|
||||
else if (item.alias) {
|
||||
ret = this.getContent(item.alias);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -177,7 +177,7 @@ var TiledMap = cc.Class({
|
||||
},
|
||||
|
||||
_tmxFile: {
|
||||
default: '',
|
||||
default: null,
|
||||
type: cc.TiledMapAsset
|
||||
},
|
||||
/**
|
||||
@@ -671,6 +671,7 @@ var TiledMap = cc.Class({
|
||||
var child = logicChildren[i];
|
||||
var tmxLayer = child.getComponent(cc.TiledLayer);
|
||||
var zOrderValue = child.getSiblingIndex();
|
||||
child.setLocalZOrder(zOrderValue);
|
||||
if (tmxLayer) {
|
||||
if (tmxLayer._sgNode) {
|
||||
tmxLayer._sgNode.setLocalZOrder(zOrderValue);
|
||||
|
||||
Reference in New Issue
Block a user