import { _decorator,Button,EventHandler,EventTouch,Label,NodeEventType,resources,Sprite,SpriteAtlas,tween,UITransform,v3 } from "cc"; import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS"; import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp"; import { smc } from "../common/SingletonModuleComp"; import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops"; import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager"; import { SkillSet } from "../common/config/SkillSet"; import { HeroModelComp } from "../hero/HeroModelComp"; import { GameSet } from "../common/config/BoxSet"; import { GameMap } from "./GameMap"; import { MapModelComp } from "./model/MapModelComp"; import { Talent } from "../Role/Talent"; import { Talents } from "../common/config/TalentSet"; import { HeroViewComp } from "../hero/HeroViewComp"; import { Position } from "../../../../extensions/oops-plugin-framework/assets/libs/gui/badge/Badge"; import { MissionHomeComp } from "./MissionHomeComp"; import { GameEvent } from "../common/config/GameEvent"; import { MissionComp } from "./MissionComp"; const { ccclass, property } = _decorator; /** 视图层对象 */ @ccclass('CardControllerComp') @ecs.register('CardController', false) export class CardControllerComp extends CCComp { touch_time:number = 0 in_touch:boolean = false bbg:any=null bbg_y:number=40 bbg_x:any=[-300,-150,0,150,300] protected onLoad(): void { // this.on(GameEvent.MissionEnd,this.mission_home_to_mission,this) } start() { this.page_init() } show_info(uuid:number,type:number){ console.log("show_info",uuid) } protected update(dt: number): void { if(smc.vmdata.game_over||smc.vmdata.game_pause){ return } } page_init(){ this.node.getChildByName("mission_home").active=true; this.node.getChildByName("mission").active=false; } mission_home_to_mission(){ let mission=this.node.getChildByName("mission").getComponent(MissionComp) mission.node.active = true; mission.mission_start() smc.mission.play = true; } mission_to_mission_home(){ let mission_home=this.node.getChildByName("mission_home").getComponent(MissionHomeComp) this.node.getChildByName("mission_home").active = true let mission=this.node.getChildByName("mission") mission.active = false mission_home.load_ui_heros() } show_hero_home(){ let hero_home=this.node.getChildByName("hero_home") hero_home.active = true } /** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */ reset() { this.node.destroy(); } }