33 lines
		
	
	
		
			830 B
		
	
	
	
		
			TypeScript
		
	
	
	
		
		
			
		
	
	
			33 lines
		
	
	
		
			830 B
		
	
	
	
		
			TypeScript
		
	
	
	
|  | import { _decorator, color, Component, Node, Sprite, tween, Vec3 } from 'cc'; | ||
|  | const { ccclass, property } = _decorator; | ||
|  | 
 | ||
|  | @ccclass('loading_game') | ||
|  | export class loading_game extends Component { | ||
|  |     start() { | ||
|  |         //线性减淡
 | ||
|  |         const RD = this.node.getComponent(Sprite).getMaterialInstance(0); | ||
|  |         RD.overridePipelineStates({ | ||
|  |             blendState: { | ||
|  |                 isA2C: true, | ||
|  |                 isIndepend: true, | ||
|  |                 targets: [{ | ||
|  |                     blend: true, | ||
|  |                     blendSrc: 1, | ||
|  |                     blendDst: 1, | ||
|  |                     blendSrcAlpha: 1, | ||
|  |                     blendDstAlpha: 1, | ||
|  |                 }] | ||
|  |             }, | ||
|  |         }, 0); | ||
|  | 
 | ||
|  |         //旋转缓动
 | ||
|  |         tween(this.node).by(1.5, { angle: -360 },).repeatForever().start(); | ||
|  |     } | ||
|  | 
 | ||
|  |     update(deltaTime: number) { | ||
|  | 
 | ||
|  |     } | ||
|  | } | ||
|  | 
 | ||
|  | 
 |