dd
This commit is contained in:
@@ -5,6 +5,7 @@ import { data } from "../data/data";
|
||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||
import { smc } from "../common/SingletonModuleComp";
|
||||
import { CardSet } from "../common/config/CardSet";
|
||||
import { HeroCard } from "./HeroCard";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@@ -30,19 +31,35 @@ export class HeroCardViewComp extends CCComp {
|
||||
if(this.ent.eid != args.eid){
|
||||
this.no_active()
|
||||
}
|
||||
}
|
||||
do_active(){
|
||||
|
||||
}
|
||||
do_active(){
|
||||
// console.log(this.node.getChildByName("active"),this.node.getChildByName("use"), this.node.getChildByName("bag"))
|
||||
let active = this.node.getChildByName("active")
|
||||
let use = this.node.getChildByName("use")
|
||||
let bag = this.node.getChildByName("bag")
|
||||
active.active = !active.active
|
||||
use.active = !use.active
|
||||
bag.active = !bag.active
|
||||
}
|
||||
no_active(){
|
||||
// this.node.getChildByName("active").active=false;
|
||||
// this.node.getChildByName("use").active=false;
|
||||
// this.node.getChildByName("bag").active=false;
|
||||
let active = this.node.getChildByName("active")
|
||||
let use = this.node.getChildByName("use")
|
||||
let bag = this.node.getChildByName("bag")
|
||||
active.active = false
|
||||
use.active = false
|
||||
bag.active = false
|
||||
}
|
||||
doit(){
|
||||
// this.do_active()
|
||||
console.log("doit",this.ent)
|
||||
smc.vm_data.cards.eid = this.ent.eid;
|
||||
this.do_active()
|
||||
let hero_cards = ecs.query(ecs.allOf(HeroCardViewComp))
|
||||
hero_cards.forEach(element => {
|
||||
if(element.eid != this.ent.eid)
|
||||
element.get(HeroCardViewComp).no_active()
|
||||
});
|
||||
// console.log("doit",hero_cards)
|
||||
// oops.message.dispatchEvent("active_card_eid",{eid:this.ent.eid})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user