Fix motion streak material issue

This commit is contained in:
pandamicro
2018-01-17 10:44:11 +08:00
parent 895b0e04f3
commit db61add58d
+4 -2
View File
@@ -159,6 +159,8 @@ var MotionStreak = cc.Class({
},
set: function (value) {
this._texture = value;
this._material = null;
this._activateMaterial();
},
type: cc.Texture2D,
animatable: false,
@@ -216,8 +218,8 @@ var MotionStreak = cc.Class({
_activateMaterial: function () {
if (this._material) return;
let url = this._texture;
let texture = cc.textureUtil.loadImage(url);
let texture = this._texture;
let url = texture.url;
let material = renderer.materialUtil.get(url);
// Get material