You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					56 lines
				
				2.2 KiB
			
		
		
			
		
	
	
					56 lines
				
				2.2 KiB
			| 
											10 months ago
										 | import { ryw_Event } from "../../FrameWork/Event/EventEnum";
 | ||
|  | import EventMgr from "../../FrameWork/Event/EventMgr";
 | ||
|  | import Common5 from "../../Platform/th/Common5";
 | ||
|  | import TaskManager, { MainTaskIdEnum } from "../JuQingChat/TaskManager";
 | ||
|  | import CccGame from "../WenZiRes/WenZiCommon/CccGame";
 | ||
|  | 
 | ||
|  | const { ccclass, property } = cc._decorator;
 | ||
|  | 
 | ||
|  | @ccclass
 | ||
|  | export default class celebrateEvent extends cc.Component {
 | ||
|  | 
 | ||
|  |     start() {
 | ||
|  |         EventMgr.onEvent_custom(ryw_Event.updateMainTask, () => {
 | ||
|  |             let taskInfo: any = TaskManager.getCurUnLockMainTaskInfo();
 | ||
|  |             if (taskInfo.Id == MainTaskIdEnum.MainTask_1206) {
 | ||
|  |                 console.log("MainTaskIdEnum.MainTask_1206");
 | ||
|  |                 this.node.getChildByName("上市庆祝").active = true;
 | ||
|  |             }
 | ||
|  |         }, this);
 | ||
|  |     }
 | ||
|  | 
 | ||
|  |     protected onEnable(): void {
 | ||
|  |         let taskInfo: any = TaskManager.getCurUnLockMainTaskInfo();
 | ||
|  |         if (taskInfo.Id == MainTaskIdEnum.MainTask_1206) {
 | ||
|  |             console.log("MainTaskIdEnum.MainTask_1206");
 | ||
|  |             this.node.getChildByName("上市庆祝").active = true;
 | ||
|  |         }
 | ||
|  |     }
 | ||
|  | 
 | ||
|  |     onClickConfirm(event) {
 | ||
|  |         let target = event.target;
 | ||
|  |         target.active = false;
 | ||
|  |         CccGame.playAnimation2(this.node.getChildByName("剪彩"), "剪彩", false, null, (spineNode) => {
 | ||
|  |             spineNode.active = false;
 | ||
|  |             Common5.playEffectCustom('XianCheng', 'sound/烟花');
 | ||
|  |             CccGame.playAnimation2(this.node.getChildByName("烟花"), "烟花", false, null, (spineNode) => {
 | ||
|  |                 spineNode.active = false;
 | ||
|  |                 cc.tween(this.node.getChildByName("上市成功"))
 | ||
|  |                     .set({ active: true, scale: 0 })
 | ||
|  |                     .to(0.5, { scale: 1 })
 | ||
|  |                     .delay(1)
 | ||
|  |                     .to(0.5, { opacity: 0 })
 | ||
|  |                     .call(() => {
 | ||
|  |                         TaskManager.finishCurMainTask(MainTaskIdEnum.MainTask_1206);
 | ||
|  |                         TaskManager.setCurUnLockMainTaskInfo(MainTaskIdEnum.MainTask_1301);
 | ||
|  |                         EventMgr.emitEvent_custom(ryw_Event.EnterNextGame, true)
 | ||
|  |                     })
 | ||
|  |                     .set({ opacity: 255, active: false })
 | ||
|  |                     .start();
 | ||
|  |             });
 | ||
|  |         });
 | ||
|  |     }
 | ||
|  | 
 | ||
|  |     // update (dt) {}
 | ||
|  | }
 |