| 
					
				 | 
			
			
				@@ -1,27 +1,40 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-import { SpriteAtlas } from "cc" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import { isValid, Sprite, SpriteAtlas, SpriteFrame } from "cc" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { AssetType, resLoader } from "../res/ResLoader" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import { AsyncQueue, NextFunction } from "../queue/AsyncQueue"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+//头像类型 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+export enum HeadSpriteType{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //圆形 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    Critical = 0, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //方块 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    Square, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //圆角 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    Round, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 export class MaterialUtil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     static iconGame: SpriteAtlas = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     static iconFilter: SpriteAtlas = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    //头像 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    static iconHead: SpriteFrame = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     static Restart() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     static init(callback) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // let queue = new AsyncQueue(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // queue.pushMulti("InitPool", async (next: NextFunction, params: any, args: any) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //     resLoader.load('package', 'texture/hall/Games/Icon_Game', SpriteAtlas, (error: Error, res: SpriteAtlas) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //         if (!error) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //             this.iconGame = res; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //             if(callback) callback(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //             next() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //             console.log('游戏入口图标加载完成'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        let queue = new AsyncQueue(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        queue.pushMulti("InitPool", async (next: NextFunction, params: any, args: any) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            resLoader.load('package', 'texture/head/end_0_1/spriteFrame', SpriteFrame, (error: Error, res: SpriteFrame) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                if (!error) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    this.iconHead = res; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    if(callback) callback(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    next() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                    console.log('头像图标加载完成'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         // }, async (next: NextFunction, params: any, args: any) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //     resLoader.load('package', 'texture/hall/Games/Icon_Filter', SpriteAtlas, (error: Error, res: SpriteAtlas) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //         if (!error) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -31,13 +44,13 @@ export class MaterialUtil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //             console.log('游戏筛选图标加载完成'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //         } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //     }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // queue.complete = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        //     console.log('materialUtil初始化完成'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        queue.complete = () => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            console.log('materialUtil初始化完成'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				          
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        // queue.play(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        queue.play(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     _loadRes(LoadType: AssetType, Url, Back) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -57,4 +70,16 @@ export class MaterialUtil { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // static getIconFilterByName(name) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     //     return this.iconFilter.spriteFrames[name]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     // } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     /** 游戏入口图标 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     static getHeadByID(id,sprite:Sprite,headType:HeadSpriteType = HeadSpriteType.Critical) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+         
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        resLoader.load('package', 'texture/head/end_0_'+id+"/spriteFrame", SpriteFrame, (error: Error, res: SpriteFrame) => { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            if (!error && isValid(sprite)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                sprite.spriteFrame = res; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //return this.iconGame.spriteFrames[id]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 |