| 1234567891011121314151617181920212223242526272829 |
- const { ccclass, property } = cc._decorator;
- @ccclass
- export default class LogoShader extends cc.Component {
- @property({type: cc.Sprite})
- private sp: cc.Sprite = null;
- private mat_logo: cc.MaterialVariant = null;
- private time: number = 0;
-
- onLoad(){
- this.mat_logo = this.sp.getMaterial(0);
- this.time = this.mat_logo.getProperty('sys_time', 0);
- }
- update(dt)
- {
- this.time += 0.02;
- let t = this.mat_logo.getProperty('sys_time', 0);
- this.mat_logo.setProperty('sys_time', this.time);
- if(this.time>= 4)
- {
- this.time = 0;
- }
- }
- }
|