creator 2.1.2版本代码里设置setMaterial怎么没有效果

在编辑器里直接拖是可以的

@property(cc.Sprite)
sp:cc.Sprite = null;

@property(cc.Material)
matr:cc.Material = null;

// LIFE-CYCLE CALLBACKS:

// onLoad () {}

start () {
    this.sp.setMaterial(1,this.matr);
}

有人用过吗

改成 this.sp.setMaterial(0,this.matr);