2.0.9.p1 版本动态加载spine动画报错!!!

spineDemo.rar (1.2 MB)

修复代码,将在 2.0.10 登录 https://github.com/cocos-creator/engine/pull/4020

1赞

// If create by manual, uuid is empty.
this._uuid = this._uuid || value.skeleton.hash;
你们都不验证一下的吗,在新版本2.4.6中value传进来的是字符串,又不是json对象怎么获取skeleton字段。你们也太马虎了吧,还有就是二进制根本不能用,请修复!

···js
skeletonJson: {

        get: function () {

            return this._skeletonJson;

        },

        set: function (value) {

            this.reset();

            if (typeof(value) == "string") {

                this._skeletonJson = JSON.parse(value);

            } else {

                this._skeletonJson = value;

            }

            // If create by manual, uuid is empty.

            if (!this._uuid && value.skeleton) {

                this._uuid = value.skeleton.hash;

            }

        }

    },

···

修改为:
// If create by manual, uuid is empty.

            if (!this._uuid && this._skeletonJson.skeleton) {

                this._uuid = this._skeletonJson.skeleton.hash;

            }

@jare

2.4.6版本动态加载二进制spine,求解决