This commit is contained in:
pan
2024-08-15 10:53:40 +08:00
parent cc2020086d
commit 8686d50a6c
10 changed files with 2596 additions and 689 deletions

View File

@@ -13,7 +13,8 @@ const { ccclass, property } = _decorator;
@ccclass('CardControllerComp')
@ecs.register('CardController', false)
export class CardControllerComp extends CCComp {
card_level = 1;
card_level:number = 1;
in_load:boolean = false
start() {
this.load_cards()
// var entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
@@ -34,7 +35,15 @@ export class CardControllerComp extends CCComp {
this.load_cards()
}
}
palyer_ref(){
if (this.in_load) {
return
}
this.load_cards()
}
load_cards() {
this.in_load = true
let old_cards = ecs.query(ecs.allOf(HeroCardViewComp))
if (old_cards.length > 0) {
old_cards.forEach(element => {
@@ -53,6 +62,8 @@ export class CardControllerComp extends CCComp {
x=x+100
});
this.node.getChildByName("cards").getChildByName("active").active = false
this.in_load = false;
}
/** 转场 */
protected update(dt: number): void {
@@ -67,6 +78,7 @@ export class CardControllerComp extends CCComp {
}
return lists
}
/** 视图对象通过 ecs.Entity.remove(ControllerComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();

View File

@@ -0,0 +1,41 @@
import { _decorator,v3 ,NodeEventType} 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 { HeroCard } from "../monster/HeroCard";
import { HeroCardViewComp } from "../monster/HeroCardViewComp";
import { RandomManager } from "../../../../extensions/oops-plugin-framework/assets/core/common/random/RandomManager";
import { CardList } from "../common/config/CardSet";
const { ccclass, property } = _decorator;
/** 视图层对象 */
@ccclass('RefControllerComp')
@ecs.register('RefController', false)
export class RefControllerComp extends CCComp {
card_level = 1;
protected onLoad(): void {
}
start() {
}
protected update(dt: number): void {
}
reset() {
this.node.destroy();
}
onTouch(){
}
}

View File

@@ -0,0 +1 @@
{"ver":"4.0.23","importer":"typescript","imported":true,"uuid":"6527b285-9d12-416e-8963-5e39820b7d4e","files":[],"subMetas":{},"userData":{}}

View File

@@ -3,6 +3,7 @@ import { oops } from "../../../../../extensions/oops-plugin-framework/assets/cor
import MapData from "./map/base/MapData";
import { MapLoadModel } from "./map/base/MapLoadModel";
import EntityLayer from "./map/layer/EntityLayer";
import SkillLayer from "./map/layer/SkillLayer";
import MapLayer from "./map/layer/MapLayer";
const { ccclass, property } = _decorator;
@@ -27,6 +28,9 @@ export class MapViewScene extends Component {
@property(EntityLayer)
public entityLayer: EntityLayer | null = null;
@property(SkillLayer)
public SkillLayer: SkillLayer | null = null;
@property(CCBoolean)
public isFollowPlayer: boolean = true;