mirror of https://github.com/axmolengine/axmol.git
Plist file parsing (action-2.x.js)
This commit is contained in:
parent
3306c7b072
commit
2d12d6a295
|
@ -194,11 +194,20 @@
|
||||||
{
|
{
|
||||||
name: "FileData",
|
name: "FileData",
|
||||||
handle: function(options, resourcePath){
|
handle: function(options, resourcePath){
|
||||||
var frame = new ccs.TextureFrame();
|
var frame, texture, plist, path, spriteFrame;
|
||||||
var texture = options["TextureFile"];
|
frame = new ccs.TextureFrame();
|
||||||
|
texture = options["TextureFile"];
|
||||||
if(texture != null) {
|
if(texture != null) {
|
||||||
var path = texture["Path"];
|
plist = texture["Plist"];
|
||||||
var spriteFrame = cc.spriteFrameCache.getSpriteFrame(path);
|
path = texture["Path"];
|
||||||
|
spriteFrame = cc.spriteFrameCache.getSpriteFrame(path);
|
||||||
|
if(!spriteFrame && plist){
|
||||||
|
if(cc.loader.getRes(resourcePath + plist)){
|
||||||
|
cc.spriteFrameCache.addSpriteFrames(resourcePath + plist);
|
||||||
|
}else{
|
||||||
|
cc.log("%s need to be preloaded", resourcePath + plist);
|
||||||
|
}
|
||||||
|
}
|
||||||
if(spriteFrame == null){
|
if(spriteFrame == null){
|
||||||
path = resourcePath + path;
|
path = resourcePath + path;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue