mirror of
				https://github.com/genxium/DelayNoMore
				synced 2025-10-30 19:06:52 +00:00 
			
		
		
		
	
		
			
	
	
		
			25 lines
		
	
	
		
			543 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
		
		
			
		
	
	
			25 lines
		
	
	
		
			543 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
|   | cc.Class({ | ||
|  |   extends: cc.Component, | ||
|  | 
 | ||
|  |   properties: { | ||
|  |     modeButton: { | ||
|  |       type: cc.Button, | ||
|  |       default: null | ||
|  |     }, | ||
|  |     mapNode: { | ||
|  |       type: cc.Node, | ||
|  |       default: null | ||
|  |     }, | ||
|  |   }, | ||
|  | 
 | ||
|  |   // LIFE-CYCLE CALLBACKS:
 | ||
|  |   onLoad() { | ||
|  |     const modeBtnClickEventHandler = new cc.Component.EventHandler(); | ||
|  |     modeBtnClickEventHandler.target = this.mapNode;  | ||
|  |     modeBtnClickEventHandler.component = "Map"; | ||
|  |     modeBtnClickEventHandler.handler = "onGameRule1v1ModeClicked"; | ||
|  |     this.modeButton.clickEvents.push(modeBtnClickEventHandler); | ||
|  |   } | ||
|  |    | ||
|  | }); |