10 lines
282 B
TypeScript
10 lines
282 B
TypeScript
const { ccclass, requireComponent } = cc._decorator;
|
|
|
|
@ccclass
|
|
@requireComponent(cc.Sprite)
|
|
export default class ShaderGray extends cc.Component {
|
|
onLoad() {
|
|
this.getComponent(cc.Sprite).setMaterial(0, cc.Material.getBuiltinMaterial('2d-gray-sprite'));
|
|
}
|
|
}
|